From fa61e60d06e7a50fd3d681822a5f637f14582d80 Mon Sep 17 00:00:00 2001 From: henryk Date: Sat, 2 Feb 2008 06:16:31 +0000 Subject: Commit status quo. Partly or severely broken. git-svn-id: https://svn.openpcd.org:2342/trunk@402 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/iso14443a_manchester.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'openpicc/application/iso14443a_manchester.c') 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; -- cgit v1.2.3