Просмотр исходного кода

#IQRV #comment [PinPad] CK验密添加错误码

gifur 4 лет назад
Родитель
Сommit
6545ecb2e7
2 измененных файлов с 7 добавлено и 3 удалено
  1. 3 0
      Module/include/EventCode.h
  2. 4 3
      Module/mod_pinpad/PinPadFSM.cpp

+ 3 - 0
Module/include/EventCode.h

@@ -668,6 +668,9 @@ ERR_ACCESSAUTH_SHA1_HASH}
 #define LOG_EVT_PINPAD_OPEN_SUC					(PinPad_Public_Start + 11)
 #define LOG_EVT_PINPAD_OPEN_FAIL				(PinPad_Public_Start + 12)
 
+#define LOG_EVT_PINPAD_CK_ZERO		                 (PinPad_Public_Start + 20)
+#define LOG_EVT_PINPAD_SM_SN_REFRESH          (PinPad_Public_Start + 21)
+
 //#define LOG_EVT_CARDSWIPER_RESTART	0x20700001
 //#define LOG_ERR_CARDSWIPER_FAILED	0x20780001
 

+ 4 - 3
Module/mod_pinpad/PinPadFSM.cpp

@@ -436,8 +436,6 @@ int CPinPadFSM::Initial()
 	spConfig->ReadConfigValueInt("Device.PinPad", "Port", port);
 	spConfig->ReadConfigValue("Terminal", "TerminalNo", m_deviceNo);
 	spConfig->ReadConfigValue("Device.PinPad", "Checkdata", m_devCheckData);
-	//spConfig->ReadConfigValue("Device.PinPad", "Keysn", m_keySN);
-	//spConfig->ReadConfigValue("Device.PinPad", "KeysnSM", m_keySNSM);
 	Dbg("to load vendor dll.");
 	if (Error_Succeed != m_hDevHelper.LoadLibAddress(dllName)) {
 		Dbg("load %s failed.", (const char*)dllName);
@@ -1026,6 +1024,7 @@ Err:
 			ctx->Ans.checkcode = tmpCheckCode;
 			ctx->Ans.deviceno = m_deviceNo;
 			ctx->Ans.keyseq = m_keySN;
+			LogWarn(Severity_Middle, Error_Debug, LOG_EVT_PINPAD_CK_ZERO, CSimpleStringA::Format("NotSM: %s", tmpCheckCode));
 		}
 		else
 		{
@@ -1042,6 +1041,8 @@ Err:
 			{
 				ctxSM->Ans.keyseq = m_keySNSM;
 			}
+			LogWarn(Severity_Middle, Error_Debug, LOG_EVT_PINPAD_CK_ZERO, 
+					CSimpleStringA::Format("SM: {%s}{%s}", m_keySNSM.GetData(), tmpCheckCode));
 		}
 	}
 	else
@@ -1645,7 +1646,7 @@ int CPinPadFSM::LoadKeySM(SpReqAnsContext<PinPadService_LoadKeysSM_Req, PinPadSe
 			{
 				spConfig->WriteConfigValue("Load", "SN_SM", ctx->Req.reserved3);
 				m_keySNSM = ctx->Req.reserved3;
-				Dbg("sm key sn:%s",(const char*)m_keySNSM);
+				LogWarn(Severity_Middle, Error_Debug, LOG_EVT_PINPAD_SM_SN_REFRESH, m_keySNSM);
 			}
 		}
 		if (eErr != Error_Succeed)