mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-14 03:03:14 +08:00
chg: 'data bitsamples' - getfrombigbuf has now timeout
chg: 'data hexsamples' - getfrombigbuf has now timeout chg: 'data samples' - getfrombigbuf has now timeout
This commit is contained in:
parent
69346852a6
commit
fe339872d8
1 changed files with 12 additions and 6 deletions
|
@ -806,8 +806,11 @@ int CmdBitsamples(const char *Cmd)
|
|||
uint8_t got[12288];
|
||||
|
||||
GetFromBigBuf(got, sizeof(got), 0);
|
||||
WaitForResponse(CMD_ACK, NULL);
|
||||
|
||||
if ( !WaitForResponseTimeout(CMD_ACK, NULL, 2500) ) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int j = 0; j < sizeof(got); j++) {
|
||||
for (int k = 0; k < 8; k++) {
|
||||
if(got[j] & (1 << (7 - k)))
|
||||
|
@ -1336,8 +1339,11 @@ int CmdHexsamples(const char *Cmd)
|
|||
}
|
||||
|
||||
GetFromBigBuf(got, requested, offset);
|
||||
WaitForResponse(CMD_ACK,NULL);
|
||||
|
||||
if ( !WaitForResponseTimeout(CMD_ACK, NULL, 2500) ) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return false;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
for (j = 0; j < requested; j++) {
|
||||
i++;
|
||||
|
@ -1412,13 +1418,13 @@ int getSamples(int n, bool silent) {
|
|||
if (!silent) PrintAndLogEx(NORMAL, "Reading %d bytes from device memory\n", n);
|
||||
GetFromBigBuf(got, n, 0);
|
||||
|
||||
if (!silent) PrintAndLogEx(NORMAL, "Data fetched");
|
||||
|
||||
UsbCommand response;
|
||||
if ( !WaitForResponseTimeout(CMD_ACK, &response, 10000) ) {
|
||||
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!silent) PrintAndLogEx(NORMAL, "Data fetched");
|
||||
|
||||
uint8_t bits_per_sample = 8;
|
||||
|
||||
|
|
Loading…
Reference in a new issue