diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-12-15 12:52:35 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-12-15 12:52:35 +0000 |
commit | bcc75d30ce0fb09618f82bb70cdde82094e86ed8 (patch) | |
tree | 88a5f5859842ccd5215607914c4e3e231cd27899 /openpicc/application/iso14443_layer3a.c | |
parent | 5a29168eaddaaa47909f2ae84c41d0743996215f (diff) |
Fix consistency check
Fix miller decoder for the case of a buffer containing only zeroes
git-svn-id: https://svn.openpcd.org:2342/trunk@388 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/iso14443_layer3a.c')
-rw-r--r-- | openpicc/application/iso14443_layer3a.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/openpicc/application/iso14443_layer3a.c b/openpicc/application/iso14443_layer3a.c index 7d91250..b9ee0b9 100644 --- a/openpicc/application/iso14443_layer3a.c +++ b/openpicc/application/iso14443_layer3a.c @@ -297,6 +297,17 @@ void iso14443_layer3a_state_machine (void *pvParameters) main_help_print_buffer(buffer, &pktcount); } vLedBlinkGreen(); + if(1) { + int i = usb_print_set_default_flush(0); + DumpBufferToUSB((char*)buffer->data, buffer->len/8); + DumpStringToUSB(" Decoded: "); + DumpUIntToUSB(buffer->len); + DumpStringToUSB(" "); + iso14443a_decode_miller(&received_frame, buffer->data, buffer->len/8); + DumpBufferToUSB((char*)received_frame.data, received_frame.numbytes + (received_frame.numbits+7)/8); + DumpStringToUSB("\n\r"); + usb_print_set_default_flush(i); + } switch(state) { case IDLE: @@ -309,14 +320,6 @@ void iso14443_layer3a_state_machine (void *pvParameters) LAYER3_DEBUG(", woke up to send ATQA\n\r"); atqa_sent = 0; } - if(1) { - DumpStringToUSB("Decoded: "); - DumpUIntToUSB(buffer->len); - DumpStringToUSB(" "); - iso14443a_decode_miller(&received_frame, buffer->data, buffer->len/8); - DumpBufferToUSB((char*)received_frame.data, received_frame.numbytes + (received_frame.numbits+7)/8); - DumpStringToUSB("\n\r"); - } /* For debugging, wait 1ms, then wait for another frame * Normally we'd go to anticol from here*/ vTaskDelay(portTICK_RATE_MS); @@ -330,12 +333,6 @@ void iso14443_layer3a_state_machine (void *pvParameters) break; case ACTIVE: case ACTIVE_STAR: -#if 0 - DumpStringToUSB("Decoded: "); - decoder_decode(DECODER_MILLER, (const char*)buffer->data, buffer->len, received_buffer); - DumpBufferToUSB((char*)received_buffer, 100); - DumpStringToUSB("\n\r"); -#endif /* Wait for another frame */ if(0) { ssc_rx_mode_set(SSC_MODE_14443A_STANDARD); |