From bc19a532a9d45ae3ea9154f2f60d7fb08cde0672 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 11 Sep 2020 15:11:37 +0200 Subject: [PATCH] fix hf 14a raw to allow large timeouts --- client/src/cmdhf14a.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index 4ce99c69a..698f1871e 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -31,7 +31,7 @@ bool APDUInFramingEnable = true; static int CmdHelp(const char *Cmd); -static int waitCmd(uint8_t iSelect); +static int waitCmd(uint8_t iSelect, uint32_t timeout); static const manufactureName manufactureMapping[] = { // ID, "Vendor Country" @@ -1309,17 +1309,17 @@ static int CmdHF14ACmdRaw(const char *Cmd) { if (reply) { int res = 0; if (active_select) - res = waitCmd(1); + res = waitCmd(1, timeout); if (!res && datalen > 0) - waitCmd(0); + waitCmd(0, timeout); } return 0; } -static int waitCmd(uint8_t iSelect) { +static int waitCmd(uint8_t iSelect, uint32_t timeout) { PacketResponseNG resp; - if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { + if (WaitForResponseTimeout(CMD_ACK, &resp, timeout + 1500)) { uint16_t len = (resp.oldarg[0] & 0xFFFF); if (iSelect) { len = (resp.oldarg[1] & 0xFFFF);