(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:
parent
5302930b09
commit
10baef235f
24 changed files with 328 additions and 343 deletions
|
|
@ -33,10 +33,12 @@
|
|||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/endian.h>
|
||||
|
||||
#include <nfc/nfc.h>
|
||||
|
||||
#include <nfc/nfc-messages.h>
|
||||
#include "bitutils.h"
|
||||
#include "nfc-utils.h"
|
||||
|
||||
#define SAK_FLAG_ATS_SUPPORTED 0x20
|
||||
|
||||
|
|
@ -200,9 +202,9 @@ int main(int argc,char* argv[])
|
|||
printf("\nFound tag with UID: ");
|
||||
if (szUidLen == 4)
|
||||
{
|
||||
printf("%08x\n",swap_endian32(abtUid));
|
||||
printf("%08x\n", bswap32( *((uint32_t *)&abtUid)));
|
||||
} else {
|
||||
printf("%014llx\n",swap_endian64(abtUid)&0x00ffffffffffffffull);
|
||||
printf("%014llx\n",bswap64(*((uint64_t *) &abtUid))&0x00ffffffffffffffull);
|
||||
}
|
||||
|
||||
nfc_disconnect(pnd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue