summaryrefslogtreecommitdiff
path: root/openpicc
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-18 14:08:28 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-18 14:08:28 +0000
commit4911b0749c5af0c675a08934ece060571cb3d65d (patch)
treed8ee4378f99e3fad327208003d13c49ca5e2983c /openpicc
parentaf156e105101487dc5df0248c0171902867e74b9 (diff)
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
Diffstat (limited to 'openpicc')
-rw-r--r--openpicc/application/iso14443a_pretender.c12
1 files changed, 8 insertions, 4 deletions
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;
}
personal git repositories of Harald Welte. Your mileage may vary