|
@@ -67,8 +67,8 @@ void CIDCertFSM::s0_on_entry()
|
|
|
void CIDCertFSM::s0_on_exit()
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
- //if (m_pIDCert != NULL) {
|
|
|
- // if (m_pIDCert->DevClose() == Error_Succeed)
|
|
|
+ //if (m_hDevHelper != NULL) {
|
|
|
+ // if (m_hDevHelper->DevClose() == Error_Succeed)
|
|
|
// LOG_TRACE("关闭二代证成功!");
|
|
|
// else
|
|
|
// LOG_TRACE("关闭二代证失败!");
|
|
@@ -297,17 +297,13 @@ ErrorCodeEnum CIDCertFSM::OnInit()
|
|
|
}
|
|
|
ErrorCodeEnum CIDCertFSM::OnExit()
|
|
|
{
|
|
|
- if (m_pIDCert != NULL)
|
|
|
+ if (m_hDevHelper)
|
|
|
{
|
|
|
- ErrorCodeEnum err;
|
|
|
- err = m_pIDCert->DevClose();
|
|
|
- LOG_TRACE("OnExit hr(%d)",err);
|
|
|
- }
|
|
|
- if (m_pIDCert)
|
|
|
- {
|
|
|
- ReleaseDevComponent((DeviceBaseClass *&)m_pIDCert);
|
|
|
- m_pIDCert = NULL;
|
|
|
+ ErrorCodeEnum err = Error_Succeed;
|
|
|
+ m_hDevHelper.TearDown();
|
|
|
+ return err;
|
|
|
}
|
|
|
+
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
|
|
@@ -335,6 +331,7 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
|
|
|
while(elapsed < IDCER_READ_TIMEOUT && !bGetIDCert && !m_bCancelRead)
|
|
|
{
|
|
|
+ Dbg("338");
|
|
|
if (m_bExit)
|
|
|
{
|
|
|
Dbg("exit");
|
|
@@ -347,7 +344,9 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
}
|
|
|
if (!bOpenRF)
|
|
|
{
|
|
|
- hr = m_pIDCert->IDCerRFControl(true);
|
|
|
+ Dbg("351");
|
|
|
+ hr = m_hDevHelper->IDCerRFControl(true);
|
|
|
+ Dbg("353");
|
|
|
if (Error_Succeed == hr)
|
|
|
{
|
|
|
Dbg("open rf succeed.");
|
|
@@ -367,14 +366,14 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ Dbg("372");
|
|
|
bOpenRF = true;
|
|
|
Sleep(IDCER_AUTH_INTERVAL);
|
|
|
- hr = m_pIDCert->IDCerAuthenticate();
|
|
|
+ hr = m_hDevHelper->IDCerAuthenticate();
|
|
|
if (Error_Succeed != hr)
|
|
|
{
|
|
|
DevErrorInfo devErrInfo;
|
|
|
- m_pIDCert->GetLastErr(devErrInfo);
|
|
|
+ m_hDevHelper->GetLastErr(devErrInfo);
|
|
|
|
|
|
Dbg("IDCerAuthenticate failed %d,%s.", hr, devErrInfo.szErrMsg);
|
|
|
|
|
@@ -385,7 +384,7 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
else
|
|
|
{
|
|
|
Dbg("auth succeed.");
|
|
|
- hr = m_pIDCert->IDCerGetData(idInfo);
|
|
|
+ hr = m_hDevHelper->IDCerGetData(idInfo);
|
|
|
if (hr != Error_Succeed)
|
|
|
{
|
|
|
LogErrMsg("ReadInfo::IDCerGetData", hr, MEC_DEVAPI_IDCER_IDCerGetData);
|
|
@@ -470,7 +469,7 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
// return 1;
|
|
|
//}
|
|
|
if(bOpenRF) {
|
|
|
- hr = m_pIDCert->IDCerRFControl(false);
|
|
|
+ hr = m_hDevHelper->IDCerRFControl(false);
|
|
|
if (hr != Error_Succeed)
|
|
|
{
|
|
|
Dbg("rf close failed(%d).",hr);
|
|
@@ -515,7 +514,7 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
}
|
|
|
if (!bOpenRF)
|
|
|
{
|
|
|
- eErr = m_pIDCert->IDCerRFControl(true);
|
|
|
+ eErr = m_hDevHelper->IDCerRFControl(true);
|
|
|
if (Error_Succeed == eErr)
|
|
|
{
|
|
|
Dbg("open rf succeed.");
|
|
@@ -537,12 +536,12 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
|
|
|
bOpenRF = true;
|
|
|
Sleep(IDCER_AUTH_INTERVAL);
|
|
|
- eErr = m_pIDCert->IDCerAuthenticate();//卡认证
|
|
|
+ eErr = m_hDevHelper->IDCerAuthenticate();//卡认证
|
|
|
if (Error_Succeed != eErr)
|
|
|
{
|
|
|
//LOG_TRACE("auth failed.");
|
|
|
DevErrorInfo devErrInfo;
|
|
|
- m_pIDCert->GetLastErr(devErrInfo);
|
|
|
+ m_hDevHelper->GetLastErr(devErrInfo);
|
|
|
Dbg("IDCerAuthenticate failed %d,%s.", eErr, devErrInfo.szErrMsg);
|
|
|
dwEnd = GetTickCount();
|
|
|
elapsed = dwEnd - dwStart;
|
|
@@ -551,7 +550,7 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
else
|
|
|
{
|
|
|
Dbg("auth succeed.");
|
|
|
- eErr = m_pIDCert->IDCerGetDataEx(idInfo);
|
|
|
+ eErr = m_hDevHelper->IDCerGetDataEx(idInfo);
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
|
LogErrMsg("ReadInfoEx::IDCerGetDataEx", eErr, MEC_DEVAPI_IDCER_IDCerGetDataEx,TRUE);
|
|
@@ -623,7 +622,7 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
//LogWarn(Severity_Low, Error_DevCommFailed, LOG_WARN_IDCERTIFICATE_ACTION, "IDCertificate read failed.");
|
|
|
|
|
|
int pos = 99;
|
|
|
- ErrorCodeEnum eErr1 =m_pIDCert->QueryCardPos(pos);
|
|
|
+ ErrorCodeEnum eErr1 = m_hDevHelper->QueryCardPos(pos);
|
|
|
if (eErr1 == Error_NotImpl)
|
|
|
{
|
|
|
Dbg("old version.no need position.");
|
|
@@ -633,9 +632,9 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
switch (pos)
|
|
|
{
|
|
|
case 1:
|
|
|
- eErr1 = m_pIDCert->IDCerRFControl(false);
|
|
|
+ eErr1 = m_hDevHelper->IDCerRFControl(false);
|
|
|
if (eErr1 != Error_Succeed)
|
|
|
- m_pIDCert->ForceIDEject();
|
|
|
+ m_hDevHelper->ForceIDEject();
|
|
|
break;
|
|
|
case 2:
|
|
|
break;
|
|
@@ -644,7 +643,7 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
break;
|
|
|
}
|
|
|
//查询卡片位置以决定跳转
|
|
|
- eErr1 = m_pIDCert->QueryCardPos(pos);
|
|
|
+ eErr1 = m_hDevHelper->QueryCardPos(pos);
|
|
|
if (eErr1 == Error_Succeed)
|
|
|
{
|
|
|
Dbg("pos:%d",pos);
|
|
@@ -655,7 +654,7 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
if (!(eErr1 == Error_Succeed && pos == 2))
|
|
|
{
|
|
|
//oilyang@20180531 add for close enter card
|
|
|
- m_pIDCert->IDCerRFControl(false); //这里基本不耗时,凯欣达大机耗时较长
|
|
|
+ m_hDevHelper->IDCerRFControl(false); //这里基本不耗时,凯欣达大机耗时较长
|
|
|
}
|
|
|
|
|
|
//zjw@20191219 处理完相关操作再返回给前端,防止状态还未跳转又发起流程
|
|
@@ -711,7 +710,7 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
}
|
|
|
if (!bOpenRF)
|
|
|
{
|
|
|
- eErr = m_pIDCert->IDCerRFControl(true);
|
|
|
+ eErr = m_hDevHelper->IDCerRFControl(true);
|
|
|
if (Error_Succeed == eErr)
|
|
|
{
|
|
|
Dbg("open rf succeed.");
|
|
@@ -733,11 +732,11 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
|
|
|
bOpenRF = true;
|
|
|
Sleep(IDCER_AUTH_INTERVAL);
|
|
|
- eErr = m_pIDCert->IDCerAuthenticate();
|
|
|
+ eErr = m_hDevHelper->IDCerAuthenticate();
|
|
|
if (Error_Succeed != eErr)
|
|
|
{
|
|
|
DevErrorInfo devErrInfo;
|
|
|
- m_pIDCert->GetLastErr(devErrInfo);
|
|
|
+ m_hDevHelper->GetLastErr(devErrInfo);
|
|
|
Dbg("IDCerAuthenticate failed %d,%s.", eErr, devErrInfo.szErrMsg);
|
|
|
dwEnd = GetTickCount();
|
|
|
elapsed = dwEnd - dwStart;
|
|
@@ -746,11 +745,11 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
else
|
|
|
{
|
|
|
Dbg("auth succeed.");
|
|
|
- eErr = m_pIDCert->IDCerGetDataEx(idInfo);
|
|
|
+ eErr = m_hDevHelper->IDCerGetDataEx(idInfo);
|
|
|
if (eErr == Error_NotImpl)
|
|
|
{
|
|
|
Dbg("to call old interface");
|
|
|
- eErr = m_pIDCert->IDCerGetData(idInfoOld);
|
|
|
+ eErr = m_hDevHelper->IDCerGetData(idInfoOld);
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
|
LogErrMsg("ReadAndScan::IDCerGetData", eErr, MEC_DEVAPI_IDCER_IDCerGetData);
|
|
@@ -839,7 +838,7 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
ctx->Ans.idtype = idInfo.idType.data;
|
|
|
ctx->Ans.reserved = idInfo.reserved.data;
|
|
|
ctx->Ans.startdate = idInfo.startDate.data;
|
|
|
- eErr = m_pIDCert->ScanIDAndSaveImage();
|
|
|
+ eErr = m_hDevHelper->ScanIDAndSaveImage();
|
|
|
ctx->Ans.hasscan = 0;
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
@@ -897,7 +896,7 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
//LogWarn(Severity_Low, Error_DevCommFailed, LOG_WARN_IDCERTIFICATE_ACTION, "IDCertificate read failed.");
|
|
|
|
|
|
int pos = 99;
|
|
|
- ErrorCodeEnum eErr1 = m_pIDCert->QueryCardPos(pos);
|
|
|
+ ErrorCodeEnum eErr1 = m_hDevHelper->QueryCardPos(pos);
|
|
|
if (eErr1 == Error_NotImpl)
|
|
|
{
|
|
|
Dbg("old version.no need position.");
|
|
@@ -907,9 +906,9 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
switch (pos)
|
|
|
{
|
|
|
case 1:
|
|
|
- eErr1 = m_pIDCert->IDCerRFControl(false);
|
|
|
+ eErr1 = m_hDevHelper->IDCerRFControl(false);
|
|
|
if (eErr1 != Error_Succeed)
|
|
|
- m_pIDCert->ForceIDEject();
|
|
|
+ m_hDevHelper->ForceIDEject();
|
|
|
break;
|
|
|
case 2:
|
|
|
break;
|
|
@@ -918,7 +917,7 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
break;
|
|
|
}
|
|
|
//查询卡片位置以决定跳转
|
|
|
- eErr1 = m_pIDCert->QueryCardPos(pos);
|
|
|
+ eErr1 = m_hDevHelper->QueryCardPos(pos);
|
|
|
if (eErr1 == Error_Succeed)
|
|
|
{
|
|
|
Dbg("pos:%d", pos);
|
|
@@ -930,7 +929,7 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
if (!(eErr1 == Error_Succeed && pos == 2))
|
|
|
{
|
|
|
//oilyang@20180531 add for close enter card
|
|
|
- m_pIDCert->IDCerRFControl(false); //这里基本不耗时,凯欣达新大机耗时较长(先改我们流程解决,后续需要厂商优化这里)
|
|
|
+ m_hDevHelper->IDCerRFControl(false); //这里基本不耗时,凯欣达新大机耗时较长(先改我们流程解决,后续需要厂商优化这里)
|
|
|
}
|
|
|
|
|
|
//zjw@20191219 处理完相关操作再返回给前端,防止状态还未跳转又发起流程
|
|
@@ -976,11 +975,11 @@ ErrorCodeEnum CIDCertFSM::GetPngBlob(CBlob &data, bool bClear)
|
|
|
Dbg("Get path failed.");
|
|
|
return Error_Param;
|
|
|
}
|
|
|
- strBkPath = strPath + "\\bk.PNG";
|
|
|
- strBmpPath = strPath + "\\zp.bmp";
|
|
|
- strPngPath = strPath + "\\zp.JPEG";
|
|
|
- strTxtPath = strPath + "\\wz.txt";
|
|
|
- strWltPath = strPath + "\\xp.wlt";
|
|
|
+ strBkPath = strPath + SPLIT_SLASH_STR + "bk.bmp";
|
|
|
+ strBmpPath = strPath + SPLIT_SLASH_STR + "zp.bmp";
|
|
|
+ strPngPath = strPath + SPLIT_SLASH_STR + "zp.JPEG";
|
|
|
+ strTxtPath = strPath + SPLIT_SLASH_STR + "wz.txt";
|
|
|
+ strWltPath = strPath + SPLIT_SLASH_STR + "xp.wlt";
|
|
|
|
|
|
Dbg("photo change: %s,%s,%s",(LPCSTR)strBkPath,(LPCSTR)strBmpPath,(LPCSTR)strPngPath);
|
|
|
bool bResult = imageprocess((char*)strBkPath.GetData(), (char*)strBmpPath.GetData(), (char*)strPngPath.GetData());
|
|
@@ -1025,7 +1024,7 @@ ErrorCodeEnum CIDCertFSM::GetPngBlobEx(CBlob &data, CSimpleStringA fileNamePrefi
|
|
|
DeleteZP(Bmp_SCAN);
|
|
|
return Error_Param;
|
|
|
}
|
|
|
- strPath = strPath + "\\" + fileNamePrefix;
|
|
|
+ strPath = strPath + SPLIT_SLASH_STR + fileNamePrefix;
|
|
|
Dbg("to load [%s.bmp",(const char*)strPath);
|
|
|
IplImage *src = cvLoadImage(strPath + ".bmp");
|
|
|
if (!src)
|
|
@@ -1071,7 +1070,7 @@ ErrorCodeEnum CIDCertFSM::DeleteFileIfExisted(LPCTSTR fileName)
|
|
|
}
|
|
|
CSimpleStringA strPath, strAimPath;
|
|
|
ErrorCodeEnum erroCode = m_pEntity->GetFunction()->GetPath("Dep", strPath);
|
|
|
- strAimPath = strPath + "\\" + fileName;
|
|
|
+ strAimPath = strPath + SPLIT_SLASH_STR + fileName;
|
|
|
|
|
|
if(ExistsDirA((LPCTSTR)strAimPath))
|
|
|
{
|
|
@@ -1120,7 +1119,7 @@ int CIDCertFSM::WaitFetchIDCard()
|
|
|
DWORD64 dwEnd = 0;
|
|
|
while ((dwEnd - dwStart)< 120 * 1000)//wait for 120 seconds
|
|
|
{
|
|
|
- eErr = m_pIDCert->QueryCardPos(pos);
|
|
|
+ eErr = m_hDevHelper->QueryCardPos(pos);
|
|
|
if (eErr == Error_Succeed && pos == 0)
|
|
|
{
|
|
|
Dbg("身份证被取回");
|
|
@@ -1156,9 +1155,9 @@ void CIDCertFSM::DeleteZP(int type)
|
|
|
int CIDCertFSM::ReadHZCard(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>::Pointer ctx)
|
|
|
{
|
|
|
//oiltest@20180613 for songrui hz
|
|
|
- //ErrorCodeEnum eErr = m_pIDCert->DevClose();
|
|
|
+ //ErrorCodeEnum eErr = m_hDevHelper->DevClose();
|
|
|
//Dbg("before read card,DevClose result:%d", eErr);
|
|
|
- //eErr = ReleaseDevComponent((DeviceBaseClass *&)m_pIDCert);
|
|
|
+ //eErr = ReleaseDevComponent((DeviceBaseClass *&)m_hDevHelper);
|
|
|
//Dbg("before read card,ReleaseDevComponent result:%d", eErr);
|
|
|
//HANDLE itc = device_open("USB", 0, 9600);
|
|
|
//if (itc > 0)
|
|
@@ -1182,9 +1181,9 @@ int CIDCertFSM::ReadHZCard(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
//}
|
|
|
//else
|
|
|
// Dbg("device_open failed result:%x", itc);
|
|
|
- //eErr = CreateDevComponent((DeviceBaseClass *&)m_pIDCert);
|
|
|
+ //eErr = CreateDevComponent((DeviceBaseClass *&)m_hDevHelper);
|
|
|
//Dbg("after read card,CreateDevComponent result:%d", eErr);
|
|
|
- //eErr = m_pIDCert->DevOpen(0);
|
|
|
+ //eErr = m_hDevHelper->DevOpen(0);
|
|
|
//Dbg("after read card,devopen result:%d",eErr);
|
|
|
return 0;
|
|
|
}
|
|
@@ -1377,7 +1376,40 @@ int CIDCertFSM::Initial()
|
|
|
LogWarn(Severity_Middle, err, AlarmDEC(), "IDCertificate init failed.");
|
|
|
return 2;
|
|
|
}
|
|
|
- m_pIDCert = m_hDevHelper.GetDevPointer();
|
|
|
+
|
|
|
+ CSimpleStringA dllName, tmpVendor(""), tmpDevSN(""), tmpDLLVersion, csDepPath("");
|
|
|
+
|
|
|
+ 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 + SPLIT_SLASH_STR + "IDCertificate." + tmpVendor + "." + tmpDLLVersion + ".dll";//oiltmp
|
|
|
+ Dbg("%s", (const char*)dllName);
|
|
|
+ HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, tmpVendor);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ err = SpGetDevAdaptorPath(m_pEntity, GetEntityBase()->GetEntityName(), dllName);
|
|
|
+ if (err != 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);
|
|
|
+
|
|
|
bool bOpenFlag = false;
|
|
|
do {
|
|
|
int tmpPort = 0;
|
|
@@ -1389,11 +1421,11 @@ int CIDCertFSM::Initial()
|
|
|
LogErrMsg("Initial:OpenConfig", err, AlarmDECToBusiness(MEC_CFG_RUN_POINTER_FAILED), TRUE);
|
|
|
return 2;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
spConfig->ReadConfigValueInt("Device.IDCertificate", "Port", tmpPort);
|
|
|
Dbg("IDCer open with port %d", tmpPort);
|
|
|
|
|
|
- err = m_pIDCert->DevOpen(tmpPort);
|
|
|
+ err = m_hDevHelper->DevOpen(tmpPort);
|
|
|
if (err != Error_Succeed)
|
|
|
{
|
|
|
//LogErrMsg("Initial::DevOpen", err, MEC_DEVAPI_IDCER_DevOpen);
|
|
@@ -1401,11 +1433,11 @@ int CIDCertFSM::Initial()
|
|
|
LogWarn(Severity_Middle, err, AlarmDEC(), "IDCertificate init failed.");
|
|
|
return 2;
|
|
|
}
|
|
|
- } while (m_pIDCert == NULL && bOpenFlag == false);
|
|
|
-
|
|
|
- if (m_pIDCert != NULL)
|
|
|
+ } while (!m_hDevHelper && bOpenFlag == false);
|
|
|
+
|
|
|
+ if (m_hDevHelper)
|
|
|
{
|
|
|
- err = m_pIDCert->IDCerRFControl(false);
|
|
|
+ err = m_hDevHelper->IDCerRFControl(false);
|
|
|
if (err != Error_Succeed)
|
|
|
LOG_TRACE("close rf failed.");
|
|
|
else
|
|
@@ -1414,14 +1446,15 @@ int CIDCertFSM::Initial()
|
|
|
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);
|
|
|
+ err = m_hDevHelper->GetDevCategory(m_devCatInfo);
|
|
|
if (err == 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)
|
|
|
+
|
|
|
+ if (m_hDevHelper)
|
|
|
{
|
|
|
m_devInit = true;
|
|
|
return 0;
|