From 3607b5a96a5b70e2e25356e0f6a1ad420ac02bfb Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 6 Mar 2016 12:40:04 +0100 Subject: [PATCH] ADD: Added the autodetection of Topaz to "HF SEARCH" FIX: Fixed a minor bug in "HF SEARCH" where it always found a "14b" tag, making the command never test for other formats afterward the 14b test. The 14b detection is not good still, conflicting return values is main reason for this bug --- client/cmdhf.c | 5 +++++ client/cmdhf14b.c | 11 +++++++---- client/cmdhftopaz.c | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/client/cmdhf.c b/client/cmdhf.c index 969510df..0b4aa379 100644 --- a/client/cmdhf.c +++ b/client/cmdhf.c @@ -750,6 +750,11 @@ int CmdHFSearch(const char *Cmd){ PrintAndLog("\nValid ISO15693 Tag Found - Quiting Search\n"); return ans; } + ans = CmdHFTopazReader(""); + if (ans == 0) { + PrintAndLog("\nValid Topaz Tag Found - Quiting Search\n"); + return 1; + } PrintAndLog("\nno known/supported 13.56 MHz tags found\n"); return 0; } diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index fbe4d2e6..6ad2702d 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -73,16 +73,19 @@ int CmdSrix4kRead(const char *Cmd) { return 0; } -int rawClose(void){ +static int rawCloseEx(bool silent){ UsbCommand resp; UsbCommand c = {CMD_ISO_14443B_COMMAND, {0, 0, 0}}; clearCommandBuffer(); SendCommand(&c); if (!WaitForResponseTimeout(CMD_ACK,&resp,1000)) { - PrintAndLog("Command time-out"); - return 1; + if ( !silent ) PrintAndLog("Command time-out"); + return 0; } - return 0; + return 1; +} +static int rawClose() { + return rawCloseEx(false); } int HF14BCmdRaw(bool reply, bool *crc, bool power, uint8_t *data, uint8_t *datalen, bool verbose){ diff --git a/client/cmdhftopaz.c b/client/cmdhftopaz.c index 462cbec5..b4e47482 100644 --- a/client/cmdhftopaz.c +++ b/client/cmdhftopaz.c @@ -306,6 +306,7 @@ int CmdHFTopazReader(const char *Cmd) { topaz_tag.uid[2], topaz_tag.uid[1], topaz_tag.uid[0]); + PrintAndLog(" UID[6] (Manufacturer Byte) = %02x, Manufacturer: %s", topaz_tag.uid[6], getTagInfo(topaz_tag.uid[6])); -- 2.39.2