|
Applications normally perform these steps:
The following example illustrates this:
LC_CLIENT *cl; LC_CARD *card=0; LC_CLIENT_RESULT res; cl=LC_Client_new("MyApplication", "1.0", 0); LC_Client_ReadConfigFile(cl, 0); LC_Client_StartWait(cl, 0, 0); card=LC_Client_WaitForNextCard(cl, 30); LC_KVKCard_ExtendCard(card); LC_Card_Open(card); LC_Client_StopWait(cl); ... [do something with the card] ... LC_Card_Close(card); LC_Card_free(card); ...
| #define LC_NOTIFY_FLAGS_CARD_INSERTED 0x00001000 |
| #define LC_NOTIFY_FLAGS_CARD_MASK 0x0000f000 |
| #define LC_NOTIFY_FLAGS_CARD_REMOVED 0x00002000 |
| #define LC_NOTIFY_FLAGS_CARD_RFU1 0x00004000 |
| #define LC_NOTIFY_FLAGS_CARD_RFU2 0x00008000 |
| #define LC_NOTIFY_FLAGS_CLIENT_CMDRECV 0x00800000 |
| #define LC_NOTIFY_FLAGS_CLIENT_CMDSEND 0x00400000 |
| #define LC_NOTIFY_FLAGS_CLIENT_DOWN 0x00020000 |
| #define LC_NOTIFY_FLAGS_CLIENT_GOTCARD 0x00200000 |
| #define LC_NOTIFY_FLAGS_CLIENT_MASK 0x0fff0000 |
| #define LC_NOTIFY_FLAGS_CLIENT_STARTWAIT 0x00040000 |
| #define LC_NOTIFY_FLAGS_CLIENT_STOPWAIT 0x00080000 |
| #define LC_NOTIFY_FLAGS_CLIENT_TAKECARD 0x00100000 |
| #define LC_NOTIFY_FLAGS_CLIENT_UP 0x00010000 |
| #define LC_NOTIFY_FLAGS_DRIVER_DOWN 0x00000004 |
| #define LC_NOTIFY_FLAGS_DRIVER_ERROR 0x00000008 |
| #define LC_NOTIFY_FLAGS_DRIVER_MASK 0x0000000f |
| #define LC_NOTIFY_FLAGS_DRIVER_START 0x00000001 |
| #define LC_NOTIFY_FLAGS_DRIVER_UP 0x00000002 |
| #define LC_NOTIFY_FLAGS_PRIVILEGED |
| #define LC_NOTIFY_FLAGS_READER_DOWN 0x00000040 |
| #define LC_NOTIFY_FLAGS_READER_ERROR 0x00000080 |
| #define LC_NOTIFY_FLAGS_READER_MASK 0x000000f0 |
| #define LC_NOTIFY_FLAGS_READER_START 0x00000010 |
| #define LC_NOTIFY_FLAGS_READER_UP 0x00000020 |
| #define LC_NOTIFY_FLAGS_SERVICE_DOWN 0x00000400 |
| #define LC_NOTIFY_FLAGS_SERVICE_ERROR 0x00000800 |
| #define LC_NOTIFY_FLAGS_SERVICE_MASK 0x00000f00 |
| #define LC_NOTIFY_FLAGS_SERVICE_START 0x00000100 |
| #define LC_NOTIFY_FLAGS_SERVICE_UP 0x00000200 |
| typedef int(* LC_CLIENT_HANDLE_INREQUEST_FN)(LC_CLIENT *cl, GWEN_TYPE_UINT32 rid, GWEN_DB_NODE *dbReq) |
| typedef void(* LC_CLIENT_SERVER_DOWN_FN)(LC_CLIENT *cl, GWEN_TYPE_UINT32 serverId) |
| enum LC_CLIENT_CMDTARGET |
Targets for commands (used by LC_Card_ExecAPDU)
| enum LC_CLIENT_RESULT |
Result codes for operations.
| void LC_Card_ShowError | ( | LC_CARD * | card, | |
| LC_CLIENT_RESULT | res, | |||
| const char * | failedCommand | |||
| ) |
Logs the given result with the loglevel "info".
| LC_CLIENT_RESULT LC_Client_CheckResponse | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | rid | |||
| ) |
| LC_CLIENT_RESULT LC_Client_CheckResponse_Wait | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | rid, | |||
| int | timeout | |||
| ) |
| LC_CLIENT_RESULT LC_Client_CheckStartWait | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | rid | |||
| ) |
| LC_CLIENT_RESULT LC_Client_CloseService | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | serverId, | |||
| GWEN_TYPE_UINT32 | svid, | |||
| GWEN_DB_NODE * | dbData | |||
| ) |
| int LC_Client_DeleteRequest | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | rid | |||
| ) |
| void LC_Client_free | ( | LC_CLIENT * | cl | ) |
| int LC_Client_GetLongTimeout | ( | const LC_CLIENT * | cl | ) |
| LCM_MONITOR* LC_Client_GetMonitor | ( | const LC_CLIENT * | cl | ) |
| int LC_Client_GetShortTimeout | ( | const LC_CLIENT * | cl | ) |
| LC_CLIENT_RESULT LC_Client_LockReader | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | serverId, | |||
| GWEN_TYPE_UINT32 | readerId, | |||
| GWEN_TYPE_UINT32 * | lockId | |||
| ) |
| LC_CLIENT* LC_Client_new | ( | const char * | programName, | |
| const char * | programVersion, | |||
| const char * | dataDir | |||
| ) |
Create an instance of the Libchipcard2 client.
| programName | Name of the calling program (used for improved logging on the server side) | |
| programVersion | Version of the calling program (used for improved logging on the server side) | |
| dataDir | folder in which the client data (e.g. application description files) is stored. You should use NULL here to make Libchipcard2 use the systemwide default folder. |
| LC_CLIENT_RESULT LC_Client_OpenService | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | serverId, | |||
| GWEN_TYPE_UINT32 | svid, | |||
| GWEN_DB_NODE * | dbData | |||
| ) |
| int LC_Client_ReadConfig | ( | LC_CLIENT * | cl, | |
| GWEN_DB_NODE * | db | |||
| ) |
Read the Libchipcard2 client configuration from the given GWEN_DB.
| cl | client object | |
| db | db which contains the configuration data |
| int LC_Client_ReadConfigFile | ( | LC_CLIENT * | cl, | |
| const char * | fname | |||
| ) |
Read the Libchipcard2 client configuration from the given configuration file.
| cl | client object | |
| fname | path and name of the file to load. You should use NULL here to make Libchipcard2 use the systemwide default configuration file. |
| LC_CLIENT_RESULT LC_Client_ReaderCommand | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | serverId, | |||
| GWEN_TYPE_UINT32 | readerId, | |||
| GWEN_TYPE_UINT32 | lockId, | |||
| GWEN_DB_NODE * | dbData, | |||
| GWEN_DB_NODE * | dbCmdResp | |||
| ) |
| void LC_Client_RemoveInRequest | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | rid | |||
| ) |
| int LC_Client_SendResponse | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | rid, | |||
| GWEN_DB_NODE * | dbCommand | |||
| ) |
| GWEN_TYPE_UINT32 LC_Client_SendStartWait | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | rflags, | |||
| GWEN_TYPE_UINT32 | rmask | |||
| ) |
| LC_CLIENT_RESULT LC_Client_ServiceCommand | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | serverId, | |||
| GWEN_TYPE_UINT32 | svid, | |||
| GWEN_DB_NODE * | dbData, | |||
| GWEN_DB_NODE * | dbCmdResp | |||
| ) |
| void LC_Client_SetHandleInRequestFn | ( | LC_CLIENT * | cl, | |
| LC_CLIENT_HANDLE_INREQUEST_FN | fn | |||
| ) |
| LC_CLIENT_RESULT LC_Client_SetNotify | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | flags | |||
| ) |
| void LC_Client_SetServerDownFn | ( | LC_CLIENT * | cl, | |
| LC_CLIENT_SERVER_DOWN_FN | fn | |||
| ) |
| LC_CLIENT_RESULT LC_Client_StartWait | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | rflags, | |||
| GWEN_TYPE_UINT32 | rmask | |||
| ) |
| LC_CLIENT_RESULT LC_Client_StopWait | ( | LC_CLIENT * | cl | ) |
| LC_CLIENT_RESULT LC_Client_UnlockReader | ( | LC_CLIENT * | cl, | |
| GWEN_TYPE_UINT32 | serverId, | |||
| GWEN_TYPE_UINT32 | readerId, | |||
| GWEN_TYPE_UINT32 | lockId | |||
| ) |
| int LC_Client_Work | ( | LC_CLIENT * | cl, | |
| int | maxmsg | |||
| ) |
| LC_CLIENT_RESULT LC_Client_Work_Wait | ( | LC_CLIENT * | cl, | |
| int | timeout | |||
| ) |
1.5.3