summaryrefslogtreecommitdiff
path: root/openpicc/application/iso14443a_manchester.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-02 06:16:31 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-02 06:16:31 +0000
commitfa61e60d06e7a50fd3d681822a5f637f14582d80 (patch)
treeaa67e824b8edeb1c0521933542956863b2752cd2 /openpicc/application/iso14443a_manchester.c
parentc68c113ee8e1357c718bc492078d41b52dae4767 (diff)
Commit status quo. Partly or severely broken.
git-svn-id: https://svn.openpcd.org:2342/trunk@402 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/iso14443a_manchester.c')
-rw-r--r--openpicc/application/iso14443a_manchester.c8
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;
personal git repositories of Harald Welte. Your mileage may vary