|
@@ -433,6 +433,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");
|
|
@@ -452,14 +453,17 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DevErrorInfo devErrInfo;
|
|
|
- m_hDevHelper->GetLastErr(devErrInfo);
|
|
|
- Dbg("ReadInfo::IDCerRFControl failed, EC = %s, errMsg = %s", SpStrError(hr), devErrInfo.szErrMsg);
|
|
|
-
|
|
|
+ Dbg("open rf failed. %d",hr);
|
|
|
dwEnd = RVCGetTickCount();
|
|
|
elapsed = dwEnd - dwStart;
|
|
|
- Sleep(IDCER_AUTH_INTERVAL);
|
|
|
- continue;
|
|
|
+ //if cannot open rf in 10s ,quit
|
|
|
+ // Adapt to Desk2S [4/12/2018 15:05 @Gifur]
|
|
|
+ /*if (elapsed > 10000)
|
|
|
+ break;
|
|
|
+ else*/{
|
|
|
+ Sleep(IDCER_AUTH_INTERVAL);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
bOpenRF = true;
|
|
@@ -470,7 +474,7 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
DevErrorInfo devErrInfo;
|
|
|
m_hDevHelper->GetLastErr(devErrInfo);
|
|
|
|
|
|
- Dbg("ReadInfo::IDCerAuthenticate failed %s, %s.", SpStrError(hr), devErrInfo.szErrMsg);
|
|
|
+ Dbg("IDCerAuthenticate failed %d,%s.", hr, devErrInfo.szErrMsg);
|
|
|
|
|
|
dwEnd = RVCGetTickCount();
|
|
|
elapsed = dwEnd - dwStart;
|
|
@@ -488,8 +492,10 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
{
|
|
|
LOG_TRACE("read succeed.");
|
|
|
LogEvent(Severity_Middle,LOG_EVT_IDCERTIFICATE_OP,"IDCertifacate op.");
|
|
|
-
|
|
|
+ //oiltest
|
|
|
ctx->Ans.name = idInfo.name.data;
|
|
|
+ //ctx->Ans.name = "我.们我.们我·们我·们爱邱总";
|
|
|
+ //ctx->Ans.name = "张云虎";
|
|
|
ctx->Ans.sex = idInfo.sex.data;
|
|
|
ctx->Ans.nation = idInfo.nation.data;
|
|
|
ctx->Ans.birthday = idInfo.birthday.data;
|
|
@@ -506,8 +512,6 @@ int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Poin
|
|
|
ctx->Ans.startdate = idInfo.startDate.data;
|
|
|
ctx->Ans.enddate = idInfo.endDate.data;
|
|
|
|
|
|
- LogDate(idInfo);
|
|
|
-
|
|
|
Dbg("Sex:%s,Nation:%s,EndDate:%s,IDNo:%s****%s,"
|
|
|
,idInfo.sex.data
|
|
|
,idInfo.nation.data
|
|
@@ -574,8 +578,6 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
m_bWaitReadMore = false;
|
|
|
m_bReading = true;
|
|
|
m_bExit = false;
|
|
|
- bool bReadSuccess = false;
|
|
|
-
|
|
|
while (elapsed < IDCER_READ_TIMEOUT && !bGetIDCert && !m_bCancelRead)
|
|
|
{
|
|
|
if (m_bExit)
|
|
@@ -583,7 +585,6 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
Dbg("exit");
|
|
|
break;
|
|
|
}
|
|
|
- bReadSuccess = false;
|
|
|
if (m_bWaitReadMore)
|
|
|
{
|
|
|
dwStart = RVCGetTickCount();
|
|
@@ -655,8 +656,6 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
ctx->Ans.reserved = idInfo.reserved.data;
|
|
|
ctx->Ans.startdate = idInfo.startDate.data;
|
|
|
|
|
|
- LogDateEx(idInfo);
|
|
|
-
|
|
|
/*Dbg("Name:%s,Sex:%s,Nation:%s,Birthday:%s,StartDate:%s,EndDate:%s,IDNo:%s****%s,Address:%s,IDType:%s,Department:%s,EnglishName:%s,Nationality:%s"
|
|
|
, (const char*)ctx->Ans.name, (const char*)ctx->Ans.sex, (const char*)ctx->Ans.nation
|
|
|
, (const char*)ctx->Ans.birthday
|
|
@@ -693,6 +692,9 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
m_bReading = false;
|
|
|
LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_OFF, "IDCer warning off");
|
|
|
Dbg("after close light");
|
|
|
+
|
|
|
+ //if (!bGetIDCert)
|
|
|
+ //LogWarn(Severity_Low, Error_DevCommFailed, LOG_WARN_IDCERTIFICATE_ACTION, "IDCertificate read failed.");
|
|
|
|
|
|
int pos = 99;
|
|
|
ErrorCodeEnum eErr1 = m_hDevHelper->QueryCardPos(pos);
|
|
@@ -735,9 +737,8 @@ int CIDCertFSM::ReadInfoEx(SpReqAnsContext<IDCert_ReadEx_Req, IDCert_ReadEx_Ans>
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
else if (m_bCancelRead)
|
|
|
ctx->Answer(Error_Cancel);
|
|
|
- else if (elapsed >= IDCER_READ_TIMEOUT){
|
|
|
+ else if (elapsed >= IDCER_READ_TIMEOUT)
|
|
|
ctx->Answer(Error_TimeOut);
|
|
|
- }
|
|
|
else
|
|
|
ctx->Answer(Error_Unexpect);
|
|
|
if (eErr1 == Error_Succeed && pos == 2)
|
|
@@ -754,10 +755,6 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
DWORD dwStart = RVCGetTickCount();
|
|
|
DWORD dwEnd = RVCGetTickCount();
|
|
|
ErrorCodeEnum eErr;
|
|
|
- ErrorCodeEnum errRF = Error_Unexpect;
|
|
|
- ErrorCodeEnum errAuth = Error_Unexpect;
|
|
|
- ErrorCodeEnum errRead = Error_Unexpect;
|
|
|
- ErrorCodeEnum errReadEx = Error_Unexpect;
|
|
|
LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_ON, "IDCer warning on");
|
|
|
|
|
|
DeleteZP(Bmp_ZP|Bmp_SCAN);
|
|
@@ -771,11 +768,10 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
m_bWaitReadMore = false;
|
|
|
m_bReading = true;
|
|
|
m_bExit = false;
|
|
|
- bool bReadSuccess = false;
|
|
|
- bool bInvokeReadEx = false;
|
|
|
- bool bExitWhenReading = false;
|
|
|
|
|
|
- bool bIDCerAuthenticate = false;
|
|
|
+ ErrorCodeEnum ecForIDCerRFControl(Error_Succeed);
|
|
|
+ ErrorCodeEnum ecForIDCerAuthenticate(Error_Succeed);
|
|
|
+
|
|
|
|
|
|
while (elapsed < IDCER_READ_TIMEOUT && !bGetIDCert && !m_bCancelRead)
|
|
|
{
|
|
@@ -784,8 +780,6 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
Dbg("exit");
|
|
|
break;
|
|
|
}
|
|
|
- bReadSuccess = false;
|
|
|
- bInvokeReadEx = false;
|
|
|
if (m_bWaitReadMore)
|
|
|
{
|
|
|
dwStart = RVCGetTickCount();
|
|
@@ -793,8 +787,9 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
}
|
|
|
if (!bOpenRF)
|
|
|
{
|
|
|
- errRF = m_hDevHelper->IDCerRFControl(true);
|
|
|
- if (Error_Succeed == errRF)
|
|
|
+ eErr = m_hDevHelper->IDCerRFControl(true);
|
|
|
+ ecForIDCerRFControl = eErr;
|
|
|
+ if (Error_Succeed == eErr)
|
|
|
{
|
|
|
Dbg("open rf succeed.");
|
|
|
}
|
|
@@ -810,36 +805,33 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
|
|
|
bOpenRF = true;
|
|
|
Sleep(IDCER_AUTH_INTERVAL);
|
|
|
- bIDCerAuthenticate = false;
|
|
|
- errAuth = m_hDevHelper->IDCerAuthenticate();
|
|
|
- if (Error_Succeed != errAuth)
|
|
|
+ eErr = m_hDevHelper->IDCerAuthenticate();
|
|
|
+ ecForIDCerAuthenticate = eErr;
|
|
|
+ if (Error_Succeed != eErr)
|
|
|
{
|
|
|
- DevErrorInfo devErrInfo;
|
|
|
- m_hDevHelper->GetLastErr(devErrInfo);
|
|
|
- Dbg("IDCerAuthenticate failed: %s,%s.", SpStrError(errAuth), devErrInfo.szErrMsg);
|
|
|
+ Dbg("IDCerAuthenticate failed: %s", SpStrError(ecForIDCerAuthenticate));
|
|
|
dwEnd = RVCGetTickCount();
|
|
|
elapsed = dwEnd - dwStart;
|
|
|
+ if (eErr == Error_DevMedia)
|
|
|
+ break;
|
|
|
continue;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
Dbg("auth succeed.");
|
|
|
- bIDCerAuthenticate = true;
|
|
|
- errReadEx = m_hDevHelper->IDCerGetDataEx(idInfo);
|
|
|
- if (errReadEx == Error_NotImpl)
|
|
|
+ eErr = m_hDevHelper->IDCerGetDataEx(idInfo);
|
|
|
+ if (eErr == Error_NotImpl)
|
|
|
{
|
|
|
Dbg("to call old interface");
|
|
|
- bInvokeReadEx = false;
|
|
|
- errRead = m_hDevHelper->IDCerGetData(idInfoOld);
|
|
|
- if (errRead != Error_Succeed)
|
|
|
+ eErr = m_hDevHelper->IDCerGetData(idInfoOld);
|
|
|
+ if (eErr != Error_Succeed)
|
|
|
{
|
|
|
- bReadSuccess = false;
|
|
|
Dbg("Invoke IDCerGetData failed: %s", SpStrError(eErr));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
Dbg("read succeed.");
|
|
|
- bReadSuccess = true;
|
|
|
+
|
|
|
LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_OP, "IDCertifacate op.");
|
|
|
|
|
|
ctx->Ans.name = idInfoOld.name.data;
|
|
@@ -847,12 +839,15 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
ctx->Ans.nation = idInfoOld.nation.data;
|
|
|
ctx->Ans.birthday = idInfoOld.birthday.data;
|
|
|
ctx->Ans.address = idInfoOld.address.data;
|
|
|
+ //oiltest
|
|
|
ctx->Ans.idcode = idInfoOld.idno.data;
|
|
|
//oilyang@20180309 根据俞根伟,生产上存在身份证异常为'x'的问题,统一进行转换
|
|
|
if (ctx->Ans.idcode[ctx->Ans.idcode.GetLength() - 1] == 'x')
|
|
|
{
|
|
|
+ Dbg("x to X");
|
|
|
ctx->Ans.idcode[ctx->Ans.idcode.GetLength() - 1] = 'X';
|
|
|
}
|
|
|
+ //ctx->Ans.idcode = "370285198804025014";
|
|
|
ctx->Ans.department = idInfoOld.department.data;
|
|
|
ctx->Ans.startdate = idInfoOld.startDate.data;
|
|
|
ctx->Ans.enddate = idInfoOld.endDate.data;
|
|
@@ -866,7 +861,8 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
,idInfoOld.endDate.data
|
|
|
,(const char*)ctx->Ans.idcode.SubString(0, 4), (const char*)ctx->Ans.idcode.SubString(ctx->Ans.idcode.GetLength() - 1, 1));
|
|
|
|
|
|
- GetPngBlobEx(ctx->Ans.headphoto, "zp");
|
|
|
+ Dbg("to get photo");
|
|
|
+ GetPngBlobEx(ctx->Ans.headphoto, "zp", true);
|
|
|
eErr = GetPngBlob(ctx->Ans.photodata, true);
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
@@ -880,16 +876,13 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bInvokeReadEx = true;
|
|
|
- if (errReadEx != Error_Succeed)
|
|
|
+ if (eErr != Error_Succeed)
|
|
|
{
|
|
|
- Dbg("Invoke IDCerGetDataEx failed: %s", SpStrError(errReadEx));
|
|
|
- bReadSuccess = false;
|
|
|
+ Dbg("Invoke IDCerGetDataEx failed: %s", SpStrError(eErr));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
Dbg("read succeed.");
|
|
|
- bReadSuccess = true;
|
|
|
LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_OP, "IDCertifacate op.");
|
|
|
ctx->Ans.name = idInfo.name.data;
|
|
|
ctx->Ans.sex = idInfo.sex.data;
|
|
@@ -900,6 +893,7 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
//oilyang@20180309 根据俞根伟,生产上存在身份证异常为'x'的问题,统一进行转换
|
|
|
if (ctx->Ans.idcode[ctx->Ans.idcode.GetLength() - 1] == 'x')
|
|
|
{
|
|
|
+ Dbg("x to X");
|
|
|
ctx->Ans.idcode[ctx->Ans.idcode.GetLength() - 1] = 'X';
|
|
|
}
|
|
|
ctx->Ans.department = idInfo.department.data;
|
|
@@ -913,24 +907,21 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
ctx->Ans.startdate = idInfo.startDate.data;
|
|
|
eErr = m_hDevHelper->ScanIDAndSaveImage();
|
|
|
ctx->Ans.hasscan = 0;
|
|
|
-
|
|
|
- //hyc@2021.3.24
|
|
|
- LogDateEx(idInfo);
|
|
|
-
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
//idfront.bmp" and "idback.bmp
|
|
|
ErrorCodeEnum eErrFront, eErrBack;
|
|
|
- eErrFront = GetPngBlobEx(ctx->Ans.frontphoto, "idfront");
|
|
|
- eErrBack = GetPngBlobEx(ctx->Ans.backphoto, "idback", true);
|
|
|
+ eErrFront = GetPngBlobEx(ctx->Ans.frontphoto, "idfront", false);
|
|
|
+ eErrBack = GetPngBlobEx(ctx->Ans.backphoto, "idback", false);
|
|
|
+
|
|
|
if (eErrFront == Error_Succeed && eErrBack == Error_Succeed)
|
|
|
ctx->Ans.hasscan = 1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("ReadAndScan::ScanIDAndSaveImage with errCode: %s", SpStrError(eErr));
|
|
|
+ Dbg("Invoke ScanIDAndSaveImage Failed: %s", SpStrError(eErr));
|
|
|
}
|
|
|
- GetPngBlobEx(ctx->Ans.headphoto, "zp");
|
|
|
+ GetPngBlobEx(ctx->Ans.headphoto, "zp", true);
|
|
|
|
|
|
Dbg("Sex:%s,Nation:%s,EndDate:%s,IDNo:%s****%s,IDType:%s"
|
|
|
, (const char*)ctx->Ans.sex, (const char*)ctx->Ans.nation
|
|
@@ -955,27 +946,13 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
elapsed = dwEnd - dwStart;
|
|
|
|
|
|
}
|
|
|
- if (m_bExit) {
|
|
|
- bExitWhenReading = true;
|
|
|
- }
|
|
|
-
|
|
|
- if(!m_bExit && !bOpenRF && errRF != Error_Succeed)
|
|
|
- {
|
|
|
- SetErrPackage(m_errPkg, "ReadAndScan::IDCerRFControl", m_devSN, errRF, MEC_DEVAPI_IDCER_IDCerRFControl);
|
|
|
- AlarmDEC(m_errPkg, true);
|
|
|
- Dbg("ReadAndScan::IDCerRFControl with errcode: %s", SpStrError(errRF));
|
|
|
- }
|
|
|
-
|
|
|
- if(!m_bExit && bOpenRF && !bIDCerAuthenticate)
|
|
|
- {
|
|
|
- SetErrPackage(m_errPkg, "ReadAndScan::IDCerAuthenticate", m_devSN, errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate);
|
|
|
- AlarmDEC(m_errPkg, true);
|
|
|
- Dbg("ReadAndScan::IDCerAuthenticate with errcode: %s", SpStrError(errAuth));
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
m_bExit = false;
|
|
|
m_bReading = false;
|
|
|
LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_OFF, "IDCer warning off");
|
|
|
+ Dbg("after close light");
|
|
|
+ Dbg("ans size:%d",sizeof(ctx->Ans));
|
|
|
+ Dbg("%d",FIELD_OFFSET(IDCertificate::IDCertService_ReadAndScan_Ans, reserved));
|
|
|
|
|
|
int pos = 99;
|
|
|
ErrorCodeEnum eErr1 = m_hDevHelper->QueryCardPos(pos);
|
|
@@ -991,14 +968,13 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
case 1:
|
|
|
case 2:
|
|
|
eErr1 = m_hDevHelper->IDCerRFControl(false);
|
|
|
- if (eErr1 != Error_Succeed) {
|
|
|
+ if (eErr1 != Error_Succeed)
|
|
|
+ {
|
|
|
Dbg("exec IDCerRFControl(false) failed, force eject...");
|
|
|
- SetErrPackage(m_errPkg, "ReadAndScan::IDCerRFControl", m_devSN, eErr1, MEC_DEVAPI_IDCER_IDCerRFControl);
|
|
|
- AlarmDEC(m_errPkg, false);
|
|
|
m_hDevHelper->ForceIDEject();
|
|
|
- } else {
|
|
|
- Dbg("exec IDCerRFControl(false) succ.");
|
|
|
}
|
|
|
+ else
|
|
|
+ Dbg("exec IDCerRFControl(false) succ.");
|
|
|
break;
|
|
|
case 0:
|
|
|
default:
|
|
@@ -1009,46 +985,53 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
if (eErr1 == Error_Succeed)
|
|
|
{
|
|
|
Dbg("pos after eject:%d", pos);
|
|
|
- } else {
|
|
|
- SetErrPackage(m_errPkg, "ReadAndScan::QueryCardPos", m_devSN, eErr1, MEC_DEVAPI_IDCER_QueryCardPos);
|
|
|
- AlarmDEC(m_errPkg, false);
|
|
|
- Dbg("ReadAndScan::QueryCardPos with errcode: %s", SpStrError(eErr1));
|
|
|
+ /*if (pos == 2)
|
|
|
+ return 4;*/
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ( ! (eErr1 == Error_Succeed && pos == 2) )
|
|
|
{
|
|
|
//oilyang@20180531 add for close enter card
|
|
|
- Dbg("Close RF again...");
|
|
|
- ErrorCodeEnum errRf = m_hDevHelper->IDCerRFControl(false);
|
|
|
- if (errRf != Error_Succeed)
|
|
|
- {
|
|
|
- Dbg("exec IDCerRFControl(false) failed, force eject...");
|
|
|
- SetErrPackage(m_errPkg, "ReadAndScan::IDCerRFControl", m_devSN, errRf, MEC_DEVAPI_IDCER_IDCerRFControl);
|
|
|
- AlarmDEC(m_errPkg, false);
|
|
|
- m_hDevHelper->ForceIDEject();
|
|
|
- }
|
|
|
+ m_hDevHelper->IDCerRFControl(false); //这里基本不耗时,凯欣达新大机耗时较长(先改我们流程解决,后续需要厂商优化这里)
|
|
|
}
|
|
|
|
|
|
+ //zjw@20191219 处理完相关操作再返回给前端,防止状态还未跳转又发起流程
|
|
|
if (bGetIDCert)
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
else if (m_bCancelRead)
|
|
|
ctx->Answer(Error_Cancel);
|
|
|
else if (elapsed >= IDCER_READ_TIMEOUT) {
|
|
|
ctx->Answer(Error_TimeOut);
|
|
|
+
|
|
|
+ if (ecForIDCerRFControl != Error_Succeed) {
|
|
|
+ SetErrPackage(m_errPkg, "ReadAndScan::IDCerRFControl", m_devSN, ecForIDCerRFControl, MEC_DEVAPI_IDCER_IDCerRFControl);
|
|
|
+ AlarmDEC(m_errPkg);
|
|
|
+ }
|
|
|
+ if (ecForIDCerAuthenticate != Error_Succeed) {
|
|
|
+ SetErrPackage(m_errPkg, "ReadAndScan::IDCerAuthenticate", m_devSN, ecForIDCerAuthenticate, MEC_DEVAPI_IDCER_IDCerAuthenticate);
|
|
|
+ AlarmDEC(m_errPkg);
|
|
|
+ }
|
|
|
}
|
|
|
- else {
|
|
|
+ else if (eErr == Error_DevMedia) {
|
|
|
+ LogWarn(Severity_High, Error_DevMedia, IDCertificate_UserErrorCode_ErrorDevMedia, "Error DevMedia");
|
|
|
+ ctx->Answer(Error_DevMedia);
|
|
|
+ } else {
|
|
|
ctx->Answer(Error_Unexpect);
|
|
|
+
|
|
|
+ if (ecForIDCerRFControl != Error_Succeed) {
|
|
|
+ SetErrPackage(m_errPkg, "ReadAndScan::IDCerRFControl", m_devSN, ecForIDCerRFControl, MEC_DEVAPI_IDCER_IDCerRFControl);
|
|
|
+ AlarmDEC(m_errPkg);
|
|
|
+ }
|
|
|
+ if (ecForIDCerAuthenticate != Error_Succeed) {
|
|
|
+ SetErrPackage(m_errPkg, "ReadAndScan::IDCerAuthenticate", m_devSN, ecForIDCerAuthenticate, MEC_DEVAPI_IDCER_IDCerAuthenticate);
|
|
|
+ AlarmDEC(m_errPkg);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
if (eErr1 == Error_Succeed && pos == 2)
|
|
|
+ {
|
|
|
return 4;
|
|
|
-
|
|
|
- if(m_bCancelRead)
|
|
|
- return 2;
|
|
|
-
|
|
|
- if(bExitWhenReading)
|
|
|
- return 3;
|
|
|
+ }
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -1077,7 +1060,7 @@ ErrorCodeEnum CIDCertFSM::GetPngBlob(CBlob &data, bool bClear)
|
|
|
Dbg("photo changed failed.");
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
-
|
|
|
+ //if (Error == Error_Succeed) {
|
|
|
FILE *fp = fopen(strPngPath, "rb");
|
|
|
if (fp) {
|
|
|
fseek(fp, 0, SEEK_END);
|
|
@@ -1086,10 +1069,13 @@ ErrorCodeEnum CIDCertFSM::GetPngBlob(CBlob &data, bool bClear)
|
|
|
data.Alloc(flen);
|
|
|
fread(data.m_pData, 1, flen, fp);
|
|
|
fclose(fp);
|
|
|
+ //DeleteFileA(strTxtPath);
|
|
|
+ //DeleteFileA(strWltPath);
|
|
|
} else {
|
|
|
LOG_TRACE("fopen %s failed!", (LPCSTR)strPngPath);
|
|
|
err = Error_IO;
|
|
|
}
|
|
|
+ //}
|
|
|
Dbg("After ReadInfo, do clear job.");
|
|
|
|
|
|
if (bClear)
|
|
@@ -1097,7 +1083,6 @@ ErrorCodeEnum CIDCertFSM::GetPngBlob(CBlob &data, bool bClear)
|
|
|
Dbg("After ReadInfo, finish doing clear job.");
|
|
|
return err;
|
|
|
}
|
|
|
-
|
|
|
ErrorCodeEnum CIDCertFSM::GetPngBlobEx(CBlob &data, CSimpleStringA fileNamePrefix, bool bClear)
|
|
|
{
|
|
|
CSimpleStringA strPath;
|
|
@@ -1202,6 +1187,7 @@ int CIDCertFSM::WaitFetchIDCard()
|
|
|
LOG_FUNCTION();
|
|
|
ErrorCodeEnum eErr = Error_Unexpect;
|
|
|
int pos = 99;
|
|
|
+ //DWORD64 dwStart = RVCGetTickCount64();
|
|
|
DWORD64 dwStart = RVCGetTickCount();
|
|
|
DWORD64 dwEnd = 0;
|
|
|
while ((dwEnd - dwStart)< 120 * 1000)//wait for 120 seconds
|
|
@@ -1417,7 +1403,11 @@ int CIDCertFSM::Initial()
|
|
|
|
|
|
GET_DEV_ENTITY_BASE_POINTER()->InitializeVendorLogSwitch();
|
|
|
|
|
|
-
|
|
|
+ if (_strnicmp((const char*)m_csMachineType, "RVC.IL", strlen("RVC.IL")) == 0)
|
|
|
+ {
|
|
|
+ m_bRVCIL = true;
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
m_devState = DEVICE_STATUS_NOT_READY;
|
|
|
|
|
|
CSimpleStringA csLibFullName;
|