From 93171e3d74deda68db87f80fb2202982cefaec89 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 8 May 2019 19:34:11 +0200 Subject: [PATCH] fast mode on sc upgrade, no much diff --- client/cmdsmartcard.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index 973dc29a6..c8c33dd4c 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -643,8 +643,15 @@ static int CmdSmartUpgrade(const char *Cmd) { uint32_t bytes_sent = 0; uint32_t bytes_remaining = firmware_size; + // fast push mode + conn.block_after_ACK = true; + while (bytes_remaining > 0) { uint32_t bytes_in_packet = MIN(PM3_CMD_DATA_SIZE, bytes_remaining); + if (bytes_in_packet == bytes_remaining) { + // Disable fast mode on last packet + conn.block_after_ACK = false; + } clearCommandBuffer(); SendCommandOLD(CMD_SMART_UPLOAD, index + bytes_sent, bytes_in_packet, 0, dump + bytes_sent, bytes_in_packet); if (!WaitForResponseTimeout(CMD_ACK, NULL, 2000)) {