thinfilm simulation when on battery

This commit is contained in:
Philippe Teuwen 2019-08-03 22:37:01 +02:00
commit 61538bd635
2 changed files with 11 additions and 6 deletions

View file

@ -136,13 +136,13 @@ void SimulateThinFilm(uint8_t *data, size_t len) {
EmSendCmdThinfilmRaw(ToSend, ToSendMax); EmSendCmdThinfilmRaw(ToSend, ToSendMax);
if (!reader_detected) { if (!reader_detected) {
LED_B_ON(); LED_B_ON();
Dbprintf("Reader detected, start beaming data"); //Dbprintf("Reader detected, start beaming data");
reader_detected = true; reader_detected = true;
} }
} else { } else {
if (reader_detected) { if (reader_detected) {
LED_B_OFF(); LED_B_OFF();
Dbprintf("Reader gone, stop beaming data"); //Dbprintf("Reader gone, stop beaming data");
reader_detected = false; reader_detected = false;
} }
} }

View file

@ -196,12 +196,17 @@ static int CmdHfThinFilmSim(const char *Cmd) {
PacketResponseNG resp; PacketResponseNG resp;
PrintAndLogEx(SUCCESS, "press pm3-button to abort simulation"); PrintAndLogEx(SUCCESS, "press pm3-button to abort simulation");
while (!kbd_enter_pressed()) { int ret;
if (WaitForResponseTimeout(CMD_HF_THINFILM_SIMULATE, &resp, 1500) == 0) continue; while (!(ret = kbd_enter_pressed())) {
if (WaitForResponseTimeout(CMD_HF_THINFILM_SIMULATE, &resp, 500) == 0) continue;
if (resp.status != PM3_SUCCESS) break; if (resp.status != PM3_SUCCESS) break;
} }
if (ret) {
PrintAndLogEx(INFO, "Done"); PrintAndLogEx(INFO, "Client side interrupted");
PrintAndLogEx(WARNING, "Simulation still running on Proxmark3 till next command or button press");
} else {
PrintAndLogEx(INFO, "Done");
}
return PM3_SUCCESS; return PM3_SUCCESS;
} }