(libnfc-less-bitutils-more-ponies) Get rid of bitutils.[hc] (part 1).

- New API function append_iso14443a_crc();
  - Add a PRINT_HEX macro for driver debugging (replaces print_hex function from bitutils.c);
  - Move bit-mirroring related functions to libnfc/mirror-subr.[hc];
  - Move iso14443 related functions to libnfc/iso14443-subr.c;
  - Move libnfc/bitutils.c hex-dumping code to examples/nfc-utils.c;
  - Replace calls to swap_endian32() and swap_endian64() functions with calls to bswap32() and bswap64 provided by endian.h.

And while I am here:
  - Fix the DBG macro so that it does not throw warning at compile time.
This commit is contained in:
Romain Tartiere 2010-04-16 16:38:57 +00:00
parent 5302930b09
commit 10baef235f
24 changed files with 328 additions and 343 deletions

View file

@ -38,7 +38,6 @@ Thanks to d18c7db and Okko for example code
#include <string.h>
#include "../drivers.h"
#include "../bitutils.h"
#include <nfc/nfc-messages.h>
@ -267,10 +266,9 @@ bool pn53x_usb_transceive(const nfc_device_spec_t nds, const byte_t* pbtTx, cons
abtTx[szTxLen+6] = 0;
DBG("%s","pn53x_usb_transceive");
#ifdef DEBUG
printf(" TX: ");
print_hex(abtTx,szTxLen+7);
#endif
#ifdef DEBUG
PRINT_HEX("TX", abtTx,szTxLen+7);
#endif
ret = usb_bulk_write(pus->pudh, pus->uiEndPointOut, (char*)abtTx, szTxLen+7, USB_TIMEOUT);
if( ret < 0 )
@ -286,10 +284,9 @@ bool pn53x_usb_transceive(const nfc_device_spec_t nds, const byte_t* pbtTx, cons
return false;
}
#ifdef DEBUG
printf(" RX: ");
print_hex(abtRx,ret);
#endif
#ifdef DEBUG
PRINT_HEX("RX", abtRx,ret);
#endif
if( ret == 6 )
{
@ -300,10 +297,9 @@ bool pn53x_usb_transceive(const nfc_device_spec_t nds, const byte_t* pbtTx, cons
return false;
}
#ifdef DEBUG
printf(" RX: ");
print_hex(abtRx,ret);
#endif
#ifdef DEBUG
PRINT_HEX("RX", abtRx,ret);
#endif
}
// When the answer should be ignored, just return a succesful result