00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef CHIPCARD_SERVER_DM_READER_L_H
00015 #define CHIPCARD_SERVER_DM_READER_L_H
00016
00017
00018 #include <gwenhywfar/db.h>
00019 #include <gwenhywfar/misc.h>
00020
00021 #include <chipcard/chipcard.h>
00022 #include "common/reader.h"
00023 #include "lockmanager_l.h"
00024
00025 #include <time.h>
00026
00027 #include <chipcard/chipcard.h>
00028 #include "devicemanager_l.h"
00029 #include "dm_driver_l.h"
00030 #include "dm_slot_l.h"
00031
00032
00033 LCCO_READER *LCDM_Reader_new(LCDM_DRIVER *d, int slots);
00034 LCCO_READER *LCDM_Reader_fromDb(LCDM_DRIVER *d, GWEN_DB_NODE *db);
00035
00036 LCDM_DRIVER *LCDM_Reader_GetDriver(const LCCO_READER *r);
00037
00038 void LCDM_Reader_SetTimeout(LCCO_READER *r, int secs);
00039 int LCDM_Reader_CheckTimeout(const LCCO_READER *r);
00040
00041 uint32_t LCDM_Reader_GetUsageCount(const LCCO_READER *r);
00042 void LCDM_Reader_IncUsageCount(LCCO_READER *r, int count);
00043 void LCDM_Reader_DecUsageCount(LCCO_READER *r, int count);
00044 time_t LCDM_Reader_GetIdleSince(const LCCO_READER *r);
00045
00046 uint32_t LCDM_Reader_GetCurrentRequestId(const LCCO_READER *r);
00047 void LCDM_Reader_SetCurrentRequestId(LCCO_READER *r, uint32_t rid);
00048
00049
00050 LCS_LOCKMANAGER *LCDM_Reader_GetLockManager(const LCCO_READER *r, int slot);
00051
00052 uint32_t LCDM_Reader_LockReader(LCCO_READER *r,
00053 uint32_t clid,
00054 int maxLockTime,
00055 int maxLockCount);
00056 int LCDM_Reader_CheckLockRequest(LCCO_READER *r,
00057 uint32_t reqid);
00058 int LCDM_Reader_RemoveLockRequest(LCCO_READER *r,
00059 uint32_t rqid);
00060
00061 int LCDM_Reader_CheckLockAccess(LCCO_READER *r,
00062 uint32_t rqid);
00063
00064 int LCDM_Reader_Unlock(LCCO_READER *r, uint32_t rqid);
00065
00066
00067
00068
00069
00070 #endif
00071
00072