Browse Source

Z991239-6309 #comment 精简pinpad启动阶段的日志

oilyang 3 months ago
parent
commit
123bf905ce
2 changed files with 18 additions and 16 deletions
  1. 17 15
      Module/mod_pinpad/PinPadFSM.cpp
  2. 1 1
      Module/mod_pinpad/PinPad_UserErrorCode.h

+ 17 - 15
Module/mod_pinpad/PinPadFSM.cpp

@@ -430,20 +430,7 @@ int CPinPadFSM::Initial()
 	else
 		SetErrorAndLog(eErrDev, MEC_DEVAPI_EPP_GetDevCategory, "DevAdapter::GetDevCategory", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime);
 
-	CSimpleStringA xTmpStr = CSimpleStringA::Format("(hw support):%d,load key :%d,SMSN:%s", m_encryptkey, m_bSMLoaded, m_keySNSM.GetData());
-	ULLINT tmpAllCost = SP::Module::Comm::RVCGetTickCount() - m_ullEntityStart;
-	std::map<std::string, std::string> devConnInfo;
-	devConnInfo["AllCost"] = CSimpleStringA::Format("%d", tmpAllCost);
-	devConnInfo["AdpFileLoadCost"] = CSimpleStringA::Format("%d",m_ullAdpFileLoadCost);
-	devConnInfo["DevConnectCost"] = CSimpleStringA::Format("%d", tmpAllCost - m_ullAdpFileLoadCost);
-	std::pair<bool, std::string> strResult;
-	strResult = generateJsonStr(devConnInfo);
-
-	LogWarn(Severity_Low, Error_Unexpect, PinPad_UserErrorCode_DevConnect_CostTime, CSimpleStringA::Format("%s", strResult.second.c_str()));
-	LogWarn(Severity_Low, Error_Unexpect, PinPad_UserErrorCode_PinPad_InfoAboutKey_Onboot, xTmpStr.GetData());
-	LogEvent(Severity_Middle, LOG_EVT_PINPAD_OPEN_SUC, "Open pinpad suc.");
-
-	CSimpleStringA csRunInfo, csSNBakFile;
+	CSimpleStringA csRunInfo, csSNBakFile, csBakSN("");
 	if ((eErr = GetEntityBase()->GetFunction()->GetPath("RunInfo", csRunInfo)) == Error_Succeed)
 	{
 		csSNBakFile = csRunInfo + SPLIT_SLASH_STR + "runcfg" + SPLIT_SLASH_STR + "snbak.dat";
@@ -452,7 +439,7 @@ int CPinPadFSM::Initial()
 		ZeroMemory(buffer, 16);
 		if (infile.is_open())
 			infile.read(buffer, 16);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("bak.sn:%s", buffer);
+		csBakSN = buffer;
 		if (strlen(buffer) > 0 && m_keySNSM.Compare(buffer) != 0)
 		{
 			LogWarn(Severity_High, Error_Unexpect, PinPad_UserErrorCode_PinPad_SN_NOTMATCH, CSimpleStringA::Format("m_keySN:%s,snbak:%s", m_keySNSM.GetData(), buffer));
@@ -466,6 +453,21 @@ int CPinPadFSM::Initial()
 		infile.close();
 	}
 
+	ULLINT tmpAllCost = SP::Module::Comm::RVCGetTickCount() - m_ullEntityStart;
+	std::map<std::string, std::string> devConnInfo;
+	devConnInfo["AllCost"] = CSimpleStringA::Format("%d", tmpAllCost);
+	devConnInfo["AdpFileLoadCost"] = CSimpleStringA::Format("%d",m_ullAdpFileLoadCost);
+	devConnInfo["DevConnectCost"] = CSimpleStringA::Format("%d", tmpAllCost - m_ullAdpFileLoadCost);
+	devConnInfo["SMSupport"] = CSimpleStringA::Format("%d", m_encryptkey);
+	devConnInfo["KeyLoaded"] = CSimpleStringA::Format("%d", m_bSMLoaded);
+	devConnInfo["KeySN"] = CSimpleStringA::Format("%s", m_keySNSM.GetData()); 
+	devConnInfo["BakSN"] = CSimpleStringA::Format("%s", csBakSN.GetData());
+	std::pair<bool, std::string> strResult;
+	strResult = generateJsonStr(devConnInfo);
+
+	LogWarn(Severity_Low, Error_Unexpect, PinPad_UserErrorCode_DevConnect_CostTime, CSimpleStringA::Format("%s", strResult.second.c_str()));
+	LogEvent(Severity_Middle, LOG_EVT_PINPAD_OPEN_SUC, "Open pinpad suc.");
+
 	return 0;
 }
 unsigned int __stdcall DoWork(void *pData)

+ 1 - 1
Module/mod_pinpad/PinPad_UserErrorCode.h

@@ -27,7 +27,7 @@ enum PinPad_UserErrorCode {
 	PinPad_UserErrorCode_PinPad_LoadKey_SMSN = 0x20600216,
 	PinPad_UserErrorCode_PinPad_LoadKey_Clear_SMSN = 0x20600217,
 	PinPad_UserErrorCode_NotInGetInput = 0x20600218,
-	PinPad_UserErrorCode_PinPad_InfoAboutKey_Onboot = 0x20600219,
+	//PinPad_UserErrorCode_PinPad_InfoAboutKey_Onboot = 0x20600219,
 	PinPad_UserErrorCode_PinPad_CheckCode_Changed = 0x2060021A,
 	PinPad_UserErrorCode_PinPad_GetEncryptText_Get12Account_Error = 0x2060021B,
 	PinPad_UserErrorCode_PinPad_DevOpenFailed = 0x2060021C,