thinfilm simulation when on battery

This commit is contained in:
Philippe Teuwen 2019-08-03 22:37:01 +02:00
parent 3dae748314
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);
if (!reader_detected) {
LED_B_ON();
Dbprintf("Reader detected, start beaming data");
//Dbprintf("Reader detected, start beaming data");
reader_detected = true;
}
} else {
if (reader_detected) {
LED_B_OFF();
Dbprintf("Reader gone, stop beaming data");
//Dbprintf("Reader gone, stop beaming data");
reader_detected = false;
}
}

View file

@ -196,12 +196,17 @@ static int CmdHfThinFilmSim(const char *Cmd) {
PacketResponseNG resp;
PrintAndLogEx(SUCCESS, "press pm3-button to abort simulation");
while (!kbd_enter_pressed()) {
if (WaitForResponseTimeout(CMD_HF_THINFILM_SIMULATE, &resp, 1500) == 0) continue;
int ret;
while (!(ret = kbd_enter_pressed())) {
if (WaitForResponseTimeout(CMD_HF_THINFILM_SIMULATE, &resp, 500) == 0) continue;
if (resp.status != PM3_SUCCESS) break;
}
PrintAndLogEx(INFO, "Done");
if (ret) {
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;
}