Reintroduce oddparity() function used by project based on libnfc but in nfc-utils.[ch] to prevent from exporting them in API.

This commit is contained in:
Romuald Conty 2010-09-06 10:02:19 +00:00
parent 190b52c4cd
commit 18d31cd672
2 changed files with 18 additions and 1 deletions

View file

@ -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<szLen; szByteNr++)
{
pbtPar[szByteNr] = OddParity[pbtData[szByteNr]];
}
}
void print_hex(const byte_t* pbtData, const size_t szBytes)
{
size_t szPos;