hw tune: block client till button pressed

This commit is contained in:
Philippe Teuwen 2019-05-03 08:40:21 +02:00
commit f33d0bf206
2 changed files with 12 additions and 3 deletions

View file

@ -85,8 +85,15 @@ int CmdHFTune(const char *Cmd) {
(void)Cmd; // Cmd is not used so far
PrintAndLogEx(SUCCESS, "Measuring HF antenna, press button to exit");
clearCommandBuffer();
SendCommandOLD(CMD_MEASURE_ANTENNA_TUNING_HF, 0, 0, 0, NULL, 0);
return 0;
SendCommandNG(CMD_MEASURE_ANTENNA_TUNING_HF, NULL, 0);
PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_MEASURE_ANTENNA_TUNING_HF, &resp, 1000)) {
PrintAndLogEx(WARNING, "Timeout while waiting for Proxmark HF measure, aborting");
return PM3_ETIMEOUT;
}
if (resp.status!=PM3_EOPABORTED)
return resp.status;
return PM3_SUCCESS;
}
int CmdHFSniff(const char *Cmd) {