<nav id="ccccc"><sup id="ccccc"></sup></nav>
  • <nav id="ccccc"></nav>
    <nav id="ccccc"></nav>
    <sup id="ccccc"></sup><tr id="ccccc"></tr>
  • <tfoot id="ccccc"><noscript id="ccccc"></noscript></tfoot>
  • 影音先锋成人,人妻偷人精品,成人网站中文字幕,,国产乱人伦无码视频,激情婷婷五月天,69avav?cn,国产成人A码男人的天堂国产乱,人妻?无码?中出

    DONSEE東信智能 - 身份證社保卡讀卡智能終端應用服務商

    eastcoms@qq.com
    400-6722-705
    首頁 > 服務支持專區 > 產品支持 > SDK二次開發包和軟件下載

    EST系列身份證讀卡器Linux串口COM系列SDK開發包(含libwlt2bmp.so身份證照片解碼庫)

    來源:www.www.57bjl.cn   標簽:Linux 串口 COM SDK 身份證 照片解碼 相片解碼 libwlt2bmp   發布時間: 2018-11-7 10:20:18

    此SDK為廣東東信智能科技有限公司Linux串口系列身份證閱讀器,支持Linux相片解碼以及獲取身份證文字信息,另外還包括了非接IC卡、M1卡、CPU等卡的讀取指令,含Linux系統libwlt2bmp.so相片解碼庫。

    廣東東信智能科技有限公司EST系列身份證讀卡器Linux串口COM系列SDK開發包

    廣東東信智能科技有限公司EST系列身份證讀卡器Linux串口COM系列SDK開發包

    版本:V2018.11.07

    相片解碼說明:

    #ifndef _dev_serial_H

    #define _dev_serial_H

    #define IC_UnConnect -1001 /*設備通訊超時*/

    #define NoOpenCom        -120   /* 串口沒打開*/

    #define SendDataError    -121   /* 發送數據失敗*/

    #define TermParaError    -122/* 終端參數錯*/

    #define TermTypeError    -123   /* 終端類型錯誤*/

    #define RevTimeOut       -101/* 接收數據超時*/

    #define IFD_SendAgain -40           /*如果返回此錯誤,需重發數據*/

    #define IFD_TypeA_Find_Error -28/*TYPE A尋卡錯誤*/

    #define IFD_TypeA_MoreCard_Error -27/*TYPE A檢測到多張卡片*/

    #define IFD_TypeA_Anticoll_Error -26/*TYPE A防碰撞錯誤*/

    #define IFD_TypeA_Select_Error -25/*TYPE A選卡錯誤*/

    #define IFD_TypeA_RATS_Error -24/*TYPE A RATS錯誤*/

    #define IFD_M1_Auth_Error -23/*Mifare one Auth錯誤*/

    #define IFD_TypeB_Find_Error -22/*TYPE B尋卡錯誤*/

    #define IFD_TypeB_attrib_Error -21/*TYPE B attrib錯誤*/

    /*狀態碼*/

    #define IFD_OK0 /*執行成功*/

    #define IFD_ICC_TypeError-1 /*卡片類型不對*/

    #define IFD_ICC_NoExist-2 /*無卡*/

    #define IFD_ICC_NoPower-3 /*有卡未上電*/

    #define IFD_ICC_NoResponse-4     /*卡片無應答*/

    #define IFD_ConnectError-11     /*讀卡器連接錯*/

    #define IFD_UnConnected-12         /*未建立連接(沒有執行打開設備函數)*/

    #define IFD_BadCommand-13         /*(動態庫)不支持該命令*/

    #define IFD_ParameterError-14     /*(發給動態庫的)命令參數錯*/

    #define IFD_CheckSumError-15     /*信息校驗和出錯*/

    #ifdef __cplusplus

    extern "C" {

    #endif

    /******************************************************************************************************************************************\

    \   /

    /身份證   \

    \   /

    \******************************************************************************************************************************************/

    /*****************************************

    * 功能: 讀取證件(居民身份證 + 外國人永久居留證 + 港澳臺居民居住證)

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    * 返回值: 

    *成功返回0,執行成功后可調用下列get函數獲取相應的信息

    ***********************************************************************/

    long PICC_ReadIDCard(long ReaderHandle);

    /*****************************************

    * 功能: 讀取證件,包含指紋(居民身份證 + 外國人永久居留證 + 港澳臺居民居住證)

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    * 返回值: 

    *成功返回0,執行成功后可調用下列get函數獲取相應的信息

    ***********************************************************************/

    long PICC_ReadIDCardFP(long ReaderHandle);

    /*****************************************

    * 功能: 獲取證件類型

    * 參數: 

    *

    * 返回值: 

    *0:表示居民身份證

    *1:表示外國人永久居留證

    *2:表示港澳臺居民居住證

    *****************************************/

    int GetCardType();

    /*****************************************

    * 功能: 獲取姓名

    * 參數: 

    *pName: [OUT] 姓名

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、1、2

    *****************************************/

    int GetName(char* pName);

    /*****************************************

    * 功能: 獲取性別

    * 參數: 

    *pSex: [OUT] 性別

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、1、2

    *****************************************/

    int GetSex(char* pSex);

    /*****************************************

    * 功能: 獲取民族

    * 參數: 

    *pNation: [OUT] 民族

    * 返回值: 

    *成功返回0

    * 包含證件類型:0

    *****************************************/

    int GetNation(char* pNation);

    /*****************************************

    * 功能: 獲取出生日期

    * 參數: 

    *pBirth: [OUT] 出生日期

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、1、2

    *****************************************/

    int GetBirth(char* pBirth);

    /*****************************************

    * 功能: 獲取住址

    * 參數: 

    *pAddress: [OUT] 住址

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、2

    *****************************************/

    int GetAddress(char* pAddress);

    /*****************************************

    * 功能: 獲取證件號碼

    * 參數: 

    *pCertNo: [OUT] 證件號碼

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、1、2

    *****************************************/

    int GetCertNo(char* pCertNo);

    /*****************************************

    * 功能: 獲取簽發機關

    * 參數: 

    *pDepartemt: [OUT] 簽發機關

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、2

    *****************************************/

    int GetDepartemt(char* pDepartemt);

    /*****************************************

    * 功能: 獲取有效起始日期

    * 參數: 

    *pEffectDate: [OUT] 有效起始日期

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、1、2

    *****************************************/

    int GetEffectDate(char* pEffectDate);

    /*****************************************

    * 功能: 獲取有效截止日期

    * 參數: 

    *pExpireDate: [OUT] 有效截止日期

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、1、2

    *****************************************/

    int GetExpireDate(char* pExpireDate);

    /*****************************************

    * 功能: 獲取通行證號碼

    * 參數: 

    *pTXZHM: [OUT] 通行證號碼

    * 返回值: 

    *成功返回0

    * 包含證件類型:2

    *****************************************/

    int GetTXZHM(char* pTXZHM);

    /*****************************************

    * 功能: 獲取通行證簽發次數

    * 參數: 

    *pTXZQFCS: [OUT] 通行證簽發次數

    * 返回值: 

    *成功返回0

    * 包含證件類型:2

    *****************************************/

    int GetTXZQFCS(char* pTXZQFCS);

    /*****************************************

    * 功能: 獲取英文名

    * 參數: 

    *pEnName: [OUT] 外國人英文名

    * 返回值: 

    *成功返回0

    * 包含證件類型:1

    *****************************************/

    int GetEnName(char* pEnName);

    /*****************************************

    * 功能: 獲取國籍代碼

    * 參數: 

    *pNationalityCode: [OUT] 外國人國籍代碼

    * 返回值: 

    *成功返回0

    * 包含證件類型:1

    *****************************************/

    int GetNationalityCode(char* pNationalityCode);

    /*****************************************

    * 功能: 獲取證件版本

    * 參數: 

    *pCardVersion: [OUT] 外國人居留證證件版本

    * 返回值: 

    *成功返回0

    * 包含證件類型:1

    *****************************************/

    int GetCardVersion(char* pCardVersion);

    /*****************************************

    * 功能: 獲取照片

    * 參數: 

    *dlpath: [IN] so路徑, 例如:"../lib/libwltdecode.so"

    *pBmpfilepath: [IN] 照片路徑, 例如:"../list/zp.bmp"

    * 返回值: 

    *成功返回0

    * 包含證件類型:0、1、2

    *****************************************/

    int GetBmpFile(const char* dlpath, char* pBmpfilepath);

    /*****************************************

    * 功能: 是否含指紋信息

    * 參數: 

    *

    * 返回值: 

    *成功返回指紋數據長度,0表示沒有

    * 包含證件類型:0、1、2

    *****************************************/

    int IsFingerExist();

    /*****************************************

    * 功能: 獲取指紋信息

    * 參數: 

    *fpInfo: [OUT] 指紋數據

    * 返回值: 

    *成功返回獲取到的指紋數據長度,0表示沒有

    * 包含證件類型:0、1、2

    *****************************************/

    int GetFingerprint(unsigned char* fpInfo);

    /******************************************************************************************************************************************\

    \   /

    /設備類   \

    \   /

    \******************************************************************************************************************************************/

    /*****************************************

    * 功能:連接讀卡器 

    * 參數: 

    *comm:[IN] 串口號,例如"/dev/ttyS3"  

    * 返回值: 

    *返回大于0的設備句柄 

    ******************************************/

    long ICC_Reader_Open(char * comm);

    /*****************************************

    * 功能:斷開讀卡器連接

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    * 返回值: 

    *成功返回0

    ***************************************************************/

    long ICC_Reader_Close(long ReaderHandle);

    /*****************************************

    * 功能: 蜂鳴 

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *timeout: [IN] 超時時間,固定為5

    * 返回值: 

    *成功返回0 

    ******************************************/

    long ICC_PosBeep(long ReaderHandle, unsigned char timeout);

    /******************************************************************************************************************************************\

    \   /

    /接CPU   \

    \   /

    \******************************************************************************************************************************************/

    /*****************************************

    * 功能: 接觸CPU卡上電(冷復位)

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *ICC_Slot_No:[IN] 卡座號 0x01(大卡座),0x11~0x14(SAM1~SAM4)

    *Response:[OUT] ATR

    * 返回值: 

    *成功返回數據長度

    ***************************************************************/

    long ICC_Reader_pre_PowerOn(long ReaderHandle, unsigned char ICC_Slot_No, unsigned char* Response);

    /*****************************************

    * 功能: 接觸CPU卡下電

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *ICC_Slot_No:[IN] 卡座號 0x01(大卡座),0x11~0x14(SAM1~SAM4)

    * 返回值: 

    *成功返回0

    ***************************************************************/

    long ICC_Reader_PowerOff(long ReaderHandle,unsigned char ICC_Slot_No);

    /*****************************************

    * 功能: 接觸CPU卡執行APDU命令

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *ICC_Slot_No:[IN] 卡座號 0x01(大卡座),0x11~0x14(SAM1~SAM4)

    *Lenth_of_Command_APDU: [IN] APDU命令的長度

    *Command_APDU:[IN] APDU命令

    *Response_APDU: [OUT] 響應信息

    * 返回值: 

    *成功返回響應信息數據的長度

    ***************************************************************/

    long ICC_Reader_Application(long ReaderHandle,unsigned char ICC_Slot_No, long Lenth_of_Command_APDU,unsigned char* Command_APDU,unsigned char* Response_APDU);  

    /******************************************************************************************************************************************\

    \   /

    /非接類   \

    \   /

    \******************************************************************************************************************************************/

    /*****************************************

    * 功能: 獲取卡片UID(M1 & TypeA)

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *UID: [OUT] 4字節UID

    * 返回值: 

    *成功返回0

    ***************************************************************/

    long PICC_Reader_GetUID(long fd,unsigned char* UID);

    /*****************************************

    * 功能: M1卡認證秘鑰

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *Mode: [IN] 0x60 表示認證KeyA, 0x61表示認證KeyB

    *SecNr:[IN] 扇區號 S50系列卡 0~15, S70系列卡 0~63

    *Key: [IN] 6字節秘鑰

    * 返回值: 

    *成功返回0

    ***************************************************************/

    long PICC_Reader_Authentication_Pass(long ReaderHandle,unsigned char Mode, unsigned char SecNr,unsigned char *Key);

    /*****************************************

    * 功能: M1讀卡

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *Addr:[IN] 塊地址 S50系列卡 0~63, S70系列卡 0~255, 例如:1扇區1塊,這里Addr=5=1*4 + 1(扇區號*4 + 塊號)

    *Data:[OUT] 16字節塊數據

    * 返回值: 

    *成功返回0

    *****************************************************************************************************************/

    long PICC_Reader_Read(long ReaderHandle,unsigned char Addr,unsigned char *Data);

    /*****************************************

    * 功能: M1寫卡

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *Addr:[IN] 塊地址 S50系列卡 0~63, S70系列卡 0~255, 例如:1扇區1塊,這里Addr=5=1*4 + 1(扇區號*4 + 塊號)

    *Data: [IN] 16字節待寫入數據

    * 返回值: 

    *成功返回0

    ***************************************************************************************************************/

    long PICC_Reader_Write(long ReaderHandle,unsigned char Addr,unsigned char *Data);

    /*****************************************

    * 功能: TypeA卡上電

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *Response: [OUT] 上電返回數據

    * 返回值: 

    *成功返回數據長度

    ***************************************************************/

    long PICC_Reader_PowerOnTypeA(long ReaderHandle,unsigned char* Response);

    /*****************************************

    * 功能: TypeB卡上電

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *Response: [OUT] 上電返回數據

    * 返回值: 

    *成功返回數據長度

    ***************************************************************/

    long PICC_Reader_PowerOnTypeB(long ReaderHandle,unsigned char* Response);

    /*****************************************

    * 功能: TypeA & B 卡執行APDU命令

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *Lenth_of_Command_APDU: [IN] APDU命令的長度

    *Command_APDU:[IN] APDU命令

    *Response_APDU: [OUT] 響應信息

    * 返回值: 

    *成功返回響應信息數據的長度

    ***************************************************************/

    long PICC_Reader_Application(long ReaderHandle,long Lenth_of_Command_APDU,unsigned char* Command_APDU,unsigned char* Response_APDU);

    /******************************************************************************************************************************************\

    \   /

    /磁條卡   \

    \   /

    \******************************************************************************************************************************************/

    /*****************************************

    * 功能: 讀磁條卡

    * 參數: 

    *ReaderHandle:[IN] 執行ICC_Reader_Open 函數成功時的返回值

    *ctime:[IN] 等待刷卡的超時時間,單位:秒

    *track:[IN] 磁道 1~3

    *rlen: [OUT] 返回的磁道數據長度

    *Data: [OUT] 返回的磁道數據

    * 返回值: 

    *成功返回0

    ****************************************************************/

    long Rcard(long ReaderHandle,unsigned char ctime,int track,unsigned char *rlen,char *Data);

    #ifdef __cplusplus

    }

    #endif

    #endif

    #include "../inc/dev_serial.h"

    #include <string.h>

    #include <stdio.h>

    static long handle;

    static void printchar(char ch, int len)

    {

    while(len--)

    {

    printf("%c", ch);

    }

    printf("\n");

    }

    static void printchar_txt(char ch, char *pText)

    {

    printf("%c\t%s\n", ch, pText);

    }

    static void printByteArray(char *Tag, unsigned char *pSrc, int ilen)

    {

    inti = 0;

    printf( "%s", Tag );

    while( i<ilen )

    {

    printf( "%02X ", pSrc[i] );

    i++;

    }

    printf( "\n" );

    }

    static void ShowToEdit(const char* tag, const char* msg)

    {

    printf( "%s\t%s\n", tag, msg );

    }

    static void CertCard_Test()

    {

    intnRt, i;

    char pName[50]={0};

    char pSex[10]={0};

    char pNation[10]={0};

    char pBirth[50]={0};

    char pAddress[100]={0};

    char pCertNo[50]={0};

    char pDepartment[100]={0};

    char pEffectData[50]={0};

    char pExpire[20]={0};

    char pErrMsg[50]={0};

    char pEnName[150] = { 0 };

    char pEnNation[50] = { 0 };

    char pAuthorCode[150] = { 0 };

    char pCardVersion[150] = { 0 };

    char pTXZHM[50] = { 0 };

    char pTXZQFCS[10] = { 0 };

    nRt = PICC_ReadIDCard(handle);

    if ( nRt != 0 )

    {

    printf( "ReadCertCard fail! nRet=%d\n", nRt );

    return;

    }

    if(GetCardType() == 0)

    {

    GetName(pName);

    GetSex(pSex);

    GetNation(pNation);

    GetBirth(pBirth);

    GetAddress(pAddress);

    GetCertNo(pCertNo);

    GetDepartemt(pDepartment);

    GetEffectDate(pEffectData);

    GetExpireDate(pExpire);

    ShowToEdit( "姓名:", (pName));

    ShowToEdit( "性別:", (pSex));

    ShowToEdit( "民族:", (pNation));

    ShowToEdit( "出生日期:", (pBirth));

    ShowToEdit( "地址:", (pAddress));

    ShowToEdit( "身份證號:", (pCertNo));

    ShowToEdit( "簽發機關:", (pDepartment));

    ShowToEdit( "有效起始日期:", (pEffectData));

    ShowToEdit( "有效截止日期:", (pExpire));

    }

    if(GetCardType() == 1)

    {

    GetName(pName);

    GetEnName(pEnName);

    GetSex(pSex);

    GetNationalityCode(pEnNation);

    GetBirth(pBirth);

    GetCertNo(pCertNo);

    GetEffectDate(pEffectData);

    GetExpireDate(pExpire);

    GetCardVersion(pCardVersion);

    ShowToEdit( "中文姓名:", (pName));

    ShowToEdit( "英文姓名:", (pEnName));

    ShowToEdit( "性別:", (pSex));

    ShowToEdit( "國籍代碼:", (pEnNation));

    ShowToEdit( "永久居留證號碼:", (pCertNo));

    ShowToEdit( "出生日期:", (pBirth));

    ShowToEdit( "證件簽發日期:", (pEffectData));

    ShowToEdit( "證件終止日期:", (pExpire));

    ShowToEdit( "證件版本:", (pCardVersion));

    }

    if(GetCardType() == 2)

    {

    GetName(pName);

    GetSex(pSex);

    GetBirth(pBirth);

    GetAddress(pAddress);

    GetCertNo(pCertNo);

    GetDepartemt(pDepartment);

    GetEffectDate(pEffectData);

    GetExpireDate(pExpire);

    GetTXZHM(pTXZHM);

    GetTXZQFCS(pTXZQFCS);

    ShowToEdit( "姓名:", (pName));

    ShowToEdit( "性別:", (pSex));

    ShowToEdit( "出生日期:", (pBirth));

    ShowToEdit( "地址:", (pAddress));

    ShowToEdit( "身份證號:", (pCertNo));

    ShowToEdit( "簽發機關:", (pDepartment));

    ShowToEdit( "有效起始日期:", (pEffectData));

    ShowToEdit( "有效截止日期:", (pExpire));

    ShowToEdit( "通行證號碼:", (pTXZHM));

    ShowToEdit( "通行證簽發次數:", (pTXZQFCS));

    }

    char szPhotoPath[255] = { 0 };

    sprintf(szPhotoPath, "../list/%s.bmp", pCertNo);

    GetBmpFile("../lib/libwltdecode.so", szPhotoPath);

    }

    static void ICC_CPUCard_Test()

    {

    intnRt, i;

    unsigned char slot = 0x01;

    unsigned char cmd[255] = { 0 };

    unsigned charresp[255]= { 0 };

    unsigned charATR[60] = { 0 };

    intlenth_of_cmd;

    // Get 8 byte Random

    cmd[0] = 0x00;

    cmd[1] = 0x84;

    cmd[2] = 0x00;

    cmd[3] = 0x00;

    cmd[4] = 0x08;

    lenth_of_cmd = 5;

    //CPU Card PowerOn

    nRt = ICC_Reader_pre_PowerOn( handle, slot, resp );

    if( nRt < 0 )

    {

    printf( "CPU Card PowerOn fail! ret=%d\n", nRt );

    return;

    }

    printByteArray( "ATR: ", resp, nRt );

    printByteArray( "CMD: ", cmd, lenth_of_cmd );

    //Send APDU CMD

    memset( resp, 0, 250 );

    nRt = ICC_Reader_Application( handle, slot, lenth_of_cmd, cmd, resp );

    if( nRt < 0 )

    {

    printf( "send APDU CMD fail! ret=%d\n", nRt );

    return;

    }

    printByteArray( "Resp: ", resp, nRt );

    }

    static void PICC_CPUCard_Test()

    {

    int             nRt, i;

    unsigned char   uid[15]  = { 0 };

    unsigned char   cmd[255] = { 0 };

    unsigned char   resp[255]= { 0 };

    unsigned char   ATR[60]  = { 0 };

    int             lenth_of_cmd;

    // Get 8 byte Random

    cmd[0] = 0x00;

    cmd[1] = 0x84;

    cmd[2] = 0x00;

    cmd[3] = 0x00;

    cmd[4] = 0x08;

    lenth_of_cmd = 5;

    //CPU Card PowerOn

    nRt = PICC_Reader_PowerOnTypeA( handle, resp );

    if( nRt < 0 )

    {

    printf( "TypeA CPU Card PowerOn fail! ret=%d\n", nRt );

    return;

    }

    printByteArray( "ATR: ", resp, nRt );

    printByteArray( "CMD: ", cmd, lenth_of_cmd );

    memset( resp, 0, 250 );

    nRt = PICC_Reader_Application( handle, lenth_of_cmd, cmd, resp );

    if( nRt < 0 )

    {

    printf( "send APDU CMD fail! ret=%d\n", nRt );

    return;

    }

    printByteArray( "Resp: ", resp, nRt );

    }

    static void M1Card_Test()

    {

    int             nRt, i;

    unsigned char   uid[15]= { 0 };

    unsigned char   password[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };

    unsigned char   resp[255]= { 0 };

    unsigned charaddr= 0x04;

    unsigned charsncr= 0x01;

    unsigned charmode= 0x61;

    if( PICC_Reader_GetUID( handle, uid ) <= 0 )

    {

    printf( "PICC_Reader_anticoll fail! ret=%d\n", nRt );

    return;

    }

    printByteArray( "UID: ", uid, 4 );


    nRt = PICC_Reader_Authentication_Pass( handle, mode, sncr, password );

    if ( nRt != 0 )

    {

    printf( "PICC_Reader_Authentication_Pass fail! ret=%d\n", nRt );

    return;

    }

    nRt = PICC_Reader_Read( handle, addr, resp );

    if( nRt != 0 )

    {

    printf( "PICC_Reader_Read fail! ret=%d\n", nRt );

    return;

    }

    printByteArray( "Data: ", resp, 16 );

    }

    int main(void)

    {

    long nRt;

    intnval;

    handle = ICC_Reader_Open( "/dev/ttyUSB0" );

    if( handle <= 0 )

    {

    printf( "open fail! \n" );

    return 0;

    }

    printchar( '#', 80 );

    printchar_txt( '#', "please choose the action you want:" );

    printchar_txt( '#', "1.opt ICC CPU Card." );

    printchar_txt( '#', "2.opt PICC CPU(A) Card." );

    printchar_txt( '#', "3.opt M1 Card." );

    printchar_txt( '#', "4.opt CertCard." );

    printchar( '#', 80 );

    scanf( "%d", &nval );

    //nRt = ICC_PosBeep( handle, 10 );

    switch( nval )

    {

    case 1:

    {

    printf( "\tICC_CPU_CARD.\n" );

    ICC_CPUCard_Test();

    }

    break;

    case 2:

    {

    printf( "\tPICC_CPU(A)_CARD.\n" );

    PICC_CPUCard_Test();

    }

    break;

    case 3:

    {

    printf( "\tM1_CARD.\n" );

    M1Card_Test();

    }

    break;

    case 4:

    {

    printf( "\tCertCard.\n" );

    CertCard_Test();

    }

    break;

    default:

    printf( "enter err!\n" );

    break;

    }

    ICC_PosBeep(handle, 10);

    ICC_Reader_Close(handle);

    return 0;

    }

     

     
    QQ在線咨詢