4 #include <librfid/rfid_asic.h>
5 #include <librfid/rfid_layer2_iso14443a.h>
7 struct rfid_reader_handle;
12 unsigned int l2_supported;
13 unsigned int proto_supported;
15 int (*get_api_version)(
16 struct rfid_reader_handle *h,
19 int (*get_environment)(
20 struct rfid_reader_handle *rh,
21 unsigned char num_bytes,
24 int (*set_environment)(
25 struct rfid_reader_handle *rh,
26 unsigned char num_bytes,
27 const unsigned char *buf);
29 int (*reset)(struct rfid_reader_handle *h);
31 int (*transceive)(struct rfid_reader_handle *h,
32 enum rfid_frametype frametype,
33 const unsigned char *tx_buf, unsigned int tx_len,
34 unsigned char *rx_buf, unsigned int *rx_len,
35 u_int64_t timeout, unsigned int flags);
36 struct rfid_reader_handle * (*open)(void *data);
37 void (*close)(struct rfid_reader_handle *h);
39 struct rfid_14443a_reader {
40 int (*init)(struct rfid_reader_handle *h);
41 int (*transceive_sf)(struct rfid_reader_handle *h,
43 struct iso14443a_atqa *atqa);
44 int (*transceive_acf)(struct rfid_reader_handle *h,
45 struct iso14443a_anticol_cmd *cmd,
46 unsigned int *bit_of_col);
47 int (*set_speed)(struct rfid_reader_handle *h,
52 struct rfid_14443b_reader {
53 int (*init)(struct rfid_reader_handle *rh);
56 struct rfid_15693_reader {
57 int (*init)(struct rfid_reader_handle *rh);
59 struct rfid_mifare_classic_reader {
60 int (*setkey)(struct rfid_reader_handle *h, const unsigned char *key);
61 int (*auth)(struct rfid_reader_handle *h, u_int8_t cmd,
62 u_int32_t serno, u_int8_t block);
72 struct rfid_reader_handle {
73 struct rfid_asic_handle *ah;
78 struct rfid_reader *reader;
81 extern struct rfid_reader_handle *
82 rfid_reader_open(void *data, unsigned int id);
84 extern void rfid_reader_close(struct rfid_reader_handle *rh);