summaryrefslogtreecommitdiff
path: root/include/rfid/rfid_layer2.h
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-05-29 18:05:31 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-05-29 18:05:31 +0000
commitb0fef13efe84d8601a9496098429b4a080e20c9e (patch)
tree3439f4cb8ce60a622eb2b372b8c7e92068f2f654 /include/rfid/rfid_layer2.h
move librfid to new location in repository
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1181 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'include/rfid/rfid_layer2.h')
-rw-r--r--include/rfid/rfid_layer2.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/include/rfid/rfid_layer2.h b/include/rfid/rfid_layer2.h
new file mode 100644
index 0000000..40b9bff
--- /dev/null
+++ b/include/rfid/rfid_layer2.h
@@ -0,0 +1,56 @@
+#ifndef _RFID_LAYER2_H
+#define _RFID_LAYER2_H
+
+struct rfid_layer2_handle;
+struct rfid_reader_handle;
+
+#include <rfid/rfid_layer2_iso14443a.h>
+#include <rfid/rfid_layer2_iso14443b.h>
+
+
+struct rfid_layer2 {
+ unsigned int id;
+ char *name;
+
+ struct {
+ struct rfid_layer2_handle *(*init)(struct rfid_reader_handle *h);
+ int (*open)(struct rfid_layer2_handle *h);
+ int (*transcieve)(struct rfid_layer2_handle *h,
+ const unsigned char *tx_buf,
+ unsigned int tx_len, unsigned char *rx_buf,
+ unsigned int *rx_len, unsigned int timeout,
+ unsigned int flags);
+ int (*close)(struct rfid_layer2_handle *h);
+ int (*fini)(struct rfid_layer2_handle *h);
+ } fn;
+ struct rfid_layer2 *next;
+};
+
+struct rfid_layer2_handle {
+ struct rfid_reader_handle *rh;
+ union {
+ struct iso14443a_handle iso14443a;
+ struct iso14443b_handle iso14443b;
+ //struct iso15693_handle iso15693;
+ } priv;
+ struct rfid_layer2 *l2;
+};
+
+enum rfid_layer2_id {
+ RFID_LAYER2_NONE,
+ RFID_LAYER2_ISO14443A,
+ RFID_LAYER2_ISO14443B,
+ RFID_LAYER2_ISO15693,
+};
+
+struct rfid_layer2_handle *rfid_layer2_init(struct rfid_reader_handle *rh,
+ unsigned int id);
+int rfid_layer2_open(struct rfid_layer2_handle *l2h);
+int rfid_layer2_transcieve(struct rfid_layer2_handle *l2h,
+ const unsigned char *tx_buf, unsigned int tx_len,
+ unsigned char *rx_buf, unsigned int *rx_len,
+ unsigned int timeout, unsigned int flags);
+int rfid_layer2_close(struct rfid_layer2_handle *l2h);
+int rfid_layer2_fini(struct rfid_layer2_handle *l2h);
+
+#endif
personal git repositories of Harald Welte. Your mileage may vary