client.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id: client_p.h 137 2005-11-03 13:07:50Z aquamaniac $
00005     begin       : Mon Mar 01 2004
00006     copyright   : (C) 2004 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *          Please see toplevel file COPYING for license details           *
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 <chipcard3/chipcard3.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_RESULT;
00063 
00064 
00068 typedef enum {
00069   LC_Client_CmdTargetCard=0,
00070   LC_Client_CmdTargetReader
00071 } LC_CLIENT_CMDTARGET;
00072 
00073 
00074 
00075 #ifdef __cplusplus
00076 }
00077 #endif
00078 
00079 
00080 #include <chipcard3/client/card.h>
00081 #include <chipcard3/client/notifications.h>
00082 #include <chipcard3/client/mon/monitor.h>
00083 #include <chipcard3/client/switch.h>
00084 
00085 
00086 #ifdef __cplusplus
00087 extern "C" {
00088 #endif
00089 
00090 typedef void (*LC_CLIENT_RECV_NOTIFICATION_FN)(LC_CLIENT *cl,
00091                                                const LC_NOTIFICATION *n);
00092 
00093 
00094 
00101 
00108 CHIPCARD_API
00109 LC_CLIENT_RESULT LC_Client_Init(LC_CLIENT *cl);
00110 
00115 CHIPCARD_API
00116 LC_CLIENT_RESULT LC_Client_Fini(LC_CLIENT *cl);
00117 
00125 CHIPCARD_API
00126 LC_CLIENT_RESULT LC_Client_Start(LC_CLIENT *cl);
00127 
00134 CHIPCARD_API
00135 LC_CLIENT_RESULT LC_Client_Stop(LC_CLIENT *cl);
00136 
00142 CHIPCARD_API
00143 LC_CLIENT_RESULT LC_Client_GetNextCard(LC_CLIENT *cl,
00144                                        LC_CARD **pCard,
00145                                        int timeout);
00146 
00147 /* This function releases the given card. After calling this function the card
00148  * can no longer be used for commands etc.
00149  * You should call @ref LC_Card_free on the card afterwards.
00150  */
00151 CHIPCARD_API
00152 LC_CLIENT_RESULT LC_Client_ReleaseCard(LC_CLIENT *cl, LC_CARD *card);
00153 
00158 CHIPCARD_API
00159 void LC_Client_free(LC_CLIENT *cl);
00160 
00165 CHIPCARD_API
00166 const char *LC_Client_GetIoTypeName(const LC_CLIENT *cl);
00167 
00174 /*{@*/
00175 CHIPCARD_API
00176 const char *LC_Client_GetProgramName(const LC_CLIENT *cl);
00177 
00178 CHIPCARD_API
00179 const char *LC_Client_GetProgramVersion(const LC_CLIENT *cl);
00180 
00181 CHIPCARD_API
00182 int LC_Client_GetShortTimeout(const LC_CLIENT *cl);
00183 
00184 CHIPCARD_API
00185 int LC_Client_GetLongTimeout(const LC_CLIENT *cl);
00186 
00187 CHIPCARD_API
00188 int LC_Client_GetVeryLongTimeout(const LC_CLIENT *cl);
00196 CHIPCARD_API
00197 GWEN_XMLNODE *LC_Client_GetAppNodes(const LC_CLIENT *cl);
00198 
00199 CHIPCARD_API
00200 GWEN_XMLNODE *LC_Client_GetCardNodes(const LC_CLIENT *cl);
00201 
00202 CHIPCARD_API
00203 GWEN_DB_NODE *LC_Client_GetReaderConfig(const LC_CLIENT *cl,
00204                                         const char *reader);
00214 CHIPCARD_API
00215 LCM_MONITOR *LC_Client_GetMonitor(const LC_CLIENT *cl);
00216 
00217 CHIPCARD_API
00218 LC_CLIENT_RESULT LC_Client_SetNotify(LC_CLIENT *cl,
00219                                      GWEN_TYPE_UINT32 flags);
00220 
00221 CHIPCARD_API
00222 LC_CLIENT_RECV_NOTIFICATION_FN
00223 LC_Client_SetRecvNotificationFn(LC_CLIENT *cl,
00224                                 LC_CLIENT_RECV_NOTIFICATION_FN fn);
00228 #ifdef __cplusplus
00229 }
00230 #endif
00231 
00232 
00235 #endif /* CHIPCARD_CLIENT_CLIENT_H */
00236 
00237 
00238 

Generated on Sat Sep 22 04:43:21 2007 for libchipcard2 by  doxygen 1.5.3