Prechádzať zdrojové kódy

#IQRV #comment [Other] 格式调整,日志打印等提交

gifur 4 rokov pred
rodič
commit
da17b1fc75

+ 10 - 4
Module/mod_CenterSetting/CenterSettingConn.cpp

@@ -33,7 +33,14 @@ void CCenterSettingConn::OnPkgAnswer(const CSmartPointer<IPackage> &pRecvPkg)
 	if (serviceCode == "PollSM")
 	{	
 		auto rc = OnEndPollConfig(pRecvPkg);
-
+		if (rc == Error_NotExist) {
+			CSimpleStringA strFilePath;
+			pEntity->GetFunction()->GetPath("CenterSetting", strFilePath);
+			if (ExistsFileA(strFilePath) && 0 < pEntity->m_SyncFileInfo.size()) {
+				Dbg("maybe local centersetting file is new as the server side one or there are no any centersettings files under server side");
+				rc = Error_Succeed; // = Error_AlreadyExist;
+			}
+		}
 		// 通知实体轮询结束
 		pEntity->EndDownloadCenterSetting(rc);
 	}
@@ -98,8 +105,7 @@ ErrorCodeEnum CCenterSettingConn::BeginPollConfig()
 	assert(rc == Error_Succeed);
 
 	auto pPackage = CreateNewPackage("PollSM");
-	auto &syncFiles = pEntity->m_SyncFileInfo;
-	int nArrayNum = syncFiles.size();
+	const int nArrayNum = pEntity->m_SyncFileInfo.size();
 	if (nArrayNum> 0)
 	{		
 		PollSMR *pReq = new PollSMR[nArrayNum];
@@ -316,6 +322,6 @@ ErrorCodeEnum CCenterSettingConn::OnEndPollConfig(const CSmartPointer<IPackage>
 
 	} else {
 
-		return Error_Unexpect;
+		return Error_NotExist;
 	}
 }

+ 3 - 1
Module/mod_DeviceControl/mod_DeviceControl.cpp

@@ -74,7 +74,9 @@ void CDeviceControlEntity::ReadCenterConfigStr(SpReqAnsContext<DeviceControlServ
 	auto ret = __ReadCenterConfigStr(ctx->Req.key, ctx->Req.entityName);
 	ctx->Ans.value = ret.second;
 	ctx->Ans.reserved1 = ctx->Ans.reserved2 = 0;
-	Dbg("ReadCenterConfigStr key:%s, entityName:%s: %s", ctx->Req.key.GetData(), ctx->Req.entityName.GetData(), ctx->Ans.value.GetData());
+	Dbg("%s: ReadCenterConfigStr key:%s, entityName:%s: %s",
+        SpStrError(ret.first),
+        ctx->Req.key.GetData(), ctx->Req.entityName.GetData(), ctx->Ans.value.GetData());
 	ctx->Answer(ret.first);
 }
 

+ 2 - 1
Module/mod_Initializer/comm.cpp

@@ -150,7 +150,8 @@ unsigned char Ch2Hex(char ch)
 			return i;
 	return 0;
 }
-
+//"FBF2EFA02B23" ==> 240 11 240 2 224 15 160 0 32 11 32 3
+/** What the hell !!!!! [Gifur@2021427]*/
 char* Hex2Str(const char* src, int& dstLen)
 {
 	int i = 0;

+ 4 - 4
Module/mod_pinpad/PinPadFSM.cpp

@@ -913,17 +913,14 @@ ErrorCodeEnum CPinPadFSM::GetEncryptText(SpReqAnsContext<PinPadService_GetInput_
 					goto Err;
 				}
 			} else if (btCh == 0x3f){
-				if (confirm)
-				{
+				if (confirm) {
 					elapsed = GetTickCount() - dwStart;
 					continue;
 				}
 				push_char(buf, &readed, '*');
 			}else{
 				Dbg("else[%d]",btCh);
-				//continue;
 			}
-			
 		}
 
 		elapsed = GetTickCount() - dwStart;
@@ -1787,6 +1784,7 @@ bool CPinPadFSM::GetDevInfo(DevCategoryInfo &devInfo)
 		devInfo.eState = m_eDevState;
 		return false;
 	}
+
 	DevCategoryInfo info;
 	ZeroMemory(info.szModel, MAX_DEV_MODEL_LEN);
 	ZeroMemory(info.szType, MAX_DEV_TYPE_LEN);
@@ -1803,10 +1801,12 @@ bool CPinPadFSM::GetDevInfo(DevCategoryInfo &devInfo)
 	{
 		LOG_PINPAD_ERROR_MSG_MACRO(eErrDev, GetDevCategory);
 	}
+
 	ZeroMemory(devInfo.szModel,MAX_DEV_MODEL_LEN);//CM=V2.0#PM=V1.0#MID=75500001#PID=12345678#FWID=V1234567#Vendor=nantian
 	ZeroMemory(devInfo.szType,MAX_DEV_TYPE_LEN);
 	ZeroMemory(devInfo.szVendor,MAX_DEV_VENDOR_LEN);
 	CSimpleStringA tmpModel("");
+	 
 	if (m_szModel.GetLength() > 1)
 	{
 		//oilyang@20200807 add FWBID for auth&init