|
@@ -958,10 +958,9 @@ int CContactlessCardFSM::AcceptCard(SpReqAnsContext<ContactlessCardService_Inser
|
|
|
LogEvent(Severity_Middle,LOG_EVT_CONTACTLESS_CARD_GREEN_ON,"ContactCard green on");
|
|
|
m_bWaitAccepteMore = false;
|
|
|
int rc = InternalAcceptCard();
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("InternalAcceptCard ret:%d", rc);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("InternalAcceptCard ret:%d", rc);
|
|
|
LogEvent(Severity_Middle,LOG_EVT_CONTACTLESS_CARD_GREEN_OFF,"ContactCard green off");
|
|
|
if (rc == 0) {
|
|
|
- //FSMSetIssueFlag(false);
|
|
|
if (ctx != NULL)
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("insert error_succeed");
|
|
@@ -1060,8 +1059,10 @@ int CContactlessCardFSM::AcceptCard(SpReqAnsContext<ContactlessCardService_Inser
|
|
|
}
|
|
|
else if(rc == 2)
|
|
|
{
|
|
|
- if (ctx != NULL)
|
|
|
+ if (ctx != NULL) {
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("AcceptCard, insert timeout");
|
|
|
ctx->Answer(Error_TimeOut);
|
|
|
+ }
|
|
|
}
|
|
|
else if(rc == 3 || rc == 4)
|
|
|
{
|
|
@@ -1139,7 +1140,6 @@ int CContactlessCardFSM::PreOnline(SpReqAnsContext<ContactlessCardService_PreOnl
|
|
|
LOG_FUNCTION();
|
|
|
long l_beginTime, l_endTime;
|
|
|
m_pCardProcess->DataInit();
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnline>, bus data[%s]", ctx->Req.businessData.GetData());
|
|
|
m_pCardProcess->SplitBusinessData(ctx->Req.businessData,ctx->Req.businessData.GetLength());
|
|
|
m_pCardProcess->SplitBusinessData("DF690101",strlen("DF690101"));
|
|
|
int activeCardType;
|
|
@@ -1197,7 +1197,9 @@ int CContactlessCardFSM::PreOnline(SpReqAnsContext<ContactlessCardService_PreOnl
|
|
|
CSimpleStringA taaResult;
|
|
|
BYTE bt9f27 = 0;
|
|
|
int retTAA = m_pCardProcess->TermActionAnalyze(CARD_MACHINE_RFIC,m_hDevHelper,taaResult,true,m_bCDA,bt9f27);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("TermActionAnalyze %d",retTAA);
|
|
|
+ if (retTAA != 0 || taaResult.GetLength() == 0) {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<PreOnline>, TermActionAnalyze , retTAA:%d, taaResult:%s", retTAA, taaResult.GetData());
|
|
|
+ }
|
|
|
switch(retTAA)
|
|
|
{//to be added oiltest 20140929
|
|
|
case -1: //some data may be wrong
|
|
@@ -1210,19 +1212,15 @@ int CContactlessCardFSM::PreOnline(SpReqAnsContext<ContactlessCardService_PreOnl
|
|
|
break;
|
|
|
}
|
|
|
ctx->Ans.result = taaResult;
|
|
|
- // Dbg("[%d,%d,%d,%d]",m_TVR[0],m_TVR[1],m_TVR[2],m_TVR[3]);
|
|
|
- //}
|
|
|
+
|
|
|
if (ctx->Ans.result.GetLength() == 0)
|
|
|
{
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
return 0;
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnline>, term action analyze result[%s]",(const char*)ctx->Ans.result);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnline>, term action analyze result[%s]",(const char*)ctx->Ans.result);
|
|
|
+
|
|
|
|
|
|
- //char tmpResult[1024,]result[1024];
|
|
|
- //ZeroMemory(tmpResult,sizeof(tmpResult));
|
|
|
- //ZeroMemory(result,sizeof(result));
|
|
|
- //memcpy(tmpResult,ctx->Ans.result,ctx->Ans.result.GetLength());
|
|
|
string tmpResult, actionType, result = "", baseICData = "";
|
|
|
tmpResult = ctx->Ans.result;
|
|
|
char *pSomeICData = new char[1024];
|
|
@@ -1272,7 +1270,7 @@ int CContactlessCardFSM::PreOnline(SpReqAnsContext<ContactlessCardService_PreOnl
|
|
|
ZeroMemory(pICTrack2,128);
|
|
|
HexBuf2StrBuf(track2.value,&pICTrack2,track2.lenth);
|
|
|
pICTrack2[37] = '\0';
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnline>, split pos:%d", pos);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnline>, split pos:%d", pos);
|
|
|
char *ddd = new char[40];
|
|
|
ZeroMemory(ddd,40);
|
|
|
memcpy(ddd,pICTrack2,pos-1);
|
|
@@ -1291,7 +1289,7 @@ int CContactlessCardFSM::PreOnline(SpReqAnsContext<ContactlessCardService_PreOnl
|
|
|
//t2ICCardSerial = track2Data.t2CardSerial;
|
|
|
t2ICCVC = track2Data.t2CVC;
|
|
|
t2ICTrack2 = pICTrack2;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("done(ic).");
|
|
|
+
|
|
|
}
|
|
|
//}
|
|
|
if (strnicmp(track2Data.t2Account,ddd,strlen(ddd)))
|
|
@@ -1306,10 +1304,13 @@ int CContactlessCardFSM::PreOnline(SpReqAnsContext<ContactlessCardService_PreOnl
|
|
|
delete []pICTrack2;
|
|
|
}
|
|
|
//80 1e 80 0008 328ab54bfc986b85 07010103a0b000010a010000000000754048769000
|
|
|
- if (m_pCardProcess->GetP1() == 0x1)
|
|
|
+ if (m_pCardProcess->GetP1() == 0x1) {
|
|
|
actionType = "ARQC";
|
|
|
- else
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<PreOnline>, actionType is empty");
|
|
|
actionType = "";
|
|
|
+ }
|
|
|
//【55域】
|
|
|
// 基本域:
|
|
|
// 9F26 8b 应用密文AC
|
|
@@ -1411,7 +1412,7 @@ int CContactlessCardFSM::EjectCard(SpReqAnsContext<ContactlessCardService_Eject_
|
|
|
ErrorCodeEnum eErr = m_hDevHelper->GetDevStatus(devStatus);
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("EjectCard, devStatus.eMedia %d",devStatus.eMediaPos);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("EjectCard, devStatus.eMedia %d",devStatus.eMediaPos);
|
|
|
if (devStatus.eMediaPos == CI_MEDIA_RF || devStatus.eMediaPos == CI_MEDIA_NOTPRESENT)
|
|
|
{
|
|
|
if (devStatus.eMediaPos == CI_MEDIA_NOTPRESENT)
|
|
@@ -1423,7 +1424,7 @@ int CContactlessCardFSM::EjectCard(SpReqAnsContext<ContactlessCardService_Eject_
|
|
|
}
|
|
|
Sleep(100);
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("eject return.");
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("eject, ret:%d",ret);
|
|
|
if (ctx != NULL)
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
return ret;
|