|
@@ -982,7 +982,7 @@ ErrorCodeEnum CIDCertFSM::GetPngBlob(CBlob &data, bool bClear)
|
|
|
strWltPath = strPath + "\\xp.wlt";
|
|
|
|
|
|
Dbg("photo change: %s,%s,%s",(LPCSTR)strBkPath,(LPCSTR)strBmpPath,(LPCSTR)strPngPath);
|
|
|
- bool bResult = imageprocess((char*)strBmpPath.GetData(), (char*)strPngPath.GetData());
|
|
|
+ bool bResult = imageprocess((char*)strBkPath.GetData(), (char*)strBmpPath.GetData(), (char*)strPngPath.GetData());
|
|
|
Dbg("photo changed");
|
|
|
if (!bResult)
|
|
|
{
|
|
@@ -1348,164 +1348,6 @@ void CIDCertFSM::LogErrMsg(const char *pMsgHead, ErrorCodeEnum eErrCode,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-//int CIDCertFSM::Initial()
|
|
|
-//{
|
|
|
-// CSystemStaticInfo sysInfo;
|
|
|
-// GetEntityBase()->GetFunction()->GetSystemStaticInfo(sysInfo);
|
|
|
-// m_csMachineType = sysInfo.strMachineType;
|
|
|
-// m_terminalNo = sysInfo.strTerminalID;
|
|
|
-// Dbg("machineType:%s,terminalNo:%s", (const char*)m_csMachineType, (const char*)m_terminalNo);
|
|
|
-// if (_strnicmp((const char*)m_csMachineType, "RVC.IL", strlen("RVC.IL")) == 0)
|
|
|
-// {
|
|
|
-// m_bRVCIL = true;
|
|
|
-// return 0;
|
|
|
-// }
|
|
|
-// m_devState = DEVICE_STATUS_NOT_READY;
|
|
|
-//
|
|
|
-// to do device init
|
|
|
-// int initCount = 0;
|
|
|
-// ErrorCodeEnum err;
|
|
|
-// m_pIDCert = NULL;
|
|
|
-// bool bCreateDevCom = false;
|
|
|
-// ErrorCodeEnum eErrDev;
|
|
|
-// CSimpleStringA dllName, tmpVendor(""), tmpDevSN(""),tmpDLLVersion, csDepPath(""), csBackslash("\\");
|
|
|
-//
|
|
|
-// CSmartPointer<IEntityFunction> spEntityFunction = GetEntityBase()->GetFunction();
|
|
|
-// CSmartPointer<IConfigInfo> spConfig;
|
|
|
-// eErrDev = spEntityFunction->OpenConfig(Config_Root, spConfig);
|
|
|
-// if (eErrDev != Error_Succeed) {
|
|
|
-// Dbg("open cfg file failed!");
|
|
|
-// LogErrMsg("Initial:OpenConfig", eErrDev, AlarmDECToBusiness(MEC_CFG_RUN_POINTER_FAILED),TRUE);
|
|
|
-// return 2;
|
|
|
-// }
|
|
|
-//
|
|
|
-// GetEntityBase()->GetFunction()->GetSysVar("FWBVendor", tmpVendor);
|
|
|
-// GetEntityBase()->GetFunction()->GetSysVar("FWBDevSN", tmpDevSN);
|
|
|
-// GetEntityBase()->GetFunction()->GetSysVar("FWBVersion", tmpDLLVersion);
|
|
|
-// if (tmpDLLVersion.GetLength() < 2)//如果忘记配置,则直接使用默认值8.1
|
|
|
-// tmpDLLVersion = "8.1";
|
|
|
-// if (tmpDevSN.GetLength() > 12 && tmpDevSN.IndexOf("FWB") > 2)
|
|
|
-// {
|
|
|
-// Dbg("This is fwb device.");
|
|
|
-// GetEntityBase()->GetFunction()->GetPath("Dep", csDepPath);
|
|
|
-// dllName = csDepPath + csBackslash + "IDCertificate." + tmpVendor + "." + tmpDLLVersion + ".dll";//oiltmp
|
|
|
-// Dbg("%s", (const char*)dllName);
|
|
|
-// HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, tmpVendor);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// eErrDev = SpGetDevAdaptorPath(m_pEntity, GetEntityBase()->GetEntityName(), dllName);
|
|
|
-// if (eErrDev != Error_Succeed){
|
|
|
-// Dbg("get vendor dll(%s)name failed.", (LPCTSTR)dllName);
|
|
|
-// return 2;
|
|
|
-// }
|
|
|
-//
|
|
|
-// CSmartPointer<IConfigInfo> pConfig;
|
|
|
-// ErrorCodeEnum rc = GetEntityBase()->GetFunction()->OpenConfig(Config_Root, pConfig);
|
|
|
-// CSimpleStringA strSection = CSimpleStringA("Device.") + GetEntityBase()->GetEntityName();
|
|
|
-// CSimpleStringA str;
|
|
|
-// pConfig->ReadConfigValue(strSection, "Vendor", str);
|
|
|
-// HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, str);
|
|
|
-// }
|
|
|
-//
|
|
|
-// Dbg("%s", (LPCTSTR)dllName);
|
|
|
-//
|
|
|
-// spConfig->ReadConfigValue("Device.IDCertificate", "Vendor", m_devVendor);
|
|
|
-// spConfig->ReadConfigValue("Device.IDCertificate", "Version", m_devVer);
|
|
|
-// spConfig->ReadConfigValue("Device.IDCertificate", "Batch", m_devBatch);
|
|
|
-// Dbg("Vendor=%s#Version=%s#Batch=%s", (const char*)m_devVendor, (const char*)m_devVer, (const char*)m_devBatch);
|
|
|
-// /*------2020-02-13-------*/
|
|
|
-// /*modify by LZM*/
|
|
|
-// eErrDev = VendorLogControler(this, "IDCertificate");
|
|
|
-// if (eErrDev != Error_Succeed)
|
|
|
-// {
|
|
|
-// Dbg("VendorLogControler Failed...");
|
|
|
-// }
|
|
|
-//
|
|
|
-// /*-----------------------*/
|
|
|
-// m_hVerdorDll = LoadLibraryA(dllName);
|
|
|
-// if (m_hVerdorDll == NULL)
|
|
|
-// {
|
|
|
-// Dbg("load verdor dll failed(%d).", GetLastError());
|
|
|
-// return 2;
|
|
|
-// }
|
|
|
-// if ((CreateDevComponent = (lpCreateDevCom)GetProcAddress(m_hVerdorDll, "CreateDevComponent")) == NULL)
|
|
|
-// {
|
|
|
-// Dbg("Get CreateDevComponent failed(%d).", GetLastError());
|
|
|
-// return 2;
|
|
|
-// }
|
|
|
-// if ((ReleaseDevComponent = (lpReleaseDevCom)GetProcAddress(m_hVerdorDll, "ReleaseDevComponent")) == NULL)
|
|
|
-// {
|
|
|
-// Dbg("Get ReleaseDevComponent failed(%d).", GetLastError());
|
|
|
-// return 2;
|
|
|
-// }
|
|
|
-// Dbg("Get function suc.");
|
|
|
-// bool bOpenFlag = false;
|
|
|
-// do {
|
|
|
-// if (!bCreateDevCom)
|
|
|
-// {
|
|
|
-// if (CreateDevComponent((DeviceBaseClass * &)m_pIDCert) != Error_Succeed)
|
|
|
-// {
|
|
|
-// LOG_TRACE("Create IDCertificateReader module failed.");
|
|
|
-// initCount++;
|
|
|
-// m_pIDCert = NULL;
|
|
|
-// if (initCount >= IDCER_INIT_COUNT)
|
|
|
-// break;
|
|
|
-// else
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// bCreateDevCom = true;
|
|
|
-// LOG_TRACE("Create IDCertificateReader module succeeded.");
|
|
|
-// }
|
|
|
-//
|
|
|
-// IDCerInitParam initParam;
|
|
|
-// initParam.ePortType = IDCER_PORTCOM;
|
|
|
-// int tmpPort = 0;
|
|
|
-// spConfig->ReadConfigValueInt("Device.IDCertificate", "Port", tmpPort);
|
|
|
-// Dbg("IDCer open with port %d", tmpPort);
|
|
|
-// err = m_pIDCert->DevOpen(tmpPort);
|
|
|
-// if (err != Error_Succeed)
|
|
|
-// {
|
|
|
-// LogErrMsg("Initial::DevOpen", err, MEC_DEVAPI_IDCER_DevOpen);
|
|
|
-// LogWarn(Severity_Middle, err, AlarmDEC(), "IDCertificate init failed.");
|
|
|
-// return 2;
|
|
|
-// initCount++;
|
|
|
-// m_pIDCert = NULL;
|
|
|
-// if (initCount >= IDCER_INIT_COUNT)
|
|
|
-// break;
|
|
|
-// else
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// } while (m_pIDCert == NULL && bOpenFlag == false);
|
|
|
-// if (m_pIDCert != NULL)
|
|
|
-// {
|
|
|
-// err = m_pIDCert->IDCerRFControl(false);
|
|
|
-// if (err != Error_Succeed)
|
|
|
-// LOG_TRACE("close rf failed.");
|
|
|
-// else
|
|
|
-// LOG_TRACE("close rf ok.");
|
|
|
-// }
|
|
|
-// ZeroMemory(m_devCatInfo.szModel, MAX_DEV_MODEL_LEN);
|
|
|
-// ZeroMemory(m_devCatInfo.szType, MAX_DEV_TYPE_LEN);
|
|
|
-// ZeroMemory(m_devCatInfo.szVendor, MAX_DEV_VENDOR_LEN);
|
|
|
-// eErrDev = m_pIDCert->GetDevCategory(m_devCatInfo);
|
|
|
-// if (eErrDev == Error_Succeed)
|
|
|
-// {
|
|
|
-// Dbg("%d,%d,%d", strlen(m_devCatInfo.szModel), strlen(m_devCatInfo.szType), strlen(m_devCatInfo.szVendor));
|
|
|
-// if (strlen(m_devCatInfo.szModel) < 256)
|
|
|
-// Dbg("%s", m_devCatInfo.szModel);
|
|
|
-// }
|
|
|
-// if (m_pIDCert != NULL)
|
|
|
-// {
|
|
|
-// m_devInit = true;
|
|
|
-// return 0;
|
|
|
-// }
|
|
|
-//
|
|
|
-// else
|
|
|
-// return 2;
|
|
|
-// return 0;
|
|
|
-//}
|
|
|
-
|
|
|
int CIDCertFSM::Initial()
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
@@ -1529,15 +1371,14 @@ int CIDCertFSM::Initial()
|
|
|
return Error_DevLoadFileFailed;
|
|
|
}
|
|
|
|
|
|
- m_DevAdptLibHelper = new DevAdptLibHelper<IDCerClass>();
|
|
|
- err = m_DevAdptLibHelper->LoadUp(csLibFullName);
|
|
|
+ err = m_hDevHelper.LoadUp(csLibFullName);
|
|
|
if (err != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("Initial::DevOpen", err, MEC_DEVAPI_IDCER_DevOpen);
|
|
|
+ LOG_IDCER_ERROR_MSG_MACRO(err, DevOpen);
|
|
|
LogWarn(Severity_Middle, err, AlarmDEC(), "IDCertificate init failed.");
|
|
|
return 2;
|
|
|
}
|
|
|
- m_pIDCert = m_DevAdptLibHelper->GetDevPointer();
|
|
|
+ m_pIDCert = m_hDevHelper.GetDevPointer();
|
|
|
bool bOpenFlag = false;
|
|
|
do {
|
|
|
int tmpPort = 0;
|
|
@@ -1546,7 +1387,7 @@ int CIDCertFSM::Initial()
|
|
|
err = spEntityFunction->OpenConfig(Config_Root, spConfig);
|
|
|
if (err != Error_Succeed) {
|
|
|
Dbg("open cfg file failed!");
|
|
|
- LogErrMsg("Initial:OpenConfig", err, AlarmDECToBusiness(MEC_CFG_RUN_POINTER_FAILED),TRUE);
|
|
|
+ LogErrMsg("Initial:OpenConfig", err, AlarmDECToBusiness(MEC_CFG_RUN_POINTER_FAILED), TRUE);
|
|
|
return 2;
|
|
|
}
|
|
|
|
|
@@ -1556,7 +1397,8 @@ int CIDCertFSM::Initial()
|
|
|
err = m_pIDCert->DevOpen(tmpPort);
|
|
|
if (err != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("Initial::DevOpen", err, MEC_DEVAPI_IDCER_DevOpen);
|
|
|
+ //LogErrMsg("Initial::DevOpen", err, MEC_DEVAPI_IDCER_DevOpen);
|
|
|
+ LOG_IDCER_ERROR_MSG_MACRO(err, DevOpen);
|
|
|
LogWarn(Severity_Middle, err, AlarmDEC(), "IDCertificate init failed.");
|
|
|
return 2;
|
|
|
}
|
|
@@ -1570,9 +1412,9 @@ int CIDCertFSM::Initial()
|
|
|
else
|
|
|
LOG_TRACE("close rf ok.");
|
|
|
}
|
|
|
- ZeroMemory(m_devCatInfo.szModel, MAX_DEV_MODEL_LEN);
|
|
|
- ZeroMemory(m_devCatInfo.szType, MAX_DEV_TYPE_LEN);
|
|
|
- ZeroMemory(m_devCatInfo.szVendor, MAX_DEV_VENDOR_LEN);
|
|
|
+ memset(m_devCatInfo.szModel, 0, MAX_DEV_MODEL_LEN);
|
|
|
+ memset(m_devCatInfo.szType, 0, MAX_DEV_TYPE_LEN);
|
|
|
+ memset(m_devCatInfo.szVendor, 0, MAX_DEV_VENDOR_LEN);
|
|
|
err = m_pIDCert->GetDevCategory(m_devCatInfo);
|
|
|
if (err == Error_Succeed)
|
|
|
{
|