libchipcard 5.1.6
Macros | Typedefs | Enumerations
client.h File Reference
#include <gwenhywfar/inherit.h>
#include <chipcard/chipcard.h>
#include <chipcard/card.h>
Include dependency graph for client.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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 }
 

Functions

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)
 

Macro Definition Documentation

◆ LC_DEFAULT_SHORT_TIMEOUT

#define LC_DEFAULT_SHORT_TIMEOUT   10

◆ LC_DEFAULT_LONG_TIMEOUT

#define LC_DEFAULT_LONG_TIMEOUT   30

◆ LC_DEFAULT_VERY_LONG_TIMEOUT

#define LC_DEFAULT_VERY_LONG_TIMEOUT   60

Typedef Documentation

◆ LC_CLIENT

typedef struct LC_CLIENT LC_CLIENT

Enumeration Type Documentation

◆ LC_CLIENT_RESULT

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 

◆ LC_CLIENT_CMDTARGET

Targets for commands (used by LC_Card_ExecApdu)

Enumerator
LC_Client_CmdTargetCard 
LC_Client_CmdTargetReader 

Function Documentation

◆ LC_Client_new()

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

◆ LC_Client_free()

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.

◆ LC_Client_Init()

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.

◆ LC_Client_Fini()

CHIPCARD_API LC_CLIENT_RESULT LC_Client_Fini ( LC_CLIENT * cl)

Deinit Libchipcard. Unloads all data files.

◆ LC_Client_Start()

CHIPCARD_API LC_CLIENT_RESULT LC_Client_Start ( LC_CLIENT * cl)

◆ LC_Client_Stop()

CHIPCARD_API LC_CLIENT_RESULT LC_Client_Stop ( LC_CLIENT * cl)

◆ LC_Client_GetNextCard()

CHIPCARD_API LC_CLIENT_RESULT LC_Client_GetNextCard ( LC_CLIENT * cl,
LC_CARD ** pCard,
int timeout )

◆ LC_Client_ReleaseCard()

CHIPCARD_API LC_CLIENT_RESULT LC_Client_ReleaseCard ( LC_CLIENT * cl,
LC_CARD * card )

◆ LC_Client_GetProgramName()

CHIPCARD_API const char * LC_Client_GetProgramName ( const LC_CLIENT * cl)

◆ LC_Client_GetProgramVersion()

CHIPCARD_API const char * LC_Client_GetProgramVersion ( const LC_CLIENT * cl)