4 #include <librfid/rfid_asic.h>
5 #include <librfid/rfid_layer2_iso14443a.h>
6 #include <librfid/rfid_layer2_iso15693.h>
8 struct rfid_reader_handle;
13 unsigned int l2_supported;
14 unsigned int proto_supported;
16 int (*get_api_version)(
17 struct rfid_reader_handle *h,
20 int (*get_environment)(
21 struct rfid_reader_handle *rh,
22 unsigned char num_bytes,
25 int (*set_environment)(
26 struct rfid_reader_handle *rh,
27 unsigned char num_bytes,
28 const unsigned char *buf);
30 int (*reset)(struct rfid_reader_handle *h);
32 int (*transceive)(struct rfid_reader_handle *h,
33 enum rfid_frametype frametype,
34 const unsigned char *tx_buf, unsigned int tx_len,
35 unsigned char *rx_buf, unsigned int *rx_len,
36 u_int64_t timeout, unsigned int flags);
37 struct rfid_reader_handle * (*open)(void *data);
38 void (*close)(struct rfid_reader_handle *h);
39 int (*rf_power)(struct rfid_reader_handle *h, int on);
41 struct rfid_14443a_reader {
42 int (*init)(struct rfid_reader_handle *h);
43 int (*transceive_sf)(struct rfid_reader_handle *h,
45 struct iso14443a_atqa *atqa);
46 int (*transceive_acf)(struct rfid_reader_handle *h,
47 struct iso14443a_anticol_cmd *cmd,
48 unsigned int *bit_of_col);
49 int (*set_speed)(struct rfid_reader_handle *h,
54 struct rfid_14443b_reader {
55 int (*init)(struct rfid_reader_handle *rh);
58 struct rfid_15693_reader {
59 int (*init)(struct rfid_reader_handle *rh);
60 int (*transceive_ac)(struct rfid_reader_handle *h,
61 struct iso15693_anticol_cmd *acf,
65 struct rfid_mifare_classic_reader {
66 int (*setkey)(struct rfid_reader_handle *h, const unsigned char *key);
67 int (*auth)(struct rfid_reader_handle *h, u_int8_t cmd,
68 u_int32_t serno, u_int8_t block);
79 struct rfid_reader_handle {
80 struct rfid_asic_handle *ah;
85 const struct rfid_reader *reader;
88 extern struct rfid_reader_handle *
89 rfid_reader_open(void *data, unsigned int id);
91 extern void rfid_reader_close(struct rfid_reader_handle *rh);