X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Flibrfid%2Frfid_reader.h;h=af2f4be8d0744a64f8edc90874dd161f091b9336;hb=855cc21b1a500fa4b8f7ecbc4f745dd7e02b4691;hp=3581cc121631e6729f5097678e5d420ae09eac6a;hpb=1fcc35aad699f3d40ca786b99c7255cf8aa55892;p=librfid diff --git a/include/librfid/rfid_reader.h b/include/librfid/rfid_reader.h index 3581cc1..af2f4be 100644 --- a/include/librfid/rfid_reader.h +++ b/include/librfid/rfid_reader.h @@ -9,7 +9,26 @@ struct rfid_reader_handle; struct rfid_reader { char *name; unsigned int id; - int (*transcieve)(struct rfid_reader_handle *h, + unsigned int l2_supported; + unsigned int proto_supported; + + int (*get_api_version)( + struct rfid_reader_handle *h, + u_int8_t *version); + + int (*get_environment)( + struct rfid_reader_handle *rh, + unsigned char num_bytes, + unsigned char *buf); + + int (*set_environment)( + struct rfid_reader_handle *rh, + unsigned char num_bytes, + const unsigned char *buf); + + int (*reset)(struct rfid_reader_handle *h); + + int (*transceive)(struct rfid_reader_handle *h, enum rfid_frametype frametype, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, unsigned int *rx_len, @@ -19,10 +38,10 @@ struct rfid_reader { struct rfid_14443a_reader { int (*init)(struct rfid_reader_handle *h); - int (*transcieve_sf)(struct rfid_reader_handle *h, + int (*transceive_sf)(struct rfid_reader_handle *h, unsigned char cmd, struct iso14443a_atqa *atqa); - int (*transcieve_acf)(struct rfid_reader_handle *h, + int (*transceive_acf)(struct rfid_reader_handle *h, struct iso14443a_anticol_cmd *cmd, unsigned int *bit_of_col); int (*set_speed)(struct rfid_reader_handle *h, @@ -38,16 +57,16 @@ struct rfid_reader { int (*init)(struct rfid_reader_handle *rh); } iso15693; struct rfid_mifare_classic_reader { - int (*setkey)(struct rfid_reader_handle *h, unsigned char *key); + int (*setkey)(struct rfid_reader_handle *h, const unsigned char *key); int (*auth)(struct rfid_reader_handle *h, u_int8_t cmd, u_int32_t serno, u_int8_t block); } mifare_classic; - struct rfid_reader *next; }; enum rfid_reader_id { RFID_READER_CM5121, RFID_READER_PEGODA, + RFID_READER_OPENPCD, }; struct rfid_reader_handle { @@ -59,7 +78,6 @@ struct rfid_reader_handle { struct rfid_reader *reader; }; - extern struct rfid_reader_handle * rfid_reader_open(void *data, unsigned int id);