summaryrefslogtreecommitdiff
path: root/openpicc/application/iso14443_layer3a.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-24 07:59:42 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-24 07:59:42 +0000
commit29ea5bbf5b9c3b3679aa40e4ee7029284cb424c6 (patch)
tree0e20e9c665d05c228684e815ca142c0814057a80 /openpicc/application/iso14443_layer3a.c
parent341b884abc8c29790dfffab1921a1f4fa127d62d (diff)
Add load modulation and encoding/decoding code from harald
git-svn-id: https://svn.openpcd.org:2342/trunk@351 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/iso14443_layer3a.c')
-rw-r--r--openpicc/application/iso14443_layer3a.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/openpicc/application/iso14443_layer3a.c b/openpicc/application/iso14443_layer3a.c
index 8dd9cd2..841ad14 100644
--- a/openpicc/application/iso14443_layer3a.c
+++ b/openpicc/application/iso14443_layer3a.c
@@ -130,17 +130,26 @@ void iso14443_layer3a_state_machine (void *pvParameters)
portENTER_CRITICAL();
buffer->state = PROCESSING;
portEXIT_CRITICAL();
+ u_int32_t first_sample = *(u_int32_t*)buffer->data;
DumpStringToUSB("Frame: ");
- DumpUIntToUSB(*(u_int32_t*)buffer->data);
+ DumpUIntToUSB(first_sample);
DumpStringToUSB(" ");
main_help_print_buffer(buffer, &pktcount);
switch(state) {
case IDLE:
case HALT:
- ssc_rx_mode_set(SSC_MODE_14443A_SHORT);
- ssc_rx_start();
+ if(first_sample == WUPA || (state==IDLE && first_sample==REQA)) {
+ /* Need to transmit ATQA */
+ LAYER3_DEBUG("Received ");
+ LAYER3_DEBUG(first_sample == WUPA ? "WUPA" : "REQA");
+ LAYER3_DEBUG(" waking up to send ATQA\n\r");
+ } else {
+ /* Wait for another frame */
+ ssc_rx_mode_set(SSC_MODE_14443A_SHORT);
+ ssc_rx_start();
+ }
break;
default:
break;
personal git repositories of Harald Welte. Your mileage may vary