| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- #pragma once
- #ifndef IDCERTIFICATE_H
- #define IDCERTIFICATE_H
- //#pragma pack(push,1)
- #include "IDCerClass.h"
- #include "stdafx.h"
- #pragma pack(push,1)
- class IDCerClassImpl : public IDCerClass
- {
- public:
- IDCerClassImpl();
- ~IDCerClassImpl();
- //
- // Open device.
- // if usb device,set dwPort=0
- //
- virtual ErrorCodeEnum DevOpen(DWORD dwPort);
- //
- // Optional.
- // Open or close RF.
- // Arguments:
- // - bControl:true:open RF,false close RF
- // - 对于吸入式,为true接收身份证插入,为false时弹出身份证
- //
- virtual ErrorCodeEnum IDCerRFControl(bool bControl);
- //
- // Optional.
- // Certificate authentication.
- //
- virtual ErrorCodeEnum IDCerAuthenticate();
- // 即将废弃,请使用IDCerGetDataEx
- // Get Identity Card info.
- //
- virtual ErrorCodeEnum IDCerGetData(IDCerInfo &idCerInfo);
- // 获取证件信息,包括二代身份证、外国人永久居留证
- // Get Identity Card info.
- //
- virtual ErrorCodeEnum IDCerGetDataEx(IDCerInfoEx &idCerInfoEx);
- // 强制弹出身份证等证件
- // Force ID Card to eject。
- //
- virtual ErrorCodeEnum ForceIDEject();
- // 扫描证件并保留扫描文件到默认路径(dep目录下),证件正面使用“idfront.bmp”,证件反面使用“idback.bmp”
- // Scan ID Card and save the image to the position(dep/),using default name "idfront.bmp" and "idback.bmp"。
- //
- virtual ErrorCodeEnum ScanIDAndSaveImage();
- // 获取卡片是否插入或者取走
- // Query if ID Card have been inserted or fetched。
- // pos:
- // -- 0,未检测到任何证件;1,证件在读卡器内部;2,证件在进卡口
- //
- virtual ErrorCodeEnum QueryCardPos(int &pos);
- //
- // Get category infomation about device.
- //
- virtual ErrorCodeEnum GetDevCategory(DevCategoryInfo &devCategory);
- // Reset device.
- // Do the cleaning work and initialize device again in order to return to
- // the normal condition.
- virtual ErrorCodeEnum Reset();
- //
- // Close device and do the cleaning work.
- // ex. close connection,close port,release memery and so on
- virtual ErrorCodeEnum DevClose();
- // Get last error the device issued.
- // Error message must include explanatory memorandum ,the original error
- // code and anything in favour of location problem.
- virtual ErrorCodeEnum GetLastErr(DevErrorInfo &devErrInfo);
- private:
- bool m_bDevOpen;
- WORD m_wDevStatus;
- CHAR m_szErrMsg[MAX_DEV_ERROR_MSG_LEN];
- void SaveErrorInfo(CHAR* errMsg, int errCode=95555);
- bool SH_DeleteFileOrDirectory(char *strFileName);
- public:
- ErrorCodeEnum OnCheckCard();
- /*std::string m_LogFileNamePath;
- int m_nLogLevel;*/
- bool m_bAuthed; // true:认证成功;
- int m_iCardType; // 认证成功后,卡的类型;
- protected:
- BS_ID81IDCLibImpl m_cBS_ID81IDCImpl;
- unsigned SecDeviceNum;
- DEVSTATUS Devstatus;
- IDInfo m_IDInfo; //二代证身份证信息
- IDInfoForeign m_IDForeignInfo; //外国人证件信息
- IDInfoEx m_IDInfoEx;
- //---------2019-07-16---广电库,增加支持港澳台;---------
- IDInfoGAT m_IDInfoGAT; //港澳台
- /*
- std::string m_LogFileNamePath;
- int m_nLogLevel;
- ILog* m_pLog;
- ILevelLog* m_pLevelLog;
- IIniFile* m_pIniFile;
- */
- private:
- int string_format(std::string &str, const std::string fmt, ...);
- std::string& trim(std::string &s, std::string patten = " \n\r\t");
- };
- ErrorCodeEnum CreateDevComponent(DeviceBaseClass *&pBaseObj);
- ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass *&pBaseObj);
- #endif // IDCERTIFICATE_H
- #pragma pack(pop)
|