123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #ifndef LIBFRAMEWORK_IDCER_IMPL_H
- #define LIBFRAMEWORK_IDCER_IMPL_H
- #include "IDCerClass.h"
- #include <string>
- class IDCerClassImpl : public IDCerClass
- {
- public:
- IDCerClassImpl();
- ~IDCerClassImpl();
- //DeviceBaseClass
- //
- // Get category infomation about device.
- //
- ErrorCodeEnum GetDevCategory(DevCategoryInfo &devCategory);
- // Reset device.
- // Do the cleaning work and initialize device again in order to return to
- // the normal condition.
- ErrorCodeEnum Reset();
- //
- // Close device and do the cleaning work.
- // ex. close connection,close port,release memery and so on
- 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.
- ErrorCodeEnum GetLastErr(DevErrorInfo &devErrInfo);
- //IDCerClass
- //
- // Open device.
- // if usb device,set dwPort=0
- //
- ErrorCodeEnum DevOpen(DWORD dwPort);
- //
- // Optional.
- // Open or close RF.
- // Arguments:
- // - bControl:true:open RF,false close RF
- // - 对于吸入式,为true接收身份证插入,为false时弹出身份证并关闭接收身份证插入
- //
- ErrorCodeEnum IDCerRFControl(bool bControl);
- //
- // Optional.
- // Certificate authentication.
- //
- ErrorCodeEnum IDCerAuthenticate();
- // 即将废弃,请使用IDCerGetDataEx
- // Get Identity Card info.
- //
- ErrorCodeEnum IDCerGetData(IDCerInfo &idCerInfo);
- // 获取证件信息,包括二代身份证、外国人永久居留证
- // Get Identity Card info.
- //
- ErrorCodeEnum IDCerGetDataEx(IDCerInfoEx &idCerInfoEx);
- //新增身份证信息获取接口,用于获取身份证中存储的原始文字UCS2编码信息
- ErrorCodeEnum IDCerGetDataEx2(IDCerInfoEx2 &idCerInfoEx);
- // 强制弹出身份证等证件
- // Force ID Card to eject。
- //
- 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"。
- //
- ErrorCodeEnum ScanIDAndSaveImage();
- // 获取卡片是否插入或者取走
- // Query if ID Card have been inserted or fetched。
- // pos:
- // -- 0,未检测到任何证件;1,证件在读卡器内部;2,证件在进卡口
- //
- ErrorCodeEnum QueryCardPos(int &pos);
- private:
- DWORD m_DeviceID;
- DevErrorInfo m_DevErrorInfo;
- std::string m_sSoPath;
- std::string m_sHeadImageName;
- std::string m_sFrontPath;
- std::string m_sBackPath;
-
- private:
- void ZeroDevErrorInfo(void);
- void FormatDevErrorInfo(const char* funcname,int line);
- std::string ForDataFormat(std::string str, std::string frm);
- std::string GetForeignTimeLimit(std::string time_, std::string format_);
- std::string GeSoFilePath(void* Fun);
- int GbkToUtf8(char *str_str, size_t src_len, char *dst_str, size_t dst_len);
- };
- extern ErrorCodeEnum CreateDevComponent(DeviceBaseClass *&baseObj);
- extern ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass *&pBaseObj);
- #endif //LIBFRAMEWORK_IDCER_IMPL_H
|