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);
38 int (*rf_power)(struct rfid_reader_handle *h, int on);
40 struct rfid_14443a_reader {
41 int (*init)(struct rfid_reader_handle *h);
42 int (*transceive_sf)(struct rfid_reader_handle *h,
44 struct iso14443a_atqa *atqa);
45 int (*transceive_acf)(struct rfid_reader_handle *h,
46 struct iso14443a_anticol_cmd *cmd,
47 unsigned int *bit_of_col);
48 int (*set_speed)(struct rfid_reader_handle *h,
53 struct rfid_14443b_reader {
54 int (*init)(struct rfid_reader_handle *rh);
57 struct rfid_15693_reader {
58 int (*init)(struct rfid_reader_handle *rh);
60 struct rfid_mifare_classic_reader {
61 int (*setkey)(struct rfid_reader_handle *h, const unsigned char *key);
62 int (*auth)(struct rfid_reader_handle *h, u_int8_t cmd,
63 u_int32_t serno, u_int8_t block);
74 struct rfid_reader_handle {
75 struct rfid_asic_handle *ah;
80 const struct rfid_reader *reader;
83 extern struct rfid_reader_handle *
84 rfid_reader_open(void *data, unsigned int id);
86 extern void rfid_reader_close(struct rfid_reader_handle *rh);