nfc-mfultralight: fix 7byte UID display

This commit is contained in:
Philippe Teuwen 2010-12-09 23:40:03 +00:00
parent ca594f3198
commit 3b62d2512c

View file

@ -50,7 +50,6 @@
#include <nfc/nfc-messages.h> #include <nfc/nfc-messages.h>
#include "mifare.h" #include "mifare.h"
#include "nfc-utils.h"
static nfc_device_t *pnd; static nfc_device_t *pnd;
static nfc_target_t nt; static nfc_target_t nt;
@ -244,9 +243,13 @@ main (int argc, const char *argv[])
nfc_disconnect (pnd); nfc_disconnect (pnd);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
// Get the info from the current tag (UID is stored little-endian) // Get the info from the current tag
pbtUID = nt.nti.nai.abtUid; printf ("Found MIFARE Ultralight card with UID: ");
printf ("Found MIFARE Ultralight card with UID: %02x%02x%02x%02x\n", pbtUID[3], pbtUID[2], pbtUID[1], pbtUID[0]); size_t szPos;
for (szPos = 0; szPos < nt.nti.nai.szUidLen; szPos++) {
printf ("%02x", nt.nti.nai.abtUid[szPos]);
}
printf("\n");
if (bReadAction) { if (bReadAction) {
if (read_card ()) { if (read_card ()) {