From 18d31cd672bbc07a4b163f0e1f7151b9817785ea Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Mon, 6 Sep 2010 10:02:19 +0000 Subject: [PATCH] Reintroduce oddparity() function used by project based on libnfc but in nfc-utils.[ch] to prevent from exporting them in API. --- examples/nfc-utils.c | 15 +++++++++++++++ examples/nfc-utils.h | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/examples/nfc-utils.c b/examples/nfc-utils.c index 2626760..33063c8 100644 --- a/examples/nfc-utils.c +++ b/examples/nfc-utils.c @@ -21,6 +21,21 @@ static const byte_t OddParity[256] = { 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1 }; +byte_t oddparity(const byte_t bt) +{ + return OddParity[bt]; +} + +void oddparity_bytes_ts(const byte_t* pbtData, const size_t szLen, byte_t* pbtPar) +{ + size_t szByteNr; + // Calculate the parity bits for the command + for (szByteNr=0; szByteNr #include +byte_t oddparity(const byte_t bt); +void oddparity_byte_ts(const byte_t* pbtData, const size_t szLen, byte_t* pbtPar); void print_hex(const byte_t* pbtData, const size_t szLen); void print_hex_bits(const byte_t* pbtData, const size_t szBits);