From 4911b0749c5af0c675a08934ece060571cb3d65d Mon Sep 17 00:00:00 2001 From: henryk Date: Tue, 18 Mar 2008 14:08:28 +0000 Subject: Actually use the received data for the decision whether to send anticol frames git-svn-id: https://svn.openpcd.org:2342/trunk@464 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/iso14443a_pretender.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'openpicc') diff --git a/openpicc/application/iso14443a_pretender.c b/openpicc/application/iso14443a_pretender.c index f4337fc..50b4bde 100644 --- a/openpicc/application/iso14443a_pretender.c +++ b/openpicc/application/iso14443a_pretender.c @@ -104,16 +104,20 @@ static void fast_receive_callback(ssc_dma_rx_buffer_t *buffer, iso14443_frame *f if(cv < 870) /* Anticollision is time-critical, do not even try to send if we're too late anyway */ switch(BYTES_AND_BITS(frame->numbytes,frame->numbits)) { - case BYTES_AND_BITS(0, 7): /* REQA (7 bits) */ - tx_buffer = &ATQA_BUFFER; + case BYTES_AND_BITS(0, 7): /* REQA or WUPA (7 bits) */ + if(frame->data[0] == 0x26 || frame->data[0] == 0x52) + tx_buffer = &ATQA_BUFFER; fdt += 9*128; break; case BYTES_AND_BITS(2, 0): /* ANTICOL (2 bytes) */ - tx_buffer = &UID_BUFFER; + if(frame->data[0] == 0x93 && frame->data[1] == 0x20) + tx_buffer = &UID_BUFFER; fdt += 9*128; break; case BYTES_AND_BITS(9, 0): /* SELECT (9 bytes) */ - tx_buffer = &ATS_BUFFER; + if(frame->data[0] == 0x93 && frame->data[1] == 0x70 && frame->parameters.a.crc && + ( *((u_int32_t*)&frame->data[2]) == *((u_int32_t*)&UID) ) ) + tx_buffer = &ATS_BUFFER; fdt += 9*128; break; } -- cgit v1.2.3