From d3bab6e9439b7161b7724df0cc902f4adcf1ecce Mon Sep 17 00:00:00 2001 From: henryk Date: Mon, 3 Mar 2008 09:18:19 +0000 Subject: Implement transmission Implement a 'pretender' for PoC: Since Rx is not working properly we'll just pretend to have received something based on the approximate length. Clarify length calculations in machester encoder and remove obsolete test code git-svn-id: https://svn.openpcd.org:2342/trunk@437 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/iso14443a_manchester.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'openpicc/application/iso14443a_manchester.c') diff --git a/openpicc/application/iso14443a_manchester.c b/openpicc/application/iso14443a_manchester.c index 303491f..e8640fa 100644 --- a/openpicc/application/iso14443a_manchester.c +++ b/openpicc/application/iso14443a_manchester.c @@ -104,10 +104,10 @@ int manchester_encode(u_int8_t *sample_buf, u_int16_t sample_buf_len, if(frame->parameters.a.format != STANDARD_FRAME) return -EINVAL; /* AC not implemented yet */ /* 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 - + 6; + enc_size = 1 /* SOF */ + + frame->numbytes * ((frame->parameters.a.parity != NO_PARITY) ? 9 : 8) /* bits per byte */ + + 1 /* EOF */; + enc_size = enc_size /* in bits */ * 2 /* bytes modulation data per bit raw data*/; if (sample_buf_len < enc_size) return -EINVAL; @@ -115,9 +115,6 @@ int manchester_encode(u_int8_t *sample_buf, u_int16_t sample_buf_len, 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