mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-10 17:43:49 +00:00
(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:
@@ -35,10 +35,12 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <sys/endian.h>
|
||||
|
||||
#include <nfc/nfc.h>
|
||||
|
||||
#include "mifareultag.h"
|
||||
#include "bitutils.h"
|
||||
#include "nfc-utils.h"
|
||||
|
||||
static nfc_device_t* pnd;
|
||||
static nfc_target_info_t nti;
|
||||
@@ -217,7 +219,7 @@ int main(int argc, const char* argv[])
|
||||
|
||||
// Get the info from the current tag
|
||||
pbtUID = nti.nai.abtUid;
|
||||
printf("Found MIFARE Ultralight card with uid: %08x\n", swap_endian32(pbtUID));
|
||||
printf("Found MIFARE Ultralight card with uid: %08x\n", bswap32(*((uint32_t *)&pbtUID)));
|
||||
|
||||
if (bReadAction)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user