From 091edfa6a3cd9f94aa02260830951dc1798207d3 Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 23 Oct 2005 22:29:08 +0000 Subject: - 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 --- rfid_proto_tcl.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'rfid_proto_tcl.c') 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; -- cgit v1.2.3