mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 18:57:12 +08:00
CHG: 'hf legic write'
CHG: 'hf legic restore' CHG: 'hf legic wipe' - longer timeout for execution
This commit is contained in:
parent
601cb0fe00
commit
063feeae05
1 changed files with 36 additions and 14 deletions
|
@ -634,10 +634,18 @@ int CmdLegicRfWrite(const char *Cmd) {
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
|
||||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
|
||||||
PrintAndLogEx(WARNING, "command execution time out");
|
uint8_t timeout = 0;
|
||||||
|
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||||
|
++timeout;
|
||||||
|
printf("."); fflush(stdout);
|
||||||
|
if (timeout > 7) {
|
||||||
|
PrintAndLogEx(WARNING, "\ncommand execution time out");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
PrintAndLogEx(NORMAL, "\n");
|
||||||
|
|
||||||
uint8_t isOK = resp.arg[0] & 0xFF;
|
uint8_t isOK = resp.arg[0] & 0xFF;
|
||||||
if ( !isOK ) {
|
if ( !isOK ) {
|
||||||
PrintAndLogEx(WARNING, "Failed writing tag");
|
PrintAndLogEx(WARNING, "Failed writing tag");
|
||||||
|
@ -1054,11 +1062,18 @@ int CmdLegicRestore(const char *Cmd){
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
|
||||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4000)) {
|
uint8_t timeout = 0;
|
||||||
PrintAndLogEx(WARNING, "command execution time out");
|
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||||
|
++timeout;
|
||||||
|
printf("."); fflush(stdout);
|
||||||
|
if (timeout > 7) {
|
||||||
|
PrintAndLogEx(WARNING, "\ncommand execution time out");
|
||||||
free(data);
|
free(data);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
PrintAndLogEx(NORMAL, "\n");
|
||||||
|
|
||||||
uint8_t isOK = resp.arg[0] & 0xFF;
|
uint8_t isOK = resp.arg[0] & 0xFF;
|
||||||
if ( !isOK ) {
|
if ( !isOK ) {
|
||||||
PrintAndLogEx(WARNING, "Failed writing tag [msg = %u]", resp.arg[1] & 0xFF);
|
PrintAndLogEx(WARNING, "Failed writing tag [msg = %u]", resp.arg[1] & 0xFF);
|
||||||
|
@ -1223,11 +1238,18 @@ int CmdLegicWipe(const char *Cmd){
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
|
||||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4000)) {
|
uint8_t timeout = 0;
|
||||||
PrintAndLogEx(WARNING, "command execution time out");
|
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||||
|
++timeout;
|
||||||
|
printf("."); fflush(stdout);
|
||||||
|
if (timeout > 7) {
|
||||||
|
PrintAndLogEx(WARNING, "\ncommand execution time out");
|
||||||
free(data);
|
free(data);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
PrintAndLogEx(NORMAL, "\n");
|
||||||
|
|
||||||
uint8_t isOK = resp.arg[0] & 0xFF;
|
uint8_t isOK = resp.arg[0] & 0xFF;
|
||||||
if ( !isOK ) {
|
if ( !isOK ) {
|
||||||
PrintAndLogEx(WARNING, "Failed writing tag [msg = %u]", resp.arg[1] & 0xFF);
|
PrintAndLogEx(WARNING, "Failed writing tag [msg = %u]", resp.arg[1] & 0xFF);
|
||||||
|
|
Loading…
Reference in a new issue