From 76e139701afe25934b498242ce0164a443d2a579 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 29 Oct 2017 19:26:34 +0100 Subject: [PATCH] chg: @merlokk 's minor adjustment to waitCmd --- client/cmdhf14a.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 9fd8a954f..f391aa827 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -404,7 +404,7 @@ int CmdHF14AReader(const char *Cmd) { } // disconnect - SendCommand(&cDisconnect); + //SendCommand(&cDisconnect); if (isMifareClassic) { if ( detect_classic_prng() ) @@ -726,10 +726,21 @@ static void waitCmd(uint8_t iSelect) { uint16_t len = 0; if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { - len = iSelect ? (resp.arg[1] & 0xffff) : (resp.arg[0] & 0xffff); - PrintAndLog("received %i octets", len); + uint8_t iLen = resp.arg[0]; + if (iSelect){ + iLen = resp.arg[1]; + if (iLen){ + PrintAndLog("Card selected. UID[%i]:", iLen); + } else { + PrintAndLog("Can't select card."); + } + } else { + PrintAndLog("received %i bytes:", iLen); + } + if(!len) return; + PrintAndLog("%s", sprint_hex(resp.d.asBytes, len) ); } else { PrintAndLog("timeout while waiting for reply.");