|
@@ -1722,20 +1722,6 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerStandService_IssueEx_Req
|
|
|
|
|
|
return 2;
|
|
|
}
|
|
|
- //forbid front enter
|
|
|
-
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- errCode = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (errCode != Error_Succeed)
|
|
|
- {
|
|
|
- SetErrorAndLog(errCode, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("IssueCard::SetCardInType");
|
|
|
- }
|
|
|
-
|
|
|
FSMSetIssueFlag(1);
|
|
|
//move card to holder
|
|
|
|
|
@@ -1797,17 +1783,6 @@ int CCardIssuerFSM::CaptureCard(SpReqAnsContext<CardIssuerStandService_Capture_R
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CaptureCard>, set card captured failed");
|
|
|
m_pCardProcess->DataInit();
|
|
|
if (Error_Succeed == eErr){
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- eErr = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
-
|
|
|
- if (eErr != Error_Succeed) {
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("CaptureCard::SetCardInType");
|
|
|
- }
|
|
|
if (ctx != NULL)
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
@@ -1872,15 +1847,6 @@ int CCardIssuerFSM::WaitFetchingCard()
|
|
|
Sleep(WAIT_INTERVAL);
|
|
|
}
|
|
|
else{
|
|
|
-
|
|
|
- m_ullBeginTime = GetTickCountRVC();
|
|
|
- eErr = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- m_ullEndTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErr != Error_Succeed)
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "", "");
|
|
|
- else
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(m_ullEndTime - m_ullBeginTime)();
|
|
|
LogEvent(Severity_Middle, LOG_EVT_CARDISSUER_GREEN_OFF,"CardReader(fetch) warning off");
|
|
|
return 0;
|
|
|
}
|
|
@@ -2008,21 +1974,7 @@ Err:
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<InternalAcceptCard>, Cancel InterAccept, eject card.");
|
|
|
eErr = MachineMoveCardFrontGate(IsInBusiness());
|
|
|
|
|
|
- if (Error_Succeed == eErr) {
|
|
|
- m_ullBeginTime = GetTickCountRVC();
|
|
|
- eErr = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- m_ullEndTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErr != Error_Succeed) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("InternalAcceptCard::SetCardInType CI_CARD_IN_TYPE_FORBIDDEN err");
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "", "InternalAcceptCard::SetCardInType CI_CARD_IN_TYPE_FORBIDDEN err");
|
|
|
-
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(m_ullEndTime - m_ullBeginTime)("InternalAcceptCard::SetCardInType CI_MEDIA_PRESENT CI_CARD_IN_TYPE_FORBIDDEN");
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
+ if (eErr != Error_Succeed)
|
|
|
{
|
|
|
//吐卡失败,前面已有告警,这里不再告警
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("InternalAcceptCard::MachineMoveCardFrontGate failed(0x%x)", eErr);
|
|
@@ -4390,20 +4342,6 @@ int CCardIssuerFSM::EjectJS(SpReqAnsContext<CardIssuerStandService_EjectJS_Req,
|
|
|
Sleep(WAIT_INTERVAL);
|
|
|
}
|
|
|
else {
|
|
|
-
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- ErrorCodeEnum eErr = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
-
|
|
|
- if (eErr != Error_Succeed) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("EjectJS::SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN) err");
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220342", "EjectJS::SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN) err");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("EjectJS::SetCardInType");
|
|
|
- }
|
|
|
-
|
|
|
LogEvent(Severity_Middle, LOG_EVT_CARDISSUER_GREEN_OFF, "CardReader(fetch) warning off");
|
|
|
if (ctx != NULL) {
|
|
|
ctx->Answer(Error_Succeed);
|
|
@@ -4444,17 +4382,6 @@ int CCardIssuerFSM::EjectJS(SpReqAnsContext<CardIssuerStandService_EjectJS_Req,
|
|
|
ToRegistCaptureCardInfo();//登记吞卡记录
|
|
|
m_currCardNo = "";
|
|
|
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- ErrorCodeEnum eErrSet = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErrSet != Error_Succeed) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("EjectJS::SetCardInType err");
|
|
|
- SetErrorAndLog(eErrSet, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220342", "EjectJS::SetCardInType err");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("EjectJS::SetCardInType");
|
|
|
- }
|
|
|
//超时吞卡成功
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_Forget_Fetch_Card_Capture_Succ, "forget fetch card ,capture succ");
|
|
|
if (ctx != NULL) {
|
|
@@ -4504,18 +4431,6 @@ int CCardIssuerFSM::CaptureJS(SpReqAnsContext<CardIssuerStandService_CaptureJS_R
|
|
|
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevStatus").setCostTime(l_endTime - l_beginTime)("CaptureJS::GetDevStatus succ,m_devStatus.eMedia=%d", (int)m_devStatus.eMedia);
|
|
|
if (m_devStatus.eMedia == CI_MEDIA_NOTPRESENT) {
|
|
|
- //读卡器无卡
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- ErrorCodeEnum eErrSet = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErrSet != Error_Succeed) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("CaptureJS::SetCardInType err");
|
|
|
- SetErrorAndLog(eErrSet, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220343", "CaptureJS::SetCardInType err");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("CaptureJS::SetCardInType");
|
|
|
- }
|
|
|
if (ctx != NULL) {
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setLogCode("QLR040220343").setResultCode("RTA23CS")
|
|
|
("CaptureJS::GetDevStatus succ, No card found in cardReader");
|
|
@@ -4543,18 +4458,6 @@ int CCardIssuerFSM::CaptureJS(SpReqAnsContext<CardIssuerStandService_CaptureJS_R
|
|
|
m_CardCaptured++;
|
|
|
ToRegistCaptureCardInfo();//登记吞卡记录
|
|
|
m_currCardNo = "";
|
|
|
-
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- ErrorCodeEnum eErrSet = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErrSet != Error_Succeed) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("CaptureJS::SetCardInType err");
|
|
|
- SetErrorAndLog(eErrSet, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220343", "CaptureJS::SetCardInType err");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("CaptureJS::SetCardInType");
|
|
|
- }
|
|
|
}
|
|
|
else {
|
|
|
dwTmpUserErrCode = SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_BACK_NOT_HOLD, "DevAdapter::MoveCard", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220343");
|
|
@@ -4690,20 +4593,6 @@ int CCardIssuerFSM::IssueFromBoxJS(SpReqAnsContext<CardIssuerStandService_IssueF
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
- //forbid front enter
|
|
|
-
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- errCode = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (errCode != Error_Succeed)
|
|
|
- {
|
|
|
- SetErrorAndLog(errCode, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("IssueFromBoxJS::SetCardInType");
|
|
|
- }
|
|
|
-
|
|
|
FSMSetIssueFlag(1);
|
|
|
//move card to holder
|
|
|
|
|
@@ -4715,7 +4604,7 @@ int CCardIssuerFSM::IssueFromBoxJS(SpReqAnsContext<CardIssuerStandService_IssueF
|
|
|
if (errCode != Error_Succeed)
|
|
|
{
|
|
|
CSimpleStringA errMsg = CSimpleStringA::Format("m_currentHopper:%d", m_currentHopper);
|
|
|
- DWORD dwTmpUserErrCode = SetErrorAndLog(errCode, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER, "DevAdapter::MoveCard", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220345", errMsg.GetData());
|
|
|
+ DWORD dwTmpUserErrCode = SetErrorAndLog(errCode, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER, "DevAdapter::MoveCard", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220345", errMsg.GetData());
|
|
|
ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
return 2;//S9
|
|
|
}
|
|
@@ -5659,19 +5548,8 @@ int CCardIssuerFSM::InternalInsert()
|
|
|
|
|
|
m_bExit = false;
|
|
|
|
|
|
+ //oiltmp need to check the logic
|
|
|
if (errRet == 0 || errRet ==1) {
|
|
|
- //关闭进口
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- eErr = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
- if (Error_Succeed != eErr)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("InternalInsert::SetCardInType CI_CARD_IN_TYPE_FORBIDDEN err");
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "", "InternalInsert::SetCardInType CI_CARD_IN_TYPE_FORBIDDEN err");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("InternalInsert::SetCardInType CI_CARD_IN_TYPE_FORBIDDEN");
|
|
|
- }
|
|
|
}
|
|
|
else {
|
|
|
//2和3情况
|
|
@@ -5695,21 +5573,17 @@ int CCardIssuerFSM::InternalInsert()
|
|
|
else {
|
|
|
errRet = 2;//正常超时
|
|
|
}
|
|
|
-
|
|
|
- if (errRet != 4) {
|
|
|
- //关闭进口
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- eErr = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
- if (Error_Succeed != eErr)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("InternalInsert::SetCardInType CI_CARD_IN_TYPE_FORBIDDEN err");
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime, "", "InternalInsert::SetCardInType CI_CARD_IN_TYPE_FORBIDDEN err");
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("InternalInsert::SetCardInType CI_CARD_IN_TYPE_FORBIDDEN");
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ //关闭进口
|
|
|
+ l_beginTime = GetTickCountRVC();
|
|
|
+ eErr = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
+ l_endTime = GetTickCountRVC();
|
|
|
+ if (Error_Succeed != eErr)
|
|
|
+ {
|
|
|
+ SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, "DevAdapter::SetCardInType", __FUNCTION__, false, l_endTime - l_beginTime);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("%s", __FUNCTION__);
|
|
|
}
|
|
|
return errRet;
|
|
|
}
|
|
@@ -5770,52 +5644,6 @@ void CCardIssuerFSM::GetCardProcessLastErr(ErrorCodeEnum& eErrCode, CSimpleStrin
|
|
|
csErrMsgWithReturnCode = csErrMsgWithReturnCodeStr.GetData();
|
|
|
}
|
|
|
|
|
|
-int CCardIssuerFSM::PowerOffIC(int type)
|
|
|
-{
|
|
|
- int ret = 0;
|
|
|
- long l_beginTime, l_endTime;
|
|
|
- if (type == 0) {
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- ErrorCodeEnum eErr = m_hDevHelper->DeactivateICCard();
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErr != Error_Succeed) {
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_DeactivateICCard, "DevAdapter::DeactivateICCard", __FUNCTION__, false, l_endTime - l_beginTime, "", "PowerOffIC::DeactivateICCard err");
|
|
|
- ret = 1;
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DeactivateICCard").setCostTime(l_endTime - l_beginTime)("PowerOffIC::DeactivateICCard");
|
|
|
- }
|
|
|
-
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- eErr = m_hDevHelper->ReleaseIC();
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErr != Error_Succeed) {
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_ReleaseIC, "DevAdapter::ReleaseIC", __FUNCTION__, false, l_endTime - l_beginTime, "", "PowerOffIC::ReleaseIC err");
|
|
|
- ret = 1;
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ReleaseIC").setCostTime(l_endTime - l_beginTime)("PowerOffIC::ReleaseIC");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else {
|
|
|
- l_beginTime = GetTickCountRVC();
|
|
|
- ErrorCodeEnum eErr = m_hDevHelper->DeactContactlessICCard();
|
|
|
- l_endTime = GetTickCountRVC();
|
|
|
-
|
|
|
- if (eErr != Error_Succeed) {
|
|
|
- SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_DeactContactlessICCard, "DevAdapter::DeactContactlessICCard", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
- ret = 1;
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DeactContactlessICCard").setCostTime(l_endTime - l_beginTime)("PowerOffIC::DeactContactlessICCard");
|
|
|
- }
|
|
|
- }
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
void CCardIssuerFSM::OnStateTrans(int iSrcState, int iDstState)
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("trans from %s to %s", GetStateName(iSrcState), GetStateName(iDstState));
|