|
|
@@ -653,49 +653,9 @@ void CHeartBeatFSM::LocalPreOnline(int slot, CSimpleStringA fromTermNo,CSimpleSt
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- //oilyang@20230316 check CardIssuer state first
|
|
|
- CardReadAdapterService_GetDevInfo_Req reqInfo;
|
|
|
- CardReadAdapterService_GetDevInfo_Ans ansInfo;
|
|
|
- reqInfo.module = 1;//Module_CardIssuer
|
|
|
- ErrorCodeEnum eErr = m_pCRAClient->GetDevInfo(reqInfo, ansInfo, 3000, dwUserCode);
|
|
|
- CSimpleStringA errMsgData(true);
|
|
|
- if (eErr == Error_InvalidState)
|
|
|
- {
|
|
|
- errMsgData = "CardIssuer in use";
|
|
|
- if (m_pHandShakeConn && m_pHandShakeConn->IsConnectionOK())
|
|
|
- {
|
|
|
- m_pHandShakeConn->SendCardActive(1, slot, Error_Duplication, (const char*)termNo, (const char*)account,
|
|
|
- account.GetLength(), errMsgData.GetData(), errMsgData.GetLength()+1, 9999, 9999, HeartBeat_UserErrorCode_CardStore_CardIssuer_In_Use);
|
|
|
- }
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, HeartBeat_UserErrorCode_CardStore_CardIssuer_In_Use, "CardIssuer in use");
|
|
|
- return;
|
|
|
- }
|
|
|
- else if (eErr == Error_DevNotAvailable)
|
|
|
- {
|
|
|
- errMsgData = "CardIssuer not available(open failed)";
|
|
|
- if (m_pHandShakeConn && m_pHandShakeConn->IsConnectionOK())
|
|
|
- {
|
|
|
- m_pHandShakeConn->SendCardActive(1, slot, Error_Hardware, (const char*)termNo, (const char*)account,
|
|
|
- account.GetLength(), errMsgData.GetData(), errMsgData.GetLength() + 1, 9999, 9999, HeartBeat_UserErrorCode_CardIssuer_Open_Failed);
|
|
|
- }
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, HeartBeat_UserErrorCode_CardIssuer_Open_Failed, "CardIssuer not available(open failed)");
|
|
|
- return;
|
|
|
- }
|
|
|
- else if (eErr != Error_Succeed || ansInfo.ModuleSN.GetCount() == 0 ||(ansInfo.ModuleSN.GetCount() == 1 && ansInfo.state[0] == 3))//3 for DEVICE_STATUS_FAULT defined in DevBaseClass.h
|
|
|
- {
|
|
|
- errMsgData = "CardIssuer in fault state";
|
|
|
- if (m_pHandShakeConn && m_pHandShakeConn->IsConnectionOK())
|
|
|
- {
|
|
|
- m_pHandShakeConn->SendCardActive(1, slot, Error_Hardware, (const char*)termNo, (const char*)account,
|
|
|
- account.GetLength(), errMsgData.GetData(), errMsgData.GetLength() + 1, 9999, 9999, HeartBeat_UserErrorCode_CardIssuer_In_Fault_State);
|
|
|
- }
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, HeartBeat_UserErrorCode_CardIssuer_In_Fault_State, "CardIssuer in fault state");
|
|
|
- return;
|
|
|
- }
|
|
|
- Sleep(500);//oilyang@20230328 wait for entity CardReadAdapter to change back to normal state
|
|
|
CardReadAdapterService_PreOnline_Req req;
|
|
|
CardReadAdapterService_PreOnline_Ans ans;
|
|
|
- CSimpleStringA outParam("");
|
|
|
+ CSimpleStringA errMsgData("");
|
|
|
req.businessData = data;
|
|
|
char buf[16];
|
|
|
ZeroMemory(buf, sizeof(buf));
|
|
|
@@ -708,15 +668,38 @@ void CHeartBeatFSM::LocalPreOnline(int slot, CSimpleStringA fromTermNo,CSimpleSt
|
|
|
req.reserved2[1] = account;
|
|
|
CSimpleStringA inParam = CSimpleStringA::Format("PreOnline, CardStore heartbeat invodk PreOnline, slot:%s, accountLen:%d", req.reserved2[0].GetData(), account.GetLength());
|
|
|
LogWarn(Severity_Low, Error_Unexpect, HeartBeat_UserErrorCode_Connect_CardStore_Invoke_PreOnline_Inparam, inParam.GetData());
|
|
|
- eErr = m_pCRAClient->PreOnline(req, ans, 65000, dwUserCode);
|
|
|
+ ErrorCodeEnum eErr = m_pCRAClient->PreOnline(req, ans, 65000, dwUserCode);
|
|
|
if (eErr != Error_Succeed){
|
|
|
- outParam = CSimpleStringA::Format("local preonline failed:%d(0x%x),dwUserCode:%d(0x%x)", eErr, eErr, dwUserCode, dwUserCode);
|
|
|
+ errMsgData = CSimpleStringA::Format("local preonline failed:%d(0x%x),dwUserCode:%d(0x%x)", eErr, eErr, dwUserCode, dwUserCode);
|
|
|
+ LogWarn(Severity_Middle, Error_Unexpect, HeartBeat_UserErrorCode_Connect_CardStore_Invoke_PreOnline_Falied, errMsgData.GetData());
|
|
|
if (eErr == Error_Duplication)
|
|
|
{
|
|
|
ReceivePreOnlineBack(Error_Duplication, "", 0, 0);
|
|
|
return;
|
|
|
}
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, HeartBeat_UserErrorCode_Connect_CardStore_Invoke_PreOnline_Falied, outParam.GetData());
|
|
|
+ else if (eErr == Error_InvalidState)
|
|
|
+ {
|
|
|
+ errMsgData = "CardIssuer in use";
|
|
|
+ if (m_pHandShakeConn && m_pHandShakeConn->IsConnectionOK())
|
|
|
+ {
|
|
|
+ m_pHandShakeConn->SendCardActive(1, slot, Error_Duplication, (const char*)termNo, (const char*)account,
|
|
|
+ account.GetLength(), errMsgData.GetData(), errMsgData.GetLength() + 1, 9999, 9999, dwUserCode);
|
|
|
+ }
|
|
|
+ LogWarn(Severity_Middle, Error_Unexpect, HeartBeat_UserErrorCode_CardStore_CardIssuer_In_Use, "CardIssuer in use");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else if (eErr == Error_DevNotAvailable)
|
|
|
+ {
|
|
|
+ errMsgData = "CardIssuer not available(open failed)";
|
|
|
+ if (m_pHandShakeConn && m_pHandShakeConn->IsConnectionOK())
|
|
|
+ {
|
|
|
+ m_pHandShakeConn->SendCardActive(1, slot, Error_Hardware, (const char*)termNo, (const char*)account,
|
|
|
+ account.GetLength(), errMsgData.GetData(), errMsgData.GetLength() + 1, 9999, 9999, dwUserCode);
|
|
|
+ }
|
|
|
+ LogWarn(Severity_Middle, Error_Unexpect, HeartBeat_UserErrorCode_CardIssuer_Open_Failed, "CardIssuer not available(open failed)");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
Sleep(500);
|
|
|
CardReadAdapterService_QueryCardInfoOnStore_Req reqX;
|
|
|
@@ -725,8 +708,8 @@ void CHeartBeatFSM::LocalPreOnline(int slot, CSimpleStringA fromTermNo,CSimpleSt
|
|
|
eErrX = m_pCRAClient->QueryCardInfoOnStore(reqX, ansX,12000);
|
|
|
if (eErrX != Error_Succeed)
|
|
|
{
|
|
|
- outParam = CSimpleStringA::Format("QueryCardInfoOnStore failed.%d",eErrX);
|
|
|
- LogWarn(Severity_Low, Error_Unexpect, HeartBeat_UserErrorCode_Connect_CardStore_Invoke_QueryCardInfoOnStore_Falied, outParam.GetData());
|
|
|
+ errMsgData = CSimpleStringA::Format("QueryCardInfoOnStore failed.%d",eErrX);
|
|
|
+ LogWarn(Severity_Low, Error_Unexpect, HeartBeat_UserErrorCode_Connect_CardStore_Invoke_QueryCardInfoOnStore_Falied, errMsgData.GetData());
|
|
|
ansX.findCard = ansX.cardPos = 9999;
|
|
|
}
|
|
|
if (m_pHandShakeConn && m_pHandShakeConn->IsConnectionOK())
|