|
|
@@ -161,6 +161,19 @@ static std::map<CSimpleStringA, DWORD> WarnCodeMap = {
|
|
|
{"Ups", 0x20e00201}
|
|
|
};
|
|
|
|
|
|
+static std::map<CSimpleStringA, DWORD> RootIniCodeMap = {
|
|
|
+ {"CardIssuer", 0x20300299},
|
|
|
+ {"ContactlessCard", 0x21300224},
|
|
|
+ {"CardSwiper", 0x20200238},
|
|
|
+ {"FingerPrint", 0x20400229},
|
|
|
+ {"IDCertificate", 0x2010021f},
|
|
|
+ {"PinPad", 0x2060021f},
|
|
|
+ {"Gpio", 0x20900203},
|
|
|
+ {"HSPScanner", 0x2170020f},
|
|
|
+ {"WatchDog", 0x20d00204},
|
|
|
+ {"Ups", 0x20e00204}
|
|
|
+};
|
|
|
+
|
|
|
inline static VendorNameType GetCurVendorType(LPCTSTR vendorName)
|
|
|
{
|
|
|
if (vendorName == NULL || strlen(vendorName) == 0) {
|
|
|
@@ -445,6 +458,70 @@ public:
|
|
|
return dwCode;
|
|
|
}
|
|
|
|
|
|
+ void ToLogRootINIInfoOnce(FSMBase* pFSM)
|
|
|
+ {
|
|
|
+ CSmartPointer<IConfigInfo> spConfig;
|
|
|
+ pFSM->GetEntityBase()->GetFunction()->OpenConfig(Config_Cache, spConfig);
|
|
|
+ CSimpleStringA entityName(pFSM->GetEntityBase()->GetEntityName());
|
|
|
+ int nUploadTime(0);
|
|
|
+ spConfig->ReadConfigValueInt("RootUploadFlag", entityName, nUploadTime);
|
|
|
+
|
|
|
+ SYSTEMTIME stNow = CSmallDateTime::GetNow().ToSystemTime();
|
|
|
+ SYSTEMTIME lastUploadTime = CSmallDateTime(nUploadTime).ToSystemTime();
|
|
|
+
|
|
|
+ if (lastUploadTime.wYear != stNow.wYear || lastUploadTime.wMonth != stNow.wMonth || lastUploadTime.wDay != stNow.wDay) {
|
|
|
+ ToLogRootINIInfo(pFSM);
|
|
|
+ spConfig->WriteConfigValue("RootUploadFlag", entityName, CSimpleStringA::Format("0x%08X", (DWORD)CSmallDateTime::GetNow()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /** GPIO不调用此接口 [Gifur@20221025]*/
|
|
|
+ void ToLogRootINIInfo(FSMBase* pFSM)
|
|
|
+ {
|
|
|
+ CSmartPointer<IConfigInfo> spConfigRoot;
|
|
|
+ pFSM->GetEntityBase()->GetFunction()->OpenConfig(Config_Root, spConfigRoot);
|
|
|
+
|
|
|
+ CSimpleStringA entityName(pFSM->GetEntityBase()->GetEntityName());
|
|
|
+ CSimpleStringA sectionName = CSimpleStringA::Format("Device.%s", entityName.GetData());
|
|
|
+ CSimpleStringA csVendor(true), csVersion(true), csBatch(true), csPort(true), csBaudrate(true);
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "Vendor", csVendor);
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "Version", csVersion);
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "Batch", csBatch);
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "Port", csPort);
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "Baudrate", csBaudrate);
|
|
|
+
|
|
|
+ std::map<std::string, std::string> rootInfo;
|
|
|
+ CSimpleStringA csPortNum(true), csCheckData(true), csKeySN(true), csInOutDir(true);
|
|
|
+ rootInfo["Vendor"] = csVendor;
|
|
|
+ rootInfo["Version"] = csVersion;
|
|
|
+ rootInfo["Batch"] = csBatch;
|
|
|
+ rootInfo["Port"] = csPort;
|
|
|
+ rootInfo["Baudrate"] = csBaudrate;
|
|
|
+
|
|
|
+ if (!entityName.Compare("Gpio")) {
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "PortNum", csPortNum);
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "InOutDir", csInOutDir);
|
|
|
+ rootInfo["PortNum"] = csPortNum;
|
|
|
+ rootInfo["InOutDir"] = csInOutDir;
|
|
|
+ } else if (!entityName.Compare("PinPad")) {
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "Checkdata", csCheckData);
|
|
|
+ spConfigRoot->ReadConfigValue(sectionName.GetData(), "Keysn", csKeySN);
|
|
|
+ rootInfo["Checkdata"] = csCheckData;
|
|
|
+ rootInfo["Keysn"] = csKeySN;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::pair<bool, std::string> strResult;
|
|
|
+ strResult = generateJsonStr(rootInfo);
|
|
|
+ strResult.second.c_str();
|
|
|
+
|
|
|
+ if (!entityName.IsNullOrEmpty()) {
|
|
|
+ LogWarn(Severity_Low, Error_Unexpect, RootIniCodeMap[entityName], strResult.second.c_str());
|
|
|
+ } else {
|
|
|
+ Dbg("Entity Name is empty, please check!!!");
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
void ToLogWarnInfoAboutTerm(FSMBase* pFSM, AdapterInfo adapterInfo)
|
|
|
{
|
|
|
CSmartPointer<IConfigInfo> spConfigRoot;
|