From 017029fbbe74fe5c67310fc391786c36cf2d4357 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Tue, 30 Mar 2010 13:56:49 +0000 Subject: [PATCH] Do not require a Mifare UltraLight TAG to be connected to get it's UID. Submitted by: rosek86@gmail.com --- libfreefare/mifare_ultralight.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/libfreefare/mifare_ultralight.c b/libfreefare/mifare_ultralight.c index 13f2a08..713ed0c 100644 --- a/libfreefare/mifare_ultralight.c +++ b/libfreefare/mifare_ultralight.c @@ -193,16 +193,13 @@ char * mifare_ultralight_get_uid (MifareTag tag) { char *uid = malloc (2 * 7 + 1); - MifareUltralightPage p0, p1; - mifare_ultralight_read (tag, 0, &p0); - mifare_ultralight_read (tag, 1, &p1); sprintf (uid, "%02x%02x%02x%02x%02x%02x%02x", - p0[0], - p0[1], - p0[2], - p1[0], - p1[1], - p1[2], - p1[3]); + tag->info.abtUid[1], + tag->info.abtUid[2], + tag->info.abtUid[3], + tag->info.abtUid[4], + tag->info.abtUid[5], + tag->info.abtUid[6], + tag->info.abtUid[7]); return uid; }