5 #include <librfid/rfid.h>
7 struct rfid_layer2_handle;
8 struct rfid_reader_handle;
12 RFID_LAYER2_ISO14443A,
13 RFID_LAYER2_ISO14443B,
17 struct rfid_layer2_handle *rfid_layer2_init(struct rfid_reader_handle *rh,
19 int rfid_layer2_open(struct rfid_layer2_handle *l2h);
20 int rfid_layer2_transcieve(struct rfid_layer2_handle *l2h,
21 enum rfid_frametype frametype,
22 const unsigned char *tx_buf, unsigned int tx_len,
23 unsigned char *rx_buf, unsigned int *rx_len,
24 u_int64_t timeout, unsigned int flags);
25 int rfid_layer2_close(struct rfid_layer2_handle *l2h);
26 int rfid_layer2_fini(struct rfid_layer2_handle *l2h);
27 int rfid_layer2_getopt(struct rfid_layer2_handle *ph, int optname,
28 void *optval, unsigned int *optlen);
29 int rfid_layer2_setopt(struct rfid_layer2_handle *ph, int optname,
30 const void *optval, unsigned int optlen);
34 #include <librfid/rfid_layer2_iso14443a.h>
35 #include <librfid/rfid_layer2_iso14443b.h>
36 #include <librfid/rfid_layer2_iso15693.h>
43 struct rfid_layer2_handle *(*init)(struct rfid_reader_handle *h);
44 int (*open)(struct rfid_layer2_handle *h);
45 int (*transcieve)(struct rfid_layer2_handle *h,
46 enum rfid_frametype frametype,
47 const unsigned char *tx_buf,
48 unsigned int tx_len, unsigned char *rx_buf,
49 unsigned int *rx_len, u_int64_t timeout,
51 int (*close)(struct rfid_layer2_handle *h);
52 int (*fini)(struct rfid_layer2_handle *h);
53 int (*getopt)(struct rfid_layer2_handle *h,
54 int optname, void *optval, unsigned int *optlen);
55 int (*setopt)(struct rfid_layer2_handle *h,
56 int optname, const void *optval,
59 struct rfid_layer2 *next;
62 struct rfid_layer2_handle {
63 struct rfid_reader_handle *rh;
64 unsigned char uid[10]; /* triple size 14443a id is 10 bytes */
67 struct iso14443a_handle iso14443a;
68 struct iso14443b_handle iso14443b;
69 struct iso15693_handle iso15693;
71 struct rfid_layer2 *l2;
74 #endif /* __LIBRFID__ */