Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

ctapi.h File Reference

Declarations for virtual CT-API library. More...

#include <types.h>

Go to the source code of this file.

Defines

#define CTAPI_AD_ICC1   0
#define CTAPI_AD_CT   1
#define CTAPI_AD_HOST   2
#define CTAPI_RV_OK   0
#define CTAPI_RV_ERR_INVALID   -1
#define CTAPI_RV_ERR_CT   -8
#define CTAPI_RV_ERR_TRANS   -10
#define CTAPI_RV_ERR_MEMORY   -11
#define CTAPI_RV_ERR_HOST   -127
#define CTAPI_RV_ERR_HTSI   -128
#define CTAPI_PORT   1
#define CTAPI_CLA   0x20
#define CTAPI_INS_RESET_CT   0x11
#define CTAPI_INS_REQUEST_ICC   0x12
#define CTAPI_INS_GET_STATUS   0x13
#define CTAPI_INS_EJECT_ICC   0x14
#define CTAPI_INS_EEPROM   0xE0

Typedefs

typedef unsigned char IU8
typedef signed char IS8
typedef unsigned short IU16
typedef signed short IS16
typedef unsigned long IU32
typedef signed long IS32

Functions

IS8 CT_forkIcc (void)
IS8 CT_stopIcc (void)
IS8 CT_ifdCmdEepromFile (IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response)
 Parses EEPROM FILE command. More...

IS8 CT_ifdCmdResetCT (IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response)
IS8 CT_ifdCmdRequestICC (IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response)
IS8 CT_ifdCmdGetStatus (IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response)
IS8 CT_ifdCmdEjectICC (IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response)
IS8 CT_ifdCmd (IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response)
IS8 CT_iccCmd (IU8 *dad, IU8 *sad, IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response)
IS8 CT_init (IU16 ctn, IU16 pn)
IS8 CT_data (IU16 ctn, IU8 *dad, IU8 *sad, IU16 lenc, IU8 *command, IU16 *lenr, IU8 *response)
IS8 CT_close (IU16 ctn)

Variables

int fd_fromCard [2]
int fd_toCard [2]
int loadEepromFile
int saveEepromFile
char eepromFile [256]
int fdEepromFile


Detailed Description

Declarations for virtual CT-API library.

Id:
ctapi.h,v 1.2 2002/12/22 23:16:15 m Exp


Define Documentation

#define CTAPI_AD_CT   1
 

#define CTAPI_AD_HOST   2
 

#define CTAPI_AD_ICC1   0
 

#define CTAPI_CLA   0x20
 

#define CTAPI_INS_EEPROM   0xE0
 

#define CTAPI_INS_EJECT_ICC   0x14
 

#define CTAPI_INS_GET_STATUS   0x13
 

#define CTAPI_INS_REQUEST_ICC   0x12
 

#define CTAPI_INS_RESET_CT   0x11
 

#define CTAPI_PORT   1
 

#define CTAPI_RV_ERR_CT   -8
 

#define CTAPI_RV_ERR_HOST   -127
 

#define CTAPI_RV_ERR_HTSI   -128
 

#define CTAPI_RV_ERR_INVALID   -1
 

#define CTAPI_RV_ERR_MEMORY   -11
 

#define CTAPI_RV_ERR_TRANS   -10
 

#define CTAPI_RV_OK   0
 


Typedef Documentation

typedef signed short IS16
 

typedef signed long IS32
 

typedef signed char IS8
 

typedef unsigned short IU16
 

typedef unsigned long IU32
 

typedef unsigned char IU8
 


Function Documentation

IS8 CT_close IU16    ctn
 

IS8 CT_data IU16    ctn,
IU8   dad,
IU8   sad,
IU16    lenc,
IU8   command,
IU16   lenr,
IU8   response
 

IS8 CT_forkIcc void   
 

IS8 CT_iccCmd IU8   dad,
IU8   sad,
IU16    lenc,
IU8   command,
IU16   lenr,
IU8   response
 

IS8 CT_ifdCmd IU16    lenc,
IU8   command,
IU16   lenr,
IU8   response
 

IS8 CT_ifdCmdEepromFile IU16    lenc,
IU8   command,
IU16   lenr,
IU8   response
 

Parses EEPROM FILE command.

  • CLA: '20'
    • INS: 'E0'
    • P1:
      • bit 1: Save EEPROM to file at eject or reset.
      • bit 2: Load EEPROM from file at reset.
    • P2: RFU
    • Lc: Length of file name
    • Data: File name (possibly including path) without null-termination

IS8 CT_ifdCmdEjectICC IU16    lenc,
IU8   command,
IU16   lenr,
IU8   response
 

IS8 CT_ifdCmdGetStatus IU16    lenc,
IU8   command,
IU16   lenr,
IU8   response
 

IS8 CT_ifdCmdRequestICC IU16    lenc,
IU8   command,
IU16   lenr,
IU8   response
 

IS8 CT_ifdCmdResetCT IU16    lenc,
IU8   command,
IU16   lenr,
IU8   response
 

IS8 CT_init IU16    ctn,
IU16    pn
 

IS8 CT_stopIcc void   
 


Variable Documentation

char eepromFile[256]
 

int fd_fromCard[2]
 

int fd_toCard[2]
 

int fdEepromFile
 

int loadEepromFile
 

int saveEepromFile
 


Copyright 2002 by Matthias Bruestle. This is licensed under the GNU General Public License.