sc-hsm-embedded
src/ctccid/ctapi.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ctapi.h"
#include <ctbcs.h>
#include "scr.h"

Functions

int ccidT1Term (struct scr *ctx)
signed char CT_init (unsigned short ctn, unsigned short pn)
signed char CT_close (unsigned short ctn)
signed char CT_data (unsigned short ctn, unsigned char *dad, unsigned char *sad, unsigned short lc, unsigned char *cmd, unsigned short *lr, unsigned char *rsp)

Variables

scr_treaderTable [MAX_READER] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }

Function Documentation

int ccidT1Term ( struct scr ctx)

Terminate driver module and release memory

Parameters:
ctxReader context
signed char CT_close ( unsigned short  ctn)

Close the interface and free all allocated resources

Parameters:
ctnCard terminal number
Returns:
Status code OK, ERR_INVALID, ERR_CT, ERR_TRANS, ERR_MEMORY, ERR_HOST, ERR_HTSI
signed char CT_data ( unsigned short  ctn,
unsigned char *  dad,
unsigned char *  sad,
unsigned short  lc,
unsigned char *  cmd,
unsigned short *  lr,
unsigned char *  rsp 
)

Pass a command to the reader driver and receive the response

Parameters:
ctnCard terminal number
dadDestination address
sadSource address
lcLength of command data
cmdCommand data
lrSize of response data buffer
rspResponse data
Returns:
Status code OK, ERR_INVALID, ERR_CT, ERR_TRANS, ERR_MEMORY, ERR_HOST, ERR_HTSI
signed char CT_init ( unsigned short  ctn,
unsigned short  pn 
)

Initialize the interface to the card reader ctn attached to the port number specified in pn

Parameters:
ctnCard terminal number
pnPort number
Returns:
Status code OK, ERR_INVALID, ERR_CT, ERR_TRANS, ERR_MEMORY, ERR_HOST, ERR_HTSI

Variable Documentation

scr_t* readerTable[MAX_READER] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }