|
@@ -1800,55 +1800,6 @@ ErrorCodeEnum CHSPScannerFSM::OnDevExit()
|
|
|
return erroCode;
|
|
|
}
|
|
|
|
|
|
-void CHSPScannerFSM::UploadVendorDllInfo()
|
|
|
-{
|
|
|
- std::map<std::string, std::string> termInfo;
|
|
|
- BYTE fileHash[32];
|
|
|
- int fileSize = 0;
|
|
|
- CSimpleStringA strDepPath;
|
|
|
- GetEntityBase()->GetFunction()->GetPath("Dep", strDepPath);
|
|
|
- CSimpleStringA csDllPath = CSimpleStringA::Format("%s/%s.so", (LPCTSTR)strDepPath, (LPCTSTR)m_csDllName);
|
|
|
- GetFileSizeAndCalcHashValue(csDllPath, fileSize, fileHash);
|
|
|
-
|
|
|
- char* strFileHash = new char[128];
|
|
|
- memset(strFileHash, 0, 128);
|
|
|
- HexBuf2StrBuf(fileHash, &strFileHash, 32);
|
|
|
- termInfo["VendorDllName"] = csDllPath.GetData();
|
|
|
- termInfo["VendorDllFileHash"] = strFileHash;
|
|
|
- memset(strFileHash, 0, 128);
|
|
|
- termInfo["VendorDllFileSize"] = _itoa(fileSize, strFileHash, 10);
|
|
|
-
|
|
|
- if (strlen(m_devCat.szModel) > 1 && strlen(m_devCat.szModel) < 255)
|
|
|
- termInfo["szModel"] = m_devCat.szModel;
|
|
|
- if (strlen(m_devCat.szType) > 1 && strlen(m_devCat.szType) < 255)
|
|
|
- termInfo["szType"] = m_devCat.szType;
|
|
|
- termInfo["Port"] = m_csPort;
|
|
|
- termInfo["Baudrate"] = m_csBuadrate;
|
|
|
-
|
|
|
- std::pair<bool, std::string> strResult;
|
|
|
- strResult = generateJsonStr(termInfo);
|
|
|
-
|
|
|
- CSmartPointer<IConfigInfo> spConfigRun;
|
|
|
- CSimpleStringA csWarnMsg("");
|
|
|
- int wDay = 99;
|
|
|
- GetEntityBase()->GetFunction()->OpenConfig(Config_Run, spConfigRun);
|
|
|
- SYSTEMTIME localTime;
|
|
|
- GetLocalTime(&localTime);
|
|
|
- spConfigRun->ReadConfigValueInt("DllInfo", "WarnDay", wDay);
|
|
|
- spConfigRun->ReadConfigValue("DllInfo", "WarnMsg", csWarnMsg);
|
|
|
- if ((strResult.first && !strResult.second.empty())
|
|
|
- &&
|
|
|
- (csWarnMsg.IsNullOrEmpty() || csWarnMsg.Compare(strResult.second.c_str()) || wDay != localTime.wDay))
|
|
|
- {
|
|
|
- LogWarn(Severity_Low, Error_Unexpect, HSPScanner_UserErrorCode_UPLOAD_VENDORINFO, strResult.second.c_str());
|
|
|
- spConfigRun->WriteConfigValueInt("DllInfo", "WarnDay", localTime.wDay);
|
|
|
- spConfigRun->WriteConfigValue("DllInfo", "WarnMsg", strResult.second.c_str());
|
|
|
- }
|
|
|
- if (strFileHash != NULL)
|
|
|
- delete[] strFileHash;
|
|
|
- return;
|
|
|
-}
|
|
|
-
|
|
|
UINT CHSPScannerFSM::UnitTest(LPCTSTR testTag)
|
|
|
{
|
|
|
#ifdef TWINKLE_LOCAL_DEBUG
|