Explorar o código

#IQRV #comment [Module][ContactlessCard] 添加非接读卡异常的告警

gifur %!s(int64=3) %!d(string=hai) anos
pai
achega
7d8b50e12c

+ 1 - 1
DevAdapter/include/CardAssist.cpp

@@ -404,7 +404,7 @@ bool CCardProcess::DetectIfICCard(CardReadType eType, DeviceBaseClass *pCardX, i
 		Dbg("Active card return %d",eErr);
 		if (eErr != Error_Succeed)
 		{
-			Dbg("the card may be not 'A,B,M' card(%d).",eErr);
+			Dbg("the card may be not 'A,B,M' card: %s.", SpStrError(eErr));
 			//pCardR->DeactContactlessICCard();
 			return false;
 		}

+ 1 - 1
Module/mod_ContactlessCard/ContactlessCard_UserErrorCode.h

@@ -4,5 +4,5 @@
 
 #define ContactlessCard_UserErrorCode_Start 0x21300200
 #define ContactlessCard_UserErrorCode_Reset_Failed	(ContactlessCard_UserErrorCode_Start + 1)		//Resetʧ°Ü
-
+#define ContactlessCard_UserErrorCode_DetectAndReadICData_Failed	(ContactlessCard_UserErrorCode_Start + 2)
 #endif //_CONTACTLESSCARD_USER_ERRORCODE_H

+ 8 - 3
Module/mod_ContactlessCard/ContactlessFSM.cpp

@@ -788,14 +788,12 @@ int CContactlessCardFSM::AcceptCard(SpReqAnsContext<ContactlessCardService_Inser
 
     if (rc == 0) {
         if (ctx != NULL) {
-            Dbg("insert error_succeed");
             FetchCard evt;
             evt.status = 3;//oilyang@20181210 用于通知CardIssuer取消插卡
             SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(FetchCard), SP_MSG_SIG_OF(FetchCard), evt);
 
             ctx->Ans.ICData = "";
             int activeCardType;
-            //bool bGetICData = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_RFIC, m_hDevHelper, "A000000333", activeCardType);
             int retDetectAndRead = -1;
             if (!ctx->Req.aid.IsNullOrEmpty()) {
                 Dbg("aid:[%s]", (const char*)ctx->Req.aid);
@@ -808,7 +806,14 @@ int CContactlessCardFSM::AcceptCard(SpReqAnsContext<ContactlessCardService_Inser
             }
 
             if (retDetectAndRead < 0) {
-                Dbg("DetectAndReadICData failed");
+                DevErrorInfo errInfo;
+                ErrorCodeEnum eErr = m_hDevHelper->GetLastErr(errInfo);
+                if (eErr == Error_Succeed) {
+                    LogWarn(Severity_High, Error_Unexpect, ContactlessCard_UserErrorCode_DetectAndReadICData_Failed,
+                            CSimpleStringA::Format("DetectAndReadICData failed: %s", errInfo.szErrMsg));
+                } else {
+                    LogWarn(Severity_High, Error_Unexpect, ContactlessCard_UserErrorCode_DetectAndReadICData_Failed, "DetectAndReadICData failed");
+                }
                 ctx->Answer(Error_Unexpect);
                 return 1;
             }