summaryrefslogtreecommitdiff
path: root/openpicc/application/iso14443_layer3a.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-15 17:13:26 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-15 17:13:26 +0000
commit40bf6fbf1a821fdb0891ed7c0989d1a3548d503a (patch)
treecd9bca4a88562ea7449e01e2cbd4ef10b4d7b318 /openpicc/application/iso14443_layer3a.c
parent91d960e6945a1bb8e70e41d62fbb3be93b16f989 (diff)
Further the distinction between SSC and PDC transfersize
Add convenient access to the last data bit from the miller decoder for type a frames git-svn-id: https://svn.openpcd.org:2342/trunk@391 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/iso14443_layer3a.c')
-rw-r--r--openpicc/application/iso14443_layer3a.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/openpicc/application/iso14443_layer3a.c b/openpicc/application/iso14443_layer3a.c
index e3ce769..57a7c23 100644
--- a/openpicc/application/iso14443_layer3a.c
+++ b/openpicc/application/iso14443_layer3a.c
@@ -43,7 +43,7 @@
static enum ISO14443_STATES state = STARTING_UP;
const iso14443_frame ATQA_FRAME = {
TYPE_A,
- {{STANDARD_FRAME, PARITY}},
+ {{STANDARD_FRAME, PARITY, ISO14443A_LAST_BIT_NONE}},
2,
0, 0,
{4, 0},
@@ -52,7 +52,7 @@ const iso14443_frame ATQA_FRAME = {
const iso14443_frame NULL_FRAME = {
TYPE_A,
- {{STANDARD_FRAME, PARITY}},
+ {{STANDARD_FRAME, PARITY, ISO14443A_LAST_BIT_NONE}},
4,
0, 0,
//{0xF3, 0xFB, 0xAE, 0xED},
@@ -66,8 +66,8 @@ const iso14443_frame NULL_FRAME = {
#define LAYER3_DEBUG usb_print_string
-#define INITIAL_STATE IDLE
-//#define INITIAL_STATE ACTIVE
+//#define INITIAL_STATE IDLE
+#define INITIAL_STATE ACTIVE
#if INITIAL_STATE == IDLE
#define INITIAL_FRAME ATQA_FRAME
@@ -307,12 +307,14 @@ void iso14443_layer3a_state_machine (void *pvParameters)
vLedBlinkGreen();
if(1) {
int i = usb_print_set_default_flush(0);
- DumpBufferToUSB((char*)buffer->data, buffer->len/8);
+ DumpBufferToUSB((char*)buffer->data, (buffer->len+7)/8);
DumpStringToUSB(" Decoded: ");
DumpUIntToUSB(buffer->len);
DumpStringToUSB(" ");
- iso14443a_decode_miller(&received_frame, buffer->data, buffer->len/8);
+ iso14443a_decode_miller(&received_frame, buffer->data, (buffer->len+7)/8);
DumpBufferToUSB((char*)received_frame.data, received_frame.numbytes + (received_frame.numbits+7)/8);
+ DumpStringToUSB(" ");
+ DumpUIntToUSB(received_frame.parameters.a.last_bit);
DumpStringToUSB("\n\r");
usb_print_set_default_flush(i);
}
personal git repositories of Harald Welte. Your mileage may vary