|
@@ -91,9 +91,7 @@ struct ImgChekTask : ITaskSp
|
|
|
CSimpleStringA inIdType;
|
|
|
|
|
|
void Process()
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ImgChekTask Process");
|
|
|
-
|
|
|
+ {
|
|
|
CSystemStaticInfo si;
|
|
|
m_fsm->GetEntityBase()->GetFunction()->GetSystemStaticInfo(si);
|
|
|
IHttpFunc* client;
|
|
@@ -145,7 +143,6 @@ struct ImgChekTask : ITaskSp
|
|
|
|
|
|
CSimpleStringA errMsg;
|
|
|
if (ret) {
|
|
|
- //Dbg("图片检测成功---");
|
|
|
if (imgCheckRet.m_success != true)
|
|
|
{
|
|
|
errMsg = CSimpleStringA::Format("图片检测不通过,result_data:%s.", imgCheckRet.m_resultData.c_str());
|
|
@@ -786,8 +783,6 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
DevErrorInfo devErrInfo;
|
|
|
m_hDevHelper->GetLastErr(devErrInfo);
|
|
|
#endif
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(m_ullEndTime - m_ullBeginTime)
|
|
|
- .setResultCode("RTA2107")("IDCerAuthenticate failed %d.", errAuth);
|
|
|
dwEnd = SP::Module::Comm::RVCGetTickCount();
|
|
|
elapsed = dwEnd - dwStart;
|
|
|
continue;
|
|
@@ -841,7 +836,6 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
{
|
|
|
if (ctx->Ans.idcode[ctx->Ans.idcode.GetLength() - 1] == 'x')
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("x to X");
|
|
|
ctx->Ans.idcode[ctx->Ans.idcode.GetLength() - 1] = 'X';
|
|
|
}
|
|
|
}
|
|
@@ -895,7 +889,6 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
{
|
|
|
if (ctx->Ans.idcode[ctx->Ans.idcode.GetLength() - 1] == 'x')
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("x to X");
|
|
|
ctx->Ans.idcode[ctx->Ans.idcode.GetLength() - 1] = 'X';
|
|
|
}
|
|
|
}
|
|
@@ -1008,16 +1001,16 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
|
|
|
setResultCode(std::to_string((_Longlong)errRF).c_str())
|
|
|
("ReadAndScan::IDCerRFControl failed with errcode: %d", errRF);
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
- if(!m_bExit && bOpenRF && !bIDCerAuthenticate)
|
|
|
+ if (!m_bExit && bOpenRF && !bIDCerAuthenticate)
|
|
|
{
|
|
|
SetErrPackage("ReadAndScan::IDCerAuthenticate", m_devSN, errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate);
|
|
|
AlarmDEC();
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).
|
|
|
- setResultCode(std::to_string((_Longlong)errAuth).c_str())
|
|
|
+ setResultCode("RTA2107")
|
|
|
("ReadAndScan::IDCerAuthenticate failed with errcode: %d", errAuth);
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
m_bExit = false;
|
|
|
m_bReading = false;
|
|
@@ -1197,7 +1190,6 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
if (supportUCS2 == FALSE)
|
|
|
{
|
|
|
ctx->Ans.msgtype = 0;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("supportUCS2 = %d, 厂商不支持生僻字接口。", supportUCS2);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
return 0;
|
|
|
}
|
|
@@ -1293,11 +1285,6 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DevErrorInfo devErrInfo;
|
|
|
m_hDevHelper->GetLastErr(devErrInfo);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(m_ullEndTime - m_ullBeginTime)
|
|
|
- .setResultCode("RTA2107")("IDCerAuthenticate failed %d,%s.", errAuth, devErrInfo.szErrMsg);
|
|
|
-#else
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(m_ullEndTime - m_ullBeginTime)
|
|
|
- ("IDCerAuthenticate failed: %s", SpStrError(ecForIDCerAuthenticate));
|
|
|
#endif
|
|
|
dwEnd = SP::Module::Comm::RVCGetTickCount();
|
|
|
elapsed = dwEnd - dwStart;
|
|
@@ -1316,13 +1303,11 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
if (errReadEx2 == Error_NotImpl)
|
|
|
{
|
|
|
ctx->Ans.msgtype = 0; //旧字段传递,GBK、字符串传递文字信息
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("厂商不支持新接口,请调用旧接口。");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
ctx->Ans.msgtype = 1; //新字段传递,UTF8、二进制传递文字信息
|
|
|
//ex2数据读取功能代码、UCS2转UTF8代码
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("使用新字段。");
|
|
|
bInvokeReadEx2 = true;
|
|
|
if (errReadEx2 != Error_Succeed)
|
|
|
{
|
|
@@ -1378,9 +1363,6 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
RemoveUCS2Blank((UINT16*)idInfoEx2.reserved.data); //外国人永居证旧证件关联字段
|
|
|
RemoveUCS2Blank((UINT16*)idInfoEx2.reserved2.data); //英文名备用字段
|
|
|
RemoveUCS2Blank((UINT16*)idInfoEx2.issuedSN.data); //换证次数
|
|
|
-
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("已去除首尾空格");
|
|
|
-
|
|
|
#ifdef RVC_OS_WIN
|
|
|
//转换成GBK用于debug上传
|
|
|
char* tSex = new char[32];
|
|
@@ -1470,8 +1452,6 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
UCS2_to_UTF8((UINT16*)idInfoEx2.reserved2.data, englishNameEx);
|
|
|
UCS2_to_UTF8((UINT16*)idInfoEx2.issuedSN.data, IssuedSN);
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("已转换成utf8");
|
|
|
-
|
|
|
ctx->Ans.name_utf8.Alloc(strlen((char*)name));
|
|
|
ctx->Ans.sex_utf8.Alloc(strlen((char*)sex));
|
|
|
ctx->Ans.nation_utf8.Alloc(strlen((char*)nation));
|
|
@@ -1504,8 +1484,6 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
memcpy(ctx->Ans.reserved_utf8.m_pData, reserved, strlen((char*)reserved)); //新外国人永居证关联字段
|
|
|
memcpy(ctx->Ans.othercode_utf8.m_pData, englishNameEx, strlen((char*)englishNameEx)); //英文名备用字段
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("已传递接口字段。");
|
|
|
-
|
|
|
m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
|
|
|
eErr = m_hDevHelper->ScanIDAndSaveImage();
|
|
|
m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
|
|
@@ -1608,16 +1586,15 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
.setResultCode(std::to_string((_Longlong)errRF).c_str())
|
|
|
("ReadAndScanUTF8::IDCerRFControl failed with errcode: %d", errRF);
|
|
|
}
|
|
|
-
|
|
|
+#endif
|
|
|
if (!m_bExit && bOpenRF && !bIDCerAuthenticate)
|
|
|
{
|
|
|
SetErrPackage("ReadAndScanUTF8::IDCerAuthenticate", m_devSN, errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate);
|
|
|
AlarmDEC();
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)
|
|
|
- .setResultCode(std::to_string((_Longlong)errAuth).c_str())
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).
|
|
|
+ setResultCode("RTA2107")
|
|
|
("ReadAndScanUTF8::IDCerAuthenticate failed with errcode: %d", errAuth);
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
m_bExit = false;
|
|
|
m_bReading = false;
|
|
@@ -2170,19 +2147,16 @@ int CIDCertFSM::Initial() //windows ver
|
|
|
CSimpleStringA szMod(m_devCatInfo.szModel);
|
|
|
if (strstr(m_devCatInfo.szModel, "CODE=UCS2") != NULL)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("UCS2新库。");
|
|
|
supportUCS2 = TRUE;
|
|
|
}
|
|
|
|
|
|
if (strstr(m_devCatInfo.szModel, "STYLE=IG") != NULL)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("吸入式设备");
|
|
|
igestionVer = TRUE;
|
|
|
}
|
|
|
|
|
|
if (strstr(m_devCatInfo.szModel, "FUNCTION=ITFY") != NULL)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("支持新版外国人永居证");
|
|
|
supportNewForeigner = TRUE;
|
|
|
}
|
|
|
|
|
@@ -2238,7 +2212,6 @@ int CIDCertFSM::Initial() //linux ver
|
|
|
m_devState = DEVICE_STATUS_NOT_READY;
|
|
|
|
|
|
CSimpleStringA csLibFullName;
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("To extra vendor lib file path...");
|
|
|
ErrorCodeEnum err = pEntity->ExtractVendorLibFullPath(csLibFullName);
|
|
|
if (err != Error_Succeed)
|
|
|
{
|
|
@@ -2247,7 +2220,6 @@ int CIDCertFSM::Initial() //linux ver
|
|
|
}
|
|
|
LogWarn(Severity_Low, Error_Unexpect, IDCertificate_UserErrorCode_RootInfo, csLibFullName.GetData());
|
|
|
m_adapterInfo.adapterFilePath = csLibFullName;
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("To load up vendor lib...");
|
|
|
err = m_hDevHelper.LoadUp(csLibFullName);
|
|
|
if (err != Error_Succeed)
|
|
|
{
|
|
@@ -2344,19 +2316,16 @@ int CIDCertFSM::Initial() //linux ver
|
|
|
CSimpleStringA szMod(m_devCatInfo.szModel);
|
|
|
if (strstr(m_devCatInfo.szModel, "CODE=UCS2") != NULL)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("UCS2新库。");
|
|
|
supportUCS2 = TRUE;
|
|
|
}
|
|
|
|
|
|
if (strstr(m_devCatInfo.szModel, "STYLE=IG") != NULL)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("吸入式设备");
|
|
|
igestionVer = TRUE;
|
|
|
}
|
|
|
|
|
|
if (strstr(m_devCatInfo.szModel, "FUNCTION=ITFY") != NULL)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("支持新版外国人永居证");
|
|
|
supportNewForeigner = TRUE;
|
|
|
}
|
|
|
|
|
@@ -2536,8 +2505,6 @@ BOOL CIDCertFSM::GetSexUTF8String(UINT16* in, UINT8* out)
|
|
|
break;
|
|
|
}
|
|
|
#endif
|
|
|
-
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("性别代码映射成功");
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -2564,7 +2531,6 @@ BOOL CIDCertFSM::GetNationalUTF8String(UINT16* in, UINT8* out)
|
|
|
UCS2_to_UTF8(in, nationIn); //linux默认编码就是utf8,转成utf8格式后直接就是linux下的char类型
|
|
|
|
|
|
int nCode = atoi((char*)nationIn); //直接转成数字
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("民族编码转换成数字atoi成功。结果为%ld.", nCode);
|
|
|
if (nCode >= 1 && nCode <= 56)
|
|
|
{
|
|
|
//linux默认编码就是utf8,直接拷贝
|
|
@@ -2575,8 +2541,6 @@ BOOL CIDCertFSM::GetNationalUTF8String(UINT16* in, UINT8* out)
|
|
|
UCS2_to_UTF8(in, out);
|
|
|
}
|
|
|
#endif
|
|
|
-
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("民族代码映射成功");
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -2604,7 +2568,6 @@ BOOL CIDCertFSM::GetDateStandardFormatUTF8(UINT16* in, UINT8* out)
|
|
|
int cmp = strcmp((char*)ltimeCheck, (char*)ltimeIn); //判断长期证件
|
|
|
if (cmp == 0)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("长期身份证,转换日期为9999/12/31");
|
|
|
#ifdef RVC_OS_WIN
|
|
|
wstring time = L"9999/12/31";
|
|
|
UCS2_to_UTF8((UINT16*)time.c_str(), out);
|
|
@@ -2640,7 +2603,6 @@ BOOL CIDCertFSM::GetDateStandardFormatUTF8(UINT16* in, UINT8* out)
|
|
|
//*p2 = '\0';
|
|
|
|
|
|
UCS2_to_UTF8(trans, out);
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("日期格式转换成功!");
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -2704,7 +2666,7 @@ void CIDCertFSM::CheckHanZi(UINT16* ucs2_code)
|
|
|
{
|
|
|
if (*tmp >= 0x4e00 && *tmp <= 0x9fa5)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("是汉字。");
|
|
|
+ //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("是汉字。");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2728,6 +2690,6 @@ void CIDCertFSM::CheckHanZi(UINT16* ucs2_code)
|
|
|
#ifdef RVC_OS_WIN
|
|
|
void CIDCertFSM::HttpsLogCallBack(const char* logtxt)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("%s", logtxt);
|
|
|
+ //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("%s", logtxt);
|
|
|
}
|
|
|
#endif
|