From c567aecb2ed79ddd05f449453d0e1ae9ba83af1b Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 26 Sep 2017 17:16:24 +0200 Subject: [PATCH] CHG: 'hf list' - now gets a timeout instead of stalling if device doesnt answer.. --- client/cmdhf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/cmdhf.c b/client/cmdhf.c index dcec4e114..6731c48b2 100644 --- a/client/cmdhf.c +++ b/client/cmdhf.c @@ -833,7 +833,11 @@ int CmdHFList(const char *Cmd) { // Query for the size of the trace UsbCommand response; GetFromBigBuf(trace, USB_CMD_DATA_SIZE, 0); - WaitForResponse(CMD_ACK, &response); + if ( !WaitForResponseTimeout(CMD_ACK, &response, 4000) ) { + PrintAndLog("timeout while waiting for reply."); + return 1; + } + uint16_t traceLen = response.arg[2]; if (traceLen > USB_CMD_DATA_SIZE) { uint8_t *p = realloc(trace, traceLen);