00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef CHIPCARD_CLIENT_CLIENT_H
00015 #define CHIPCARD_CLIENT_CLIENT_H
00016
00017
00021
00022 #include <gwenhywfar/inherit.h>
00023 #include <chipcard/chipcard.h>
00024
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 #define LC_DEFAULT_SHORT_TIMEOUT 10
00031 #define LC_DEFAULT_LONG_TIMEOUT 30
00032 #define LC_DEFAULT_VERY_LONG_TIMEOUT 60
00033
00034 #define LC_CLIENT_TIMEOUT_NONE 0
00035 #define LC_CLIENT_TIMEOUT_FOREVER (-1)
00036
00037
00038 typedef struct LC_CLIENT LC_CLIENT;
00039 GWEN_INHERIT_FUNCTION_LIB_DEFS(LC_CLIENT, CHIPCARD_API)
00040
00041
00042
00045 typedef enum {
00046 LC_Client_ResultOk=0,
00047 LC_Client_ResultWait,
00048 LC_Client_ResultIpcError,
00049 LC_Client_ResultCmdError,
00050 LC_Client_ResultDataError,
00051 LC_Client_ResultAborted,
00052 LC_Client_ResultInvalid,
00053 LC_Client_ResultInternal,
00054 LC_Client_ResultGeneric,
00055 LC_Client_ResultNoData,
00056 LC_Client_ResultCardRemoved,
00057 LC_Client_ResultNotSupported,
00058 LC_Client_ResultCfgError,
00059 LC_Client_ResultNotFound,
00060 LC_Client_ResultIoError,
00061 LC_Client_ResultBadPin,
00062 LC_Client_ResultDontExecute,
00063 } LC_CLIENT_RESULT;
00064
00065
00069 typedef enum {
00070 LC_Client_CmdTargetCard=0,
00071 LC_Client_CmdTargetReader
00072 } LC_CLIENT_CMDTARGET;
00073
00074
00075
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079
00080
00081 #include <chipcard/client/card.h>
00082 #include <chipcard/client/notifications.h>
00083 #include <chipcard/client/mon/monitor.h>
00084 #include <chipcard/client/switch.h>
00085
00086
00087 #ifdef __cplusplus
00088 extern "C" {
00089 #endif
00090
00091 typedef void (*LC_CLIENT_RECV_NOTIFICATION_FN)(LC_CLIENT *cl,
00092 const LC_NOTIFICATION *n);
00093
00094
00095
00102
00109 CHIPCARD_API
00110 LC_CLIENT_RESULT LC_Client_Init(LC_CLIENT *cl);
00111
00116 CHIPCARD_API
00117 LC_CLIENT_RESULT LC_Client_Fini(LC_CLIENT *cl);
00118
00126 CHIPCARD_API
00127 LC_CLIENT_RESULT LC_Client_Start(LC_CLIENT *cl);
00128
00135 CHIPCARD_API
00136 LC_CLIENT_RESULT LC_Client_Stop(LC_CLIENT *cl);
00137
00143 CHIPCARD_API
00144 LC_CLIENT_RESULT LC_Client_GetNextCard(LC_CLIENT *cl,
00145 LC_CARD **pCard,
00146 int timeout);
00147
00148
00149
00150
00151
00152 CHIPCARD_API
00153 LC_CLIENT_RESULT LC_Client_ReleaseCard(LC_CLIENT *cl, LC_CARD *card);
00154
00159 CHIPCARD_API
00160 void LC_Client_free(LC_CLIENT *cl);
00161
00166 CHIPCARD_API
00167 const char *LC_Client_GetIoTypeName(const LC_CLIENT *cl);
00168
00175
00176 CHIPCARD_API
00177 const char *LC_Client_GetProgramName(const LC_CLIENT *cl);
00178
00179 CHIPCARD_API
00180 const char *LC_Client_GetProgramVersion(const LC_CLIENT *cl);
00181
00182 CHIPCARD_API
00183 int LC_Client_GetShortTimeout(const LC_CLIENT *cl);
00184
00185 CHIPCARD_API
00186 int LC_Client_GetLongTimeout(const LC_CLIENT *cl);
00187
00188 CHIPCARD_API
00189 int LC_Client_GetVeryLongTimeout(const LC_CLIENT *cl);
00197 CHIPCARD_API
00198 GWEN_XMLNODE *LC_Client_GetAppNodes(const LC_CLIENT *cl);
00199
00200 CHIPCARD_API
00201 GWEN_XMLNODE *LC_Client_GetCardNodes(const LC_CLIENT *cl);
00202
00212 CHIPCARD_API
00213 LCM_MONITOR *LC_Client_GetMonitor(const LC_CLIENT *cl);
00214
00215 CHIPCARD_API
00216 LC_CLIENT_RESULT LC_Client_SetNotify(LC_CLIENT *cl,
00217 uint32_t flags);
00218
00219 CHIPCARD_API
00220 LC_CLIENT_RECV_NOTIFICATION_FN
00221 LC_Client_SetRecvNotificationFn(LC_CLIENT *cl,
00222 LC_CLIENT_RECV_NOTIFICATION_FN fn);
00226 #ifdef __cplusplus
00227 }
00228 #endif
00229
00230
00233 #endif
00234
00235
00236