123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363 |
- #include "stdafx.h"
- //ILog* g_pLog;
- extern mEnumScannerDevice EnumScannerDevice;
- extern mOpenConnection OpenConnection;
- extern mCloseConnection CloseConnection;
- extern mCheckHaveIdCard CheckHaveIdCard;
- extern mTakeOutIdCard TakeOutIdCard;
- extern mStartScanIdCard StartScanIdCard;
- extern mSavePicToMemory SavePicToMemory;
- extern mSavePicToFile SavePicToFile;
- extern mSavePicToFileII SavePicToFileII;
- extern mRetainIdCard RetainIdCard;
- extern mBackIdCard BackIdCard;
- extern mBackAndHoldIdCard BackAndHoldIdCard;
- extern mGetID2Info GetID2Info;
- extern mGetID2InfoEx GetID2InfoEx;
- extern mGetLastErrorCode GetLastErrorCode;
- extern mGetLastErrorStr GetLastErrorStr;
- extern mGetFWVersion GetFWVersion;
- extern mGetSWVersion GetSWVersion;
- extern mGetDevStatus GetDevStatus;
- extern mResetDevice ResetDevice;
- extern mSoftResetDevice SoftResetDevice;
- extern mUpdateOnLine UpdateOnLine;
- extern mCISCalibrate CISCalibrate;
- extern mSensorCalibrate SensorCalibrate;
- extern mSetButtonEnable SetButtonEnable;
- extern mSetAutoFeedEnable SetAutoFeedEnable;
- extern mSetInitFeedMode SetInitFeedMode;
- extern mSetHeadFileFormat SetHeadFileFormat;
- extern mGetID2InfoFromImage GetID2InfoFromImage;
- extern mGetPassportInfoFromImage GetPassportInfoFromImage;
- extern mBackIdCardToRerec BackIdCardToRerec;
- extern mGetIDInfoForeign GetIDInfoForeign;
- extern mGetIDInfoGAT GetIDInfoGAT;
- extern mGetIDCardType GetIDCardType;
- extern mGetAllTypeIdInfo GetAllTypeIdInfo;
- extern mSetLog SetLog;
- BS_ID81IDCLibImpl::BS_ID81IDCLibImpl(void)
- {
- char cTemp[256] = {0};
- m_bLoadLibRet = load_so(cTemp);
- //LOG4VTM(INFO,("BS_ID81IDCLibImpl creat function()!"));
- if (m_bLoadLibRet == false)
- {
- printf("动态库加载失败!");
- return;
- }
- bool Output = false;
- char LogPath[256] = {0};
- sprintf(LogPath,"./ID81LOG.log");
- int iResult = SetLog(Output,LogPath);
- if (iResult != 0)
- {
- printf("SetLog failed.\n");
- }
- }
- BS_ID81IDCLibImpl::~BS_ID81IDCLibImpl(void)
- {
- Unload_so();
- }
- int BS_ID81IDCLibImpl::EnumScannerDev(ScannerInfoRec *ScannerInfo, unsigned *DeviceNumber)
- {
- if (EnumScannerDevice == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = EnumScannerDevice(ScannerInfo, DeviceNumber);
- return nRet;
- }
- int BS_ID81IDCLibImpl::OpenDev(unsigned DeviceID)
- {
- if (OpenConnection == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = OpenConnection(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::CloseDev(unsigned DeviceID)
- {
- if (CloseConnection == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = CloseConnection(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::CheckIdCard(unsigned DeviceID,int CheckTime)
- {
- if (CheckHaveIdCard == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = CheckHaveIdCard(DeviceID,CheckTime);
- return nRet;
- }
- int BS_ID81IDCLibImpl::CheckCardOut(unsigned DeviceID,int CheckTime)
- {
- if (TakeOutIdCard == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = TakeOutIdCard(DeviceID,CheckTime);
- return nRet;
- }
- int BS_ID81IDCLibImpl::StartScan(unsigned DeviceID)
- {
- if (StartScanIdCard == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = StartScanIdCard(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::ReadCard(unsigned DeviceID, char* cFrontImgBuf,char* cRearImgBuf, int* iFrontLen, int* iRearLen)
- {
- if (SavePicToMemory == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = SavePicToMemory(DeviceID, cFrontImgBuf,cRearImgBuf, iFrontLen, iRearLen);
- return nRet;
- }
- int BS_ID81IDCLibImpl::SaveToFile(unsigned DeviceID, char *cBmpBuf, int iBufLen,char *FileName, int Format)
- {
- if (SavePicToFile == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = SavePicToFile(DeviceID, cBmpBuf, iBufLen,FileName, Format);
- return nRet;
- }
- int BS_ID81IDCLibImpl::RetainCard(unsigned DeviceID)
- {
- if (RetainIdCard == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = RetainIdCard(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::EjectIdCard(unsigned DeviceID)
- {
- if (BackIdCard == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = BackIdCard(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::BackAndHoldCard(unsigned DeviceID)
- {
- if (BackAndHoldIdCard == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = BackAndHoldIdCard(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::LastErrorCode()
- {
- if (GetLastErrorCode == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetLastErrorCode();
- return nRet;
- }
- int BS_ID81IDCLibImpl::LastErrorStr(char* errStr)
- {
- if (GetLastErrorStr == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetLastErrorStr(errStr);
- return nRet;
- }
- int BS_ID81IDCLibImpl::FWVersion(unsigned DeviceID,char *cVersionInfo)
- {
- if (GetFWVersion == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetFWVersion(DeviceID,cVersionInfo);
- return nRet;
- }
- int BS_ID81IDCLibImpl::GetInfo(unsigned DeviceID, IDInfo *mIDInfo, char *ImageName)
- {
- if (GetID2Info == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetID2Info(DeviceID, mIDInfo, ImageName);
- return nRet;
- }
- int BS_ID81IDCLibImpl::ResetDev(unsigned DeviceID)
- {
- if (ResetDevice == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = ResetDevice(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::Update(unsigned DeviceID,char *FileName)
- {
- if (UpdateOnLine == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = UpdateOnLine(DeviceID,FileName);
- return nRet;
- }
- int BS_ID81IDCLibImpl::CIS(unsigned DeviceID)
- {
- if (CISCalibrate == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = CISCalibrate(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::Sensor(unsigned DeviceID)
- {
- if (SensorCalibrate == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = SensorCalibrate(DeviceID);
- return nRet;
- }
- int BS_ID81IDCLibImpl::SWVersion(char *cVersionInfo)
- {
- if (GetSWVersion == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetSWVersion(cVersionInfo);
- return nRet;
- }
- int BS_ID81IDCLibImpl::DeviceStatus(unsigned DeviceID,DEVSTATUS *DevStatus)
- {
- if (GetDevStatus == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetDevStatus(DeviceID,DevStatus);
- return nRet;
- }
- int BS_ID81IDCLibImpl::ResetWithAction(unsigned DeviceID,int iMode)
- {
- if (SoftResetDevice == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = SoftResetDevice(DeviceID,iMode);
- return nRet;
- }
- int BS_ID81IDCLibImpl::GetMyIDCardInfo(unsigned DeviceID,int iCardType,void* idinfo,char* ImageName)
- {
- if (GetAllTypeIdInfo == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetAllTypeIdInfo(DeviceID, iCardType, idinfo, ImageName);
- return nRet;
- }
- int BS_ID81IDCLibImpl::GetMyIDCardType(unsigned DeviceID, int* iCardType)
- {
- if (GetIDCardType == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetIDCardType(DeviceID, iCardType);
- return nRet;
- }
- int BS_ID81IDCLibImpl::GetMyGATIDInfo(unsigned DeviceID, IDInfoGAT* mIDInfoGAT, char *ImageName)
- {
- if (GetIDInfoGAT == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetIDInfoGAT(DeviceID, mIDInfoGAT, ImageName);
- return nRet;
- }
- int BS_ID81IDCLibImpl::GetAllTypeCardInfo(unsigned DeviceID,int iCardType,void* idinfo,char* ImageName)
- {
- if (GetAllTypeIdInfo == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = GetAllTypeIdInfo(DeviceID, iCardType,idinfo, ImageName);
- return nRet;
- }
- int BS_ID81IDCLibImpl::SetIDLog(bool Output, char* LogPath)
- {
- if (SetLog == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = SetLog(Output, LogPath);
- return nRet;
- }
- int BS_ID81IDCLibImpl::SetAutoFeedEnabled(unsigned DeviceID, int nMode)
- {
- if (SetAutoFeedEnable == NULL)
- {
- return IDDIGITALCOPIER_HAVE_NOT_INIT;
- }
- int nRet = SetAutoFeedEnable(DeviceID, nMode);
- return nRet;
- }
|