fix 'lf cmdread' - better messaging

This commit is contained in:
iceman1001 2019-09-30 19:39:34 +02:00
parent 6a83a7dc1a
commit aeab10d67f

View file

@ -297,22 +297,30 @@ int CmdLFCommandRead(const char *Cmd) {
SendCommandNG(CMD_LF_MOD_THEN_ACQ_RAW_ADC, (uint8_t *)&payload, 8 + datalen); SendCommandNG(CMD_LF_MOD_THEN_ACQ_RAW_ADC, (uint8_t *)&payload, 8 + datalen);
printf("\n"); printf("\n");
PacketResponseNG resp;
uint8_t i = 10; uint8_t i = 10;
while (!WaitForResponseTimeout(CMD_LF_MOD_THEN_ACQ_RAW_ADC, NULL, 2000) && i != 0) { while (!WaitForResponseTimeout(CMD_LF_MOD_THEN_ACQ_RAW_ADC, &resp, 2000) && i != 0) {
printf("."); printf(".");
fflush(stdout); fflush(stdout);
i--; i--;
} }
printf("\n"); printf("\n");
if (resp.status == PM3_SUCCESS) {
if (i) { if (i) {
PrintAndLogEx(SUCCESS, "Downloading response signal data"); PrintAndLogEx(SUCCESS, "Downloading response signal data");
getSamples(0, true); getSamples(0, true);
return PM3_SUCCESS; return PM3_SUCCESS;
} } else {
PrintAndLogEx(WARNING, "timeout while waiting for reply."); PrintAndLogEx(WARNING, "timeout while waiting for reply.");
return PM3_ETIMEOUT; return PM3_ETIMEOUT;
} }
}
PrintAndLogEx(WARNING, "Command failed.");
return PM3_ESOFT;
}
int CmdFlexdemod(const char *Cmd) { int CmdFlexdemod(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (void)Cmd; // Cmd is not used so far