|
@@ -1359,7 +1359,6 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
|
|
|
ErrorCodeEnum eErrDev;
|
|
|
CSimpleString errMsg(true);
|
|
|
|
|
|
- int initTries = 0;
|
|
|
CSimpleStringA dllName;
|
|
|
GetVendorDllName(dllName);
|
|
|
|
|
@@ -1386,7 +1385,7 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
|
|
|
GetEntityBase()->GetFunction()->ShowFatalError("加载厂商适配器失败!请检查root.ini配置是否正确。");
|
|
|
return Error_DevLoadFileFailed;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
for (int i = 0; i < HOPPER_NUM; ++i)
|
|
|
{
|
|
|
m_CardBoxNoEx[i] = "";
|
|
@@ -1401,186 +1400,169 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
|
|
|
m_csMaintainTimeEx[i] = "";
|
|
|
m_MaintainTimeEx[i] = 0;
|
|
|
}
|
|
|
- long l_beginTime,l_endTime;
|
|
|
- do {
|
|
|
+ long l_beginTime, l_endTime;
|
|
|
+ l_beginTime = GetTickCountRVC();
|
|
|
+ eErrDev = m_hDevHelper->DevOpenEx(m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(), btOpenType, pDevSN, m_connectType);
|
|
|
+ l_endTime = GetTickCountRVC();
|
|
|
+
|
|
|
+ if (eErrDev == Error_Succeed)
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DevOpenEx").setCostTime(l_endTime - l_beginTime)("OpenDevice::DevOpenEx succ, port:%d, baudRate:%d, openType:%d, connectType:%d", m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(), btOpenType, m_connectType);
|
|
|
+ m_devOpenFailedCount = 0;
|
|
|
+ ZeroMemory(m_devCat.szModel, sizeof(m_devCat.szModel));
|
|
|
+ ZeroMemory(m_devCat.szType, sizeof(m_devCat.szType));
|
|
|
+ ZeroMemory(m_devCat.szVendor, sizeof(m_devCat.szVendor));
|
|
|
l_beginTime = GetTickCountRVC();
|
|
|
- eErrDev = m_hDevHelper->DevOpenEx(m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(), btOpenType, pDevSN, m_connectType);
|
|
|
+ eErrDev = m_hDevHelper->GetDevCategory(m_devCat);
|
|
|
l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
+
|
|
|
if (eErrDev == Error_Succeed)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DevOpenEx").setCostTime(l_endTime - l_beginTime)("OpenDevice::DevOpenEx succ, port:%d, baudRate:%d, openType:%d, connectType:%d", m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(),btOpenType, m_connectType);
|
|
|
- m_devOpenFailedCount = 0;
|
|
|
- ZeroMemory(m_devCat.szModel, sizeof(m_devCat.szModel));
|
|
|
- ZeroMemory(m_devCat.szType, sizeof(m_devCat.szType));
|
|
|
- ZeroMemory(m_devCat.szVendor, sizeof(m_devCat.szVendor));
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- eErrDev = m_hDevHelper->GetDevCategory(m_devCat);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErrDev == Error_Succeed)
|
|
|
- {
|
|
|
- int ret = SplitDevModelInfo();
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevCategory").setCostTime(l_endTime - l_beginTime)("OpenDevice::GetDevCategory SplitDevModelInfo=%d",ret);
|
|
|
- m_adapterInfo.FulfillCategoryInfo(m_devCat);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- SetErrorAndLog(eErrDev, MEC_DEVAPI_CARDISSUER_GetDevCategory, "DevAdapter::GetDevCategory", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
- return Error_Unexpect;
|
|
|
- }
|
|
|
-
|
|
|
- if (!LoadCMBPrint(csBinPath))
|
|
|
- {
|
|
|
- errMsg = CSimpleStringA::Format("CardIssuerStand启动失败:Load CMBPrint failed.");
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_LoadLibraryA_CMBPrint_Failed, errMsg.GetData());
|
|
|
- return Error_DevLoadFileFailed;
|
|
|
- }
|
|
|
- initTries = 0;
|
|
|
- break;
|
|
|
+ int ret = SplitDevModelInfo();
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevCategory").setCostTime(l_endTime - l_beginTime)("OpenDevice::GetDevCategory SplitDevModelInfo=%d", ret);
|
|
|
+ m_adapterInfo.FulfillCategoryInfo(m_devCat);
|
|
|
}
|
|
|
- else {
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OpenDevice::DevOpenEx err, port:%d, baudRate:%d, openType:%d, connectType:%d", m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(), btOpenType, m_connectType);
|
|
|
- errMsg = CSimpleStringA::Format("OpenDevice::DevOpenEx err, port:%d, baudRate:%d, openType:%d, connectType:%d", m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(), btOpenType, m_connectType);
|
|
|
- SetErrorAndLog(eErrDev, MEC_DEVAPI_CARDISSUER_DevOpenEx, "DevAdapter::DevOpenEx", __FUNCTION__, false, l_endTime - l_beginTime, "", errMsg.GetData());
|
|
|
-
|
|
|
- //DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("CardIssuerStand启动失败:DevOpenEx failed.重试:%d", initTries);
|
|
|
- Sleep(200);
|
|
|
- initTries++;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SetErrorAndLog(eErrDev, MEC_DEVAPI_CARDISSUER_GetDevCategory, "DevAdapter::GetDevCategory", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
+ return Error_Unexpect;
|
|
|
}
|
|
|
- } while (initTries < INIT_TRY_NUM);
|
|
|
|
|
|
- if (initTries != 0)
|
|
|
- {
|
|
|
- errMsg = CSimpleStringA::Format("CardIssuerStand启动失败,have tried %d times!!!", initTries);
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_DevOpen_Failed, errMsg.GetData());
|
|
|
+ if (!LoadCMBPrint(csBinPath))
|
|
|
+ {
|
|
|
+ errMsg = CSimpleStringA::Format("CardIssuerStand启动失败:Load CMBPrint failed.");
|
|
|
+ LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_LoadLibraryA_CMBPrint_Failed, errMsg.GetData());
|
|
|
+ return Error_DevLoadFileFailed;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ errMsg = CSimpleStringA::Format("OpenDevice::DevOpenEx err, port:%d, baudRate:%d, openType:%d, connectType:%d", m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(), btOpenType, m_connectType);
|
|
|
+ SetErrorAndLog(eErrDev, MEC_DEVAPI_CARDISSUER_DevOpenEx, "DevAdapter::DevOpenEx", __FUNCTION__, false, l_endTime - l_beginTime, "", errMsg.GetData());
|
|
|
return Error_DevCommFailed;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- eErrDev = spEntityFunction->OpenConfig(Config_Run, spConfig);
|
|
|
- if (eErrDev != Error_Succeed) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("CardIssuerStand启动失败:open run cfg file failed in OpenDevice."));
|
|
|
- CloseAndClearDevObj(false);
|
|
|
- return eErrDev;
|
|
|
- }
|
|
|
- int ret = 0;
|
|
|
- spConfig->ReadConfigValueInt("all", "HopperNum", m_hopperNum);
|
|
|
- spConfig->ReadConfigValueInt("all", "CardCaptured", m_CardCaptured);
|
|
|
|
|
|
- if (btOpenType == DEV_OPEN_TYPE_COM)
|
|
|
+ eErrDev = spEntityFunction->OpenConfig(Config_Run, spConfig);
|
|
|
+ if (eErrDev != Error_Succeed) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("CardIssuerStand启动失败:open run cfg file failed in OpenDevice."));
|
|
|
+ CloseAndClearDevObj(false);
|
|
|
+ return eErrDev;
|
|
|
+ }
|
|
|
+ int ret = 0;
|
|
|
+ spConfig->ReadConfigValueInt("all", "HopperNum", m_hopperNum);
|
|
|
+ spConfig->ReadConfigValueInt("all", "CardCaptured", m_CardCaptured);
|
|
|
+
|
|
|
+ if (btOpenType == DEV_OPEN_TYPE_COM)
|
|
|
+ {
|
|
|
+ //oiltest@20201118 for songrui
|
|
|
+ if (m_csMachineType.Compare("RVC.CardPrinter") == 0)
|
|
|
+ m_hopperNum = 5;
|
|
|
+ else
|
|
|
{
|
|
|
- //oiltest@20201118 for songrui
|
|
|
- if (m_csMachineType.Compare("RVC.CardPrinter") == 0)
|
|
|
- m_hopperNum = 5;
|
|
|
+ if (m_connectType >= 1 && m_connectType <= 3)
|
|
|
+ m_hopperNum = m_connectType;
|
|
|
else
|
|
|
{
|
|
|
- if (m_connectType >= 1 && m_connectType <= 3)
|
|
|
- m_hopperNum = m_connectType;
|
|
|
+ //oiltmp if "RVC.CardPrinter" the m_hopperNum is 6,where can this num come from?
|
|
|
+ if (m_csMachineType.Compare("RVC.CardPrinter") == 0)
|
|
|
+ m_hopperNum = 5;
|
|
|
else
|
|
|
- {
|
|
|
- //oiltmp if "RVC.CardPrinter" the m_hopperNum is 6,where can this num come from?
|
|
|
- if (m_csMachineType.Compare("RVC.CardPrinter") == 0)
|
|
|
- m_hopperNum = 5;
|
|
|
- else
|
|
|
- m_hopperNum = 3;
|
|
|
- }
|
|
|
+ m_hopperNum = 3;
|
|
|
}
|
|
|
- for (int i = 0; i < m_hopperNum; ++i)
|
|
|
- m_bHasHopper[i] = true;
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("has %d hopper.", m_hopperNum));
|
|
|
- char sec[2];
|
|
|
for (int i = 0; i < m_hopperNum; ++i)
|
|
|
- {
|
|
|
- ZeroMemory(sec, 2);
|
|
|
- _itoa(i + 1, (char*)sec, 10);
|
|
|
- spConfig->ReadConfigValue(sec, "CardBoxNo", m_CardBoxNoEx[i]);
|
|
|
- spConfig->ReadConfigValue(sec, "PsbCode", m_PsbCodeEx[i]);
|
|
|
- spConfig->ReadConfigValue(sec, "PsbName", m_PsbNameEx[i]);
|
|
|
- spConfig->ReadConfigValueInt(sec, "CardInit", m_CardInitEx[i]);
|
|
|
- spConfig->ReadConfigValueInt(sec, "CardRemains", m_remainsEx[i]);
|
|
|
- spConfig->ReadConfigValueInt(sec, "CardIssued", m_issuedEx[i]);
|
|
|
- spConfig->ReadConfigValueInt(sec, "CardMixed", m_mixedEx[i]);
|
|
|
- spConfig->ReadConfigValueInt(sec, "CardPercent", m_CardPercentEx[i]);
|
|
|
- spConfig->ReadConfigValue(sec, "Maintainer", m_MaintainerEx[i]);
|
|
|
- spConfig->ReadConfigValue(sec, "MaintainTime", m_csMaintainTimeEx[i]);
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("init cardbox, CardBoxNo:%s, PsbCodeEx:%s, PsbNameEx:%s, CardInit:%d, CardRemains:%d, CardIssued:%d, CardMixed:%d",
|
|
|
- m_CardBoxNoEx[i].GetData(),
|
|
|
- m_PsbCodeEx[i].GetData(),
|
|
|
- m_PsbNameEx[i].GetData(),
|
|
|
- m_CardInitEx[i],
|
|
|
- m_remainsEx[i],
|
|
|
- m_issuedEx[i],
|
|
|
- m_mixedEx[i]));
|
|
|
- }
|
|
|
- if (m_hopperNum == 1 && btOpenType == DEV_OPEN_TYPE_COM)//oilyang 如果没有配置,使用原来的配置
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("use new hopper cfg record"));
|
|
|
- }
|
|
|
- //oilyang 回写卡机配置
|
|
|
- spConfig->WriteConfigValueInt("all", "HopperNum", m_hopperNum);
|
|
|
- spConfig->WriteConfigValueInt("1", "CardPercent", m_CardPercentEx[0]);
|
|
|
- spEntityFunction->OpenConfig(Config_CenterSetting, spConfigCS);
|
|
|
+ m_bHasHopper[i] = true;
|
|
|
+ }
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("has %d hopper.", m_hopperNum));
|
|
|
+ char sec[2];
|
|
|
+ for (int i = 0; i < m_hopperNum; ++i)
|
|
|
+ {
|
|
|
+ ZeroMemory(sec, 2);
|
|
|
+ _itoa(i + 1, (char*)sec, 10);
|
|
|
+ spConfig->ReadConfigValue(sec, "CardBoxNo", m_CardBoxNoEx[i]);
|
|
|
+ spConfig->ReadConfigValue(sec, "PsbCode", m_PsbCodeEx[i]);
|
|
|
+ spConfig->ReadConfigValue(sec, "PsbName", m_PsbNameEx[i]);
|
|
|
+ spConfig->ReadConfigValueInt(sec, "CardInit", m_CardInitEx[i]);
|
|
|
+ spConfig->ReadConfigValueInt(sec, "CardRemains", m_remainsEx[i]);
|
|
|
+ spConfig->ReadConfigValueInt(sec, "CardIssued", m_issuedEx[i]);
|
|
|
+ spConfig->ReadConfigValueInt(sec, "CardMixed", m_mixedEx[i]);
|
|
|
+ spConfig->ReadConfigValueInt(sec, "CardPercent", m_CardPercentEx[i]);
|
|
|
+ spConfig->ReadConfigValue(sec, "Maintainer", m_MaintainerEx[i]);
|
|
|
+ spConfig->ReadConfigValue(sec, "MaintainTime", m_csMaintainTimeEx[i]);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("init cardbox, CardBoxNo:%s, PsbCodeEx:%s, PsbNameEx:%s, CardInit:%d, CardRemains:%d, CardIssued:%d, CardMixed:%d",
|
|
|
+ m_CardBoxNoEx[i].GetData(),
|
|
|
+ m_PsbCodeEx[i].GetData(),
|
|
|
+ m_PsbNameEx[i].GetData(),
|
|
|
+ m_CardInitEx[i],
|
|
|
+ m_remainsEx[i],
|
|
|
+ m_issuedEx[i],
|
|
|
+ m_mixedEx[i]));
|
|
|
+ }
|
|
|
+ if (m_hopperNum == 1 && btOpenType == DEV_OPEN_TYPE_COM)//oilyang 如果没有配置,使用原来的配置
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("use new hopper cfg record"));
|
|
|
+ }
|
|
|
+ //oilyang 回写卡机配置
|
|
|
+ spConfig->WriteConfigValueInt("all", "HopperNum", m_hopperNum);
|
|
|
+ spConfig->WriteConfigValueInt("1", "CardPercent", m_CardPercentEx[0]);
|
|
|
+ spEntityFunction->OpenConfig(Config_CenterSetting, spConfigCS);
|
|
|
|
|
|
- int tmpCardnoMismatch = 0, tmpICRetryTimes = 1, tmpStopUseRF = 0, tmpCheckInterval = 200;
|
|
|
+ int tmpCardnoMismatch = 0, tmpICRetryTimes = 1, tmpStopUseRF = 0, tmpCheckInterval = 200;
|
|
|
|
|
|
- spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "EacQueryFlag", m_eacQueryFlag);
|
|
|
- spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "UseCardnoMismatch", tmpCardnoMismatch);
|
|
|
- spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "ICRetryTimes", tmpICRetryTimes);
|
|
|
- spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "StopUseRF", tmpStopUseRF);
|
|
|
- spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "CheckCardInInterval", tmpCheckInterval);
|
|
|
- spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "RFVendorList", m_rfVendorList);
|
|
|
- spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "SwallowCardUrl", m_csSwallowCardUrl);
|
|
|
- spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "SyncMaterialUrl", m_csSyncMaterialUrl);
|
|
|
- spConfigCS->ReadConfigValue("Common", "EacQueryHost", m_EacQueryHost);
|
|
|
+ spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "EacQueryFlag", m_eacQueryFlag);
|
|
|
+ spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "UseCardnoMismatch", tmpCardnoMismatch);
|
|
|
+ spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "ICRetryTimes", tmpICRetryTimes);
|
|
|
+ spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "StopUseRF", tmpStopUseRF);
|
|
|
+ spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "CheckCardInInterval", tmpCheckInterval);
|
|
|
+ spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "RFVendorList", m_rfVendorList);
|
|
|
+ spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "SwallowCardUrl", m_csSwallowCardUrl);
|
|
|
+ spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "SyncMaterialUrl", m_csSyncMaterialUrl);
|
|
|
+ spConfigCS->ReadConfigValue("Common", "EacQueryHost", m_EacQueryHost);
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("EacQueryFlag:%d,EacQueryHost:%s,UseCardnoMismatch:%d,ICRetryTimes:%d,StopUseRF:%d"
|
|
|
- , m_eacQueryFlag, m_EacQueryHost.GetData(), tmpCardnoMismatch, tmpICRetryTimes, tmpStopUseRF);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("EacQueryFlag:%d,EacQueryHost:%s,UseCardnoMismatch:%d,ICRetryTimes:%d,StopUseRF:%d"
|
|
|
+ , m_eacQueryFlag, m_EacQueryHost.GetData(), tmpCardnoMismatch, tmpICRetryTimes, tmpStopUseRF);
|
|
|
|
|
|
- if (tmpCardnoMismatch == 1)
|
|
|
- m_bUseCardnoMismatch = true;
|
|
|
- if (tmpICRetryTimes > 0 && tmpICRetryTimes < 4)
|
|
|
- m_ICRetryTimes = tmpICRetryTimes;
|
|
|
- if (tmpStopUseRF == 1)
|
|
|
- m_bStopUseRF = true;
|
|
|
- if (tmpCheckInterval >= 100 && tmpCheckInterval <= 1000)
|
|
|
- m_iCheckCardInInterval = tmpCheckInterval;
|
|
|
+ if (tmpCardnoMismatch == 1)
|
|
|
+ m_bUseCardnoMismatch = true;
|
|
|
+ if (tmpICRetryTimes > 0 && tmpICRetryTimes < 4)
|
|
|
+ m_ICRetryTimes = tmpICRetryTimes;
|
|
|
+ if (tmpStopUseRF == 1)
|
|
|
+ m_bStopUseRF = true;
|
|
|
+ if (tmpCheckInterval >= 100 && tmpCheckInterval <= 1000)
|
|
|
+ m_iCheckCardInInterval = tmpCheckInterval;
|
|
|
|
|
|
|
|
|
- ret = CheckIfHasCardOnCase(CheckCard_OnOpen);
|
|
|
+ ret = CheckIfHasCardOnCase(CheckCard_OnOpen);
|
|
|
|
|
|
- if (ret == 0)
|
|
|
- {
|
|
|
- //oilyang@20191219 获取吞卡箱容量,目前有便携卡机,大机
|
|
|
- //超过5,认为是脏数据,用默认值3
|
|
|
- CardIssuerStatus cis;
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- eErrDev = m_hDevHelper->GetDevStatus(cis);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
+ if (ret == 0)
|
|
|
+ {
|
|
|
+ //oilyang@20191219 获取吞卡箱容量,目前有便携卡机,大机
|
|
|
+ //超过5,认为是脏数据,用默认值3
|
|
|
+ CardIssuerStatus cis;
|
|
|
+ l_beginTime = GetTickCountRVC();
|
|
|
+ eErrDev = m_hDevHelper->GetDevStatus(cis);
|
|
|
+ l_endTime = GetTickCountRVC();
|
|
|
|
|
|
- if (eErrDev != Error_Succeed) {
|
|
|
- SetErrorAndLog(eErrDev, MEC_DEVAPI_CARDISSUER_GetDevStatus, "DevAdapter::GetDevStatus", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevStatus").setCostTime(l_endTime - l_beginTime)("OpenDevice::GetDevStatus device max retain count:%d, cis.eRetainBin:%d", cis.dwRetainCount, cis.eRetainBin);
|
|
|
- if (cis.dwRetainCount > 0 && cis.dwRetainCount <= 5)
|
|
|
- m_maxRetainCount = cis.dwRetainCount;
|
|
|
- else
|
|
|
- m_maxRetainCount = 3;
|
|
|
- if (cis.eRetainBin == CI_RETAINBIN_FULL)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA23B8")("sensor say:retain bin is full!回收箱满了,请及时清理!");
|
|
|
- }
|
|
|
- }
|
|
|
- return Error_Succeed;
|
|
|
+ if (eErrDev != Error_Succeed) {
|
|
|
+ SetErrorAndLog(eErrDev, MEC_DEVAPI_CARDISSUER_GetDevStatus, "DevAdapter::GetDevStatus", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_Open_Failed, "启动后检查是否有卡或处理吞卡失败");
|
|
|
- return Error_Unexpect;
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevStatus").setCostTime(l_endTime - l_beginTime)("OpenDevice::GetDevStatus device max retain count:%d, cis.eRetainBin:%d", cis.dwRetainCount, cis.eRetainBin);
|
|
|
+ if (cis.dwRetainCount > 0 && cis.dwRetainCount <= 5)
|
|
|
+ m_maxRetainCount = cis.dwRetainCount;
|
|
|
+ else
|
|
|
+ m_maxRetainCount = 3;
|
|
|
+ if (cis.eRetainBin == CI_RETAINBIN_FULL)
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA23B8")("sensor say:retain bin is full!回收箱满了,请及时清理!");
|
|
|
+ }
|
|
|
}
|
|
|
+ return Error_Succeed;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_Open_Failed, "启动后检查是否有卡或处理吞卡失败");
|
|
|
+ return Error_Unexpect;
|
|
|
}
|
|
|
}
|
|
|
|