mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Hf15FindAfi WaitForResponse loop
This commit is contained in:
parent
931d115ef8
commit
ecaf919365
3 changed files with 18 additions and 7 deletions
|
@ -951,6 +951,8 @@ static int CmdHF15Sim(const char *Cmd) {
|
|||
// helptext
|
||||
static int CmdHF15FindAfi(const char *Cmd) {
|
||||
PacketResponseNG resp;
|
||||
uint32_t timeout = 0;
|
||||
|
||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||
if (cmdp == 'h') return usage_15_findafi();
|
||||
|
||||
|
@ -959,13 +961,19 @@ static int CmdHF15FindAfi(const char *Cmd) {
|
|||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_HF_ISO15693_FINDAFI, strtol(Cmd, NULL, 0), 0, 0, NULL, 0);
|
||||
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 120000)) { // 2 minutes should be enough
|
||||
DropField();
|
||||
return resp.status; // PM3_EOPABORTED or PM3_SUCCESS
|
||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
timeout++;
|
||||
|
||||
// should be done in about 2 minutes
|
||||
if (timeout > 180) {
|
||||
PrintAndLogEx(WARNING, "\nNo response from Proxmark3. Aborting...");
|
||||
DropField();
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
DropField();
|
||||
return PM3_ETIMEOUT;
|
||||
return resp.status; // PM3_EOPABORTED or PM3_SUCCESS
|
||||
}
|
||||
|
||||
// Writes the AFI (Application Family Identifier) of a card
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue