libchipcard  5.0.2
Macros | Typedefs | Enumerations
Client Interface for Applications
Collaboration diagram for Client Interface for Applications:

Macros

#define LC_DEFAULT_SHORT_TIMEOUT   10
 
#define LC_DEFAULT_LONG_TIMEOUT   30
 
#define LC_DEFAULT_VERY_LONG_TIMEOUT   60
 

Typedefs

typedef struct LC_CLIENT LC_CLIENT
 

Enumerations

enum  LC_CLIENT_RESULT {
  LC_Client_ResultOk =0, LC_Client_ResultWait, LC_Client_ResultIpcError, LC_Client_ResultCmdError,
  LC_Client_ResultDataError, LC_Client_ResultAborted, LC_Client_ResultInvalid, LC_Client_ResultInternal,
  LC_Client_ResultGeneric, LC_Client_ResultNoData, LC_Client_ResultCardRemoved, LC_Client_ResultNotSupported,
  LC_Client_ResultCfgError, LC_Client_ResultNotFound, LC_Client_ResultIoError, LC_Client_ResultBadPin,
  LC_Client_ResultDontExecute
}
 
enum  LC_CLIENT_CMDTARGET { LC_Client_CmdTargetCard =0, LC_Client_CmdTargetReader }
 

Main API

To work with this API you'll need to create a client object first. This is normally done by LC_Client_new.

CHIPCARD_API LC_CLIENTLC_Client_new (const char *programName, const char *programVersion)
 
CHIPCARD_API void LC_Client_free (LC_CLIENT *cl)
 
CHIPCARD_API LC_CLIENT_RESULT LC_Client_Init (LC_CLIENT *cl)
 
CHIPCARD_API LC_CLIENT_RESULT LC_Client_Fini (LC_CLIENT *cl)
 
CHIPCARD_API LC_CLIENT_RESULT LC_Client_Start (LC_CLIENT *cl)
 
CHIPCARD_API LC_CLIENT_RESULT LC_Client_Stop (LC_CLIENT *cl)
 
CHIPCARD_API LC_CLIENT_RESULT LC_Client_GetNextCard (LC_CLIENT *cl, LC_CARD **pCard, int timeout)
 
CHIPCARD_API LC_CLIENT_RESULT LC_Client_ReleaseCard (LC_CLIENT *cl, LC_CARD *card)
 

Informational Functions

CHIPCARD_API const char * LC_Client_GetProgramName (const LC_CLIENT *cl)
 
CHIPCARD_API const char * LC_Client_GetProgramVersion (const LC_CLIENT *cl)
 

Detailed Description

Macro Definition Documentation

#define LC_DEFAULT_SHORT_TIMEOUT   10
#define LC_DEFAULT_LONG_TIMEOUT   30
#define LC_DEFAULT_VERY_LONG_TIMEOUT   60

Typedef Documentation

typedef struct LC_CLIENT LC_CLIENT

Enumeration Type Documentation

Result codes for operations.

Enumerator
LC_Client_ResultOk 
LC_Client_ResultWait 
LC_Client_ResultIpcError 
LC_Client_ResultCmdError 
LC_Client_ResultDataError 
LC_Client_ResultAborted 
LC_Client_ResultInvalid 
LC_Client_ResultInternal 
LC_Client_ResultGeneric 
LC_Client_ResultNoData 
LC_Client_ResultCardRemoved 
LC_Client_ResultNotSupported 
LC_Client_ResultCfgError 
LC_Client_ResultNotFound 
LC_Client_ResultIoError 
LC_Client_ResultBadPin 
LC_Client_ResultDontExecute 

Targets for commands (used by LC_Card_ExecApdu)

Enumerator
LC_Client_CmdTargetCard 
LC_Client_CmdTargetReader 

Function Documentation

CHIPCARD_API LC_CLIENT* LC_Client_new ( const char *  programName,
const char *  programVersion 
)

This function creates a libchipcard client.

Parameters
programNamename of the program which wants to create the client
programVersionversion string of that program
CHIPCARD_API void LC_Client_free ( LC_CLIENT cl)

Release all ressources associated with Libchipcard3. This must be called at the end of the application to avoid memory leaks.

CHIPCARD_API LC_CLIENT_RESULT LC_Client_Init ( LC_CLIENT cl)

Init Libchipcard. This functions reads the configuration file and the card command description files. It does not allocate the readers (see LC_Client_Start), so it is perfectly save to call this function upon startup of the application.

CHIPCARD_API LC_CLIENT_RESULT LC_Client_Fini ( LC_CLIENT cl)

Deinit Libchipcard. Unloads all data files.

CHIPCARD_API LC_CLIENT_RESULT LC_Client_Start ( LC_CLIENT cl)
CHIPCARD_API LC_CLIENT_RESULT LC_Client_Stop ( LC_CLIENT cl)
CHIPCARD_API LC_CLIENT_RESULT LC_Client_GetNextCard ( LC_CLIENT cl,
LC_CARD **  pCard,
int  timeout 
)
CHIPCARD_API LC_CLIENT_RESULT LC_Client_ReleaseCard ( LC_CLIENT cl,
LC_CARD card 
)
CHIPCARD_API const char* LC_Client_GetProgramName ( const LC_CLIENT cl)
CHIPCARD_API const char* LC_Client_GetProgramVersion ( const LC_CLIENT cl)