00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00026 #ifndef H_CTAPI
00027 #define H_CTAPI
00028
00029 #include <types.h>
00030
00031 #define CTAPI_AD_ICC1 0
00032 #define CTAPI_AD_CT 1
00033 #define CTAPI_AD_HOST 2
00034
00035 #define CTAPI_RV_OK 0
00036 #define CTAPI_RV_ERR_INVALID -1
00037 #define CTAPI_RV_ERR_CT -8
00038 #define CTAPI_RV_ERR_TRANS -10
00039 #define CTAPI_RV_ERR_MEMORY -11
00040 #define CTAPI_RV_ERR_HOST -127
00041 #define CTAPI_RV_ERR_HTSI -128
00042
00043 #define CTAPI_PORT 1
00044
00045 #define CTAPI_CLA 0x20
00046 #define CTAPI_INS_RESET_CT 0x11
00047 #define CTAPI_INS_REQUEST_ICC 0x12
00048 #define CTAPI_INS_GET_STATUS 0x13
00049 #define CTAPI_INS_EJECT_ICC 0x14
00050 #define CTAPI_INS_EEPROM 0xE0
00051
00052 typedef unsigned char IU8;
00053 typedef signed char IS8;
00054 typedef unsigned short IU16;
00055 typedef signed short IS16;
00056 typedef unsigned long IU32;
00057 typedef signed long IS32;
00058
00059 extern int fd_fromCard[2], fd_toCard[2];
00060 extern int loadEepromFile;
00061 extern int saveEepromFile;
00062 extern char eepromFile[256];
00063 extern int fdEepromFile;
00064
00065 #ifdef __cplusplus
00066 extern "C" {
00067 #endif
00068
00069 IS8 CT_forkIcc( void );
00070 IS8 CT_stopIcc( void );
00071 IS8 CT_ifdCmdEepromFile( IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response );
00072
00073 IS8 CT_ifdCmdResetCT( IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response );
00074 IS8 CT_ifdCmdRequestICC( IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response );
00075 IS8 CT_ifdCmdGetStatus( IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response );
00076 IS8 CT_ifdCmdEjectICC( IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response );
00077 IS8 CT_ifdCmd( IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response );
00078 IS8 CT_iccCmd( IU8 *dad, IU8 *sad, IU16 lenc, IU8 *command,
00079 IU16 *lenr, IU8 *response );
00080 IS8 CT_init( IU16 ctn, IU16 pn );
00081 IS8 CT_data( IU16 ctn, IU8 *dad, IU8 *sad, IU16 lenc, IU8 *command,
00082 IU16 *lenr, IU8 *response );
00083 IS8 CT_close( IU16 ctn );
00084
00085 #ifdef __cplusplus
00086 }
00087 #endif
00088 #endif
00089