summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-10-20 20:15:49 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-10-20 20:15:49 +0000
commitd222d836a7a97c7164e0f96920b148d532fa574a (patch)
tree80fbd5c4138c5b91bf95a53d87ec96a35fe7fb55 /include
parent95b1a39e943eb22d73dc1ddccd1e372c1176d210 (diff)
add mifare ultralight support (incomplete)
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1543 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'include')
-rw-r--r--include/rfid/rfid_layer2_iso14443a.h2
-rw-r--r--include/rfid/rfid_protocol.h23
2 files changed, 25 insertions, 0 deletions
diff --git a/include/rfid/rfid_layer2_iso14443a.h b/include/rfid/rfid_layer2_iso14443a.h
index 400f951..9594abb 100644
--- a/include/rfid/rfid_layer2_iso14443a.h
+++ b/include/rfid/rfid_layer2_iso14443a.h
@@ -68,6 +68,8 @@ struct iso14443a_handle {
unsigned int state;
unsigned int level;
unsigned int tcl_capable;
+ unsigned int uid_len;
+ unsigned char uid[10]; /* Triple size UID is 10 bytes */
};
enum iso14443a_level {
diff --git a/include/rfid/rfid_protocol.h b/include/rfid/rfid_protocol.h
index f9db318..5172a08 100644
--- a/include/rfid/rfid_protocol.h
+++ b/include/rfid/rfid_protocol.h
@@ -16,6 +16,7 @@ struct rfid_protocol {
int (*open)(struct rfid_protocol_handle *ph);
int (*close)(struct rfid_protocol_handle *ph);
int (*fini)(struct rfid_protocol_handle *ph);
+ /* transcieve for session based transport protocols */
int (*transcieve)(struct rfid_protocol_handle *ph,
const unsigned char *tx_buf,
unsigned int tx_len,
@@ -23,6 +24,15 @@ struct rfid_protocol {
unsigned int *rx_len,
unsigned int timeout,
unsigned int flags);
+ /* read/write for synchronous memory cards */
+ int (*read)(struct rfid_protocol_handle *ph,
+ unsigned int page,
+ unsigned char *rx_data,
+ unsigned int *rx_len);
+ int (*write)(struct rfid_protocol_handle *ph,
+ unsigned int page,
+ unsigned char *tx_data,
+ unsigned int tx_len);
} fn;
};
@@ -44,6 +54,18 @@ int rfid_protocol_transcieve(struct rfid_protocol_handle *ph,
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_protocol_read(struct rfid_protocol_handle *ph,
+ unsigned int page,
+ unsigned char *rx_data,
+ unsigned int rx_len);
+
+int
+rfid_protocol_write(struct rfid_protocol_handle *ph,
+ unsigned int page,
+ unsigned char *tx_data,
+ unsigned int tx_len);
+
int rfid_protocol_fini(struct rfid_protocol_handle *ph);
int rfid_protocol_close(struct rfid_protocol_handle *ph);
@@ -52,5 +74,6 @@ int rfid_protocol_register(struct rfid_protocol *p);
enum rfid_protocol_id {
RFID_PROTOCOL_UNKNOWN,
RFID_PROTOCOL_TCL,
+ RFID_PROTOCOL_MIFARE_UL,
};
#endif
personal git repositories of Harald Welte. Your mileage may vary