diff options
Diffstat (limited to 'openpicc/application/iso14443a_manchester.c')
-rw-r--r-- | openpicc/application/iso14443a_manchester.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/openpicc/application/iso14443a_manchester.c b/openpicc/application/iso14443a_manchester.c index 4093d57..303491f 100644 --- a/openpicc/application/iso14443a_manchester.c +++ b/openpicc/application/iso14443a_manchester.c @@ -106,12 +106,18 @@ int manchester_encode(u_int8_t *sample_buf, u_int16_t sample_buf_len, /* One bit data is 16 bit is 2 byte modulation data */ enc_size = 2*2 /* SOF and EOF */ + frame->numbytes * 8 * 2 - + ((frame->parameters.a.parity != NO_PARITY) ? 1 : 0)*8*2; + + ((frame->parameters.a.parity != NO_PARITY) ? 1 : 0)*8*2 + + 6; if (sample_buf_len < enc_size) return -EINVAL; + memset(sample_buf, 0, enc_size); + samples16 = (u_int16_t*)sample_buf; + (*samples16) = 5; + samples16+=2; // SSC workaround + //*(samples16++) = 0xb; /* SOF */ *(samples16++) = MANCHESTER_SEQ_D; |