diff --git a/CHANGELOG.md b/CHANGELOG.md index a1bedd944..178e7e5c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Fixed `hf thinfilm sim` - a second simulation in the same client no longer ends at once with `Done!` (@matrix) - Fixed flashing with redirected output - the progress animation is drawn only when stdout is a terminal (@matrix) - Fixed `proxmark3 --flash`, `--dumpmem` and `--reboot-to-bootloader` exit status - a failure exits 1, a failed flash no longer ends with `All done` (@matrix) - Fixed `data rawdemod` - `--max`, `--samples` and the `--p2` clock no longer wrap above 255, `--fs` refuses values above 255 (@matrix) diff --git a/client/src/cmdhfthinfilm.c b/client/src/cmdhfthinfilm.c index 54e4699a2..141b1d67e 100644 --- a/client/src/cmdhfthinfilm.c +++ b/client/src/cmdhfthinfilm.c @@ -179,9 +179,17 @@ int CmdHfThinFilmSim(const char *Cmd) { data[data_len++] = b1; } + // end a simulation still running from an earlier call and drop its reply + PacketResponseNG resp; + clearCommandBuffer(); + SendCommandNG(CMD_PING, NULL, 0); + if (WaitForResponseTimeout(CMD_PING, &resp, 3000) == false) { + PrintAndLogEx(WARNING, "command execution time out"); + return PM3_ETIMEOUT; + } + clearCommandBuffer(); SendCommandNG(CMD_HF_THINFILM_SIMULATE, (uint8_t *)&data, data_len); - PacketResponseNG resp; PrintAndLogEx(SUCCESS, "press " _GREEN_("pm3 button") " to abort simulation"); int ret;