diff options
Diffstat (limited to 'openpicc/application/iso14443a_miller.c')
-rw-r--r-- | openpicc/application/iso14443a_miller.c | 4 |
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++; } |