From 7f44cae7c1c1a7e54099655365afde4f20aeee6a Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 15 Oct 2006 19:17:22 +0000 Subject: - fix multiple include of rfid_protocol_mifare_classic.h problem - add some more layer2 {get,set}opt()s - add rfid_protocol_{get,set}opt() - export functions for l2/proto scanning, not just for combined scanning - add support for sending WUPA instead of REQA in iso14443a git-svn-id: https://svn.gnumonks.org/trunk/librfid@1910 e0336214-984f-0b4b-a45f-81c69e1f0ede --- include/librfid/rfid_layer2.h | 3 +++ include/librfid/rfid_protocol.h | 14 ++++++++++++++ include/librfid/rfid_protocol_mifare_classic.h | 1 + include/librfid/rfid_protocol_tcl.h | 5 +++++ include/librfid/rfid_scan.h | 6 ++++++ 5 files changed, 29 insertions(+) (limited to 'include') diff --git a/include/librfid/rfid_layer2.h b/include/librfid/rfid_layer2.h index 0f6f683..1ef0713 100644 --- a/include/librfid/rfid_layer2.h +++ b/include/librfid/rfid_layer2.h @@ -18,6 +18,8 @@ enum rfid_layer2_id { #define RFID_OPT_L2_PRIV 0x00010000 enum rfid_layer2_opt { RFID_OPT_LAYER2_UID = 0x0001, + RFID_OPT_LAYER2_PROTO_SUPP = 0x0002, + RFID_OPT_LAYER2_WUP = 0x0003, }; struct rfid_layer2_handle *rfid_layer2_init(struct rfid_reader_handle *rh, @@ -70,6 +72,7 @@ struct rfid_layer2_handle { unsigned char uid[10]; /* triple size 14443a id is 10 bytes */ unsigned int uid_len; unsigned int proto_supported; + unsigned int flags; union { struct iso14443a_handle iso14443a; struct iso14443b_handle iso14443b; diff --git a/include/librfid/rfid_protocol.h b/include/librfid/rfid_protocol.h index 2b02a42..446abd9 100644 --- a/include/librfid/rfid_protocol.h +++ b/include/librfid/rfid_protocol.h @@ -27,6 +27,12 @@ rfid_protocol_write(struct rfid_protocol_handle *ph, int rfid_protocol_fini(struct rfid_protocol_handle *ph); int rfid_protocol_close(struct rfid_protocol_handle *ph); +int rfid_protocol_getopt(struct rfid_protocol_handle *ph, int optname, + void *optval, unsigned int *optlen); + +int rfid_protocol_setopt(struct rfid_protocol_handle *ph, int optname, + const void *optval, unsigned int optlen); + char *rfid_protocol_name(struct rfid_protocol_handle *ph); enum rfid_protocol_id { @@ -36,6 +42,9 @@ enum rfid_protocol_id { RFID_PROTOCOL_MIFARE_CLASSIC, }; +enum rfid_protocol_opt { + RFID_OPT_PROTO_ID, +}; #ifdef __LIBRFID__ @@ -65,6 +74,11 @@ struct rfid_protocol { unsigned int page, unsigned char *tx_data, unsigned int tx_len); + int (*getopt)(struct rfid_protocol_handle *h, + int optname, void *optval, unsigned int *optlen); + int (*setopt)(struct rfid_protocol_handle *h, + int optname, const void *optval, + unsigned int optlen); } fn; }; diff --git a/include/librfid/rfid_protocol_mifare_classic.h b/include/librfid/rfid_protocol_mifare_classic.h index 06235b8..f1e1403 100644 --- a/include/librfid/rfid_protocol_mifare_classic.h +++ b/include/librfid/rfid_protocol_mifare_classic.h @@ -1,4 +1,5 @@ #ifndef _MIFARE_CLASSIC_H +#define _MIFARE_CLASSIC_H #include diff --git a/include/librfid/rfid_protocol_tcl.h b/include/librfid/rfid_protocol_tcl.h index 2ee1c27..535af11 100644 --- a/include/librfid/rfid_protocol_tcl.h +++ b/include/librfid/rfid_protocol_tcl.h @@ -1,6 +1,11 @@ #ifndef _RFID_PROTOCOL_TCL_H #define _RFID_PROTOCOL_TCL_H +enum rfid_proto_tcl_opt { + RFID_OPT_P_TCL_ATS = 0x00010001, + RFID_OPT_P_TCL_ATS_LEN = 0x00010002, +}; + #ifdef __LIBRFID__ enum tcl_transport_rate { diff --git a/include/librfid/rfid_scan.h b/include/librfid/rfid_scan.h index dcfd7bf..50910fb 100644 --- a/include/librfid/rfid_scan.h +++ b/include/librfid/rfid_scan.h @@ -5,6 +5,12 @@ #include #include +struct rfid_layer2_handle * +rfid_layer2_scan(struct rfid_reader_handle *rh); + +struct rfid_protocol_handle * +rfid_protocol_scan(struct rfid_layer2_handle *l2h); + int rfid_scan(struct rfid_reader_handle *rh, struct rfid_layer2_handle **l2h, struct rfid_protocol_handle **ph); -- cgit v1.2.3