summaryrefslogtreecommitdiff
path: root/rfid_proto_tcl.c
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-10-23 22:29:08 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-10-23 22:29:08 +0000
commit091edfa6a3cd9f94aa02260830951dc1798207d3 (patch)
tree4bb63dec06e773caca0cf9b9b7a3197849f6ae71 /rfid_proto_tcl.c
parent6d7f1185f88ea5c788d0f7b113db8e2b98ca6336 (diff)
- fix CRC issue (cl632 now removes crc from end of frame)
- make TCL implementation use correct frame type for both 14443a/b git-svn-id: https://svn.gnumonks.org/trunk/librfid@1562 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'rfid_proto_tcl.c')
-rw-r--r--rfid_proto_tcl.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/rfid_proto_tcl.c b/rfid_proto_tcl.c
index 2451b1d..102c58f 100644
--- a/rfid_proto_tcl.c
+++ b/rfid_proto_tcl.c
@@ -36,6 +36,18 @@
#include "rfid_iso14443_common.h"
+static enum rfid_frametype l2_to_frame(unsigned int layer2)
+{
+ switch (layer2) {
+ case RFID_LAYER2_ISO14443A:
+ return RFID_14443A_FRAME_REGULAR;
+ break;
+ case RFID_LAYER2_ISO14443B:
+ return RFID_14443B_FRAME_REGULAR;
+ break;
+ }
+ return 0;
+}
static unsigned int sfgi_to_sfgt(struct rfid_protocol_handle *h,
unsigned char sfgi)
@@ -502,16 +514,13 @@ tcl_transcieve(struct rfid_protocol_handle *h,
*rx_len = 0;
do_tx:
- ret = h->l2h->l2->fn.transcieve(h->l2h, RFID_14443A_FRAME_REGULAR,
+ ret = h->l2h->l2->fn.transcieve(h->l2h, l2_to_frame(h->l2h->l2->id),
_tx, _tx_len,
rx_buf, &_rx_len, _timeout, 0);
DEBUGP("l2 transcieve finished\n");
if (ret < 0)
goto out_rxb;
- if (_rx_len >= 2)
- _rx_len -= 2; /* CRC is not removed by ASIC ?!? */
-
if ((*rx_buf & 0x01) != h->priv.tcl.toggle) {
DEBUGP("response with wrong toggle bit\n");
goto out_rxb;
personal git repositories of Harald Welte. Your mileage may vary