summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-10-15 19:17:22 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-10-15 19:17:22 +0000
commit7f44cae7c1c1a7e54099655365afde4f20aeee6a (patch)
tree2214b97f6172e0d3446f04f50003a55c356a2983 /include
parent966a8e3acc6244025d265db0af5e20365566f2a4 (diff)
- 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
Diffstat (limited to 'include')
-rw-r--r--include/librfid/rfid_layer2.h3
-rw-r--r--include/librfid/rfid_protocol.h14
-rw-r--r--include/librfid/rfid_protocol_mifare_classic.h1
-rw-r--r--include/librfid/rfid_protocol_tcl.h5
-rw-r--r--include/librfid/rfid_scan.h6
5 files changed, 29 insertions, 0 deletions
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 <librfid/rfid_protocol.h>
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 <librfid/rfid_layer2.h>
#include <librfid/rfid_protocol.h>
+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);
personal git repositories of Harald Welte. Your mileage may vary