summaryrefslogtreecommitdiff
path: root/openpicc/application/iso14443a_miller.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/iso14443a_miller.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/iso14443a_miller.c')
-rw-r--r--openpicc/application/iso14443a_miller.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openpicc/application/iso14443a_miller.c b/openpicc/application/iso14443a_miller.c
index 16f0c89..d7c24cd 100644
--- a/openpicc/application/iso14443a_miller.c
+++ b/openpicc/application/iso14443a_miller.c
@@ -51,7 +51,7 @@ enum miller_sequence {
int iso14443a_decode_miller(iso14443_frame *frame,
const u_int8_t *sample_buf, const u_int16_t sample_buf_len)
{
- signed int i, j, bit = 0, last_bit = -1;
+ signed int i, j, bit = 0, last_bit = -1, next_to_last_bit = 0;
enum miller_sequence current_seq;
unsigned int bitpos = 0;
@@ -88,6 +88,7 @@ int iso14443a_decode_miller(iso14443_frame *frame,
switch(bit) {
case BIT_ENDMARKER:
bitpos-=2; /* Subtract this sequence and the previous sequence (which was a 0) */
+ frame->parameters.a.last_bit = next_to_last_bit;
break;
case 0: /* Fall-through */
case 1: {
@@ -100,6 +101,7 @@ int iso14443a_decode_miller(iso14443_frame *frame,
}
}
+ next_to_last_bit = last_bit;
last_bit = bit;
bitpos++;
}
personal git repositories of Harald Welte. Your mileage may vary