mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 23:25:40 -07:00
removed user side timeout and improved debug messages
This commit is contained in:
parent
e69b46f6f6
commit
17f4b95bdd
1 changed files with 9 additions and 7 deletions
|
@ -174,7 +174,7 @@ static void hf14b_aid_search(bool verbose) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool wait_14b_response(bool only_first, uint32_t timeout, uint8_t *datalen, uint8_t *data) {
|
static bool wait_14b_response(bool only_first, uint8_t *datalen, uint8_t *data) {
|
||||||
|
|
||||||
/* We have scenarios.
|
/* We have scenarios.
|
||||||
A - only select
|
A - only select
|
||||||
|
@ -183,8 +183,8 @@ static bool wait_14b_response(bool only_first, uint32_t timeout, uint8_t *datale
|
||||||
*/
|
*/
|
||||||
|
|
||||||
PacketResponseNG resp;
|
PacketResponseNG resp;
|
||||||
if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, MIN(TIMEOUT, timeout)) == false) {
|
if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, TIMEOUT) == false) {
|
||||||
PrintAndLogEx(WARNING, "timeout while waiting for reply");
|
PrintAndLogEx(WARNING, "timeout while waiting for reply (first)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,6 +194,7 @@ static bool wait_14b_response(bool only_first, uint32_t timeout, uint8_t *datale
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resp.status != PM3_SUCCESS) {
|
if (resp.status != PM3_SUCCESS) {
|
||||||
|
PrintAndLogEx(DEBUG, "first response failed... %d", resp.status);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,12 +212,13 @@ static bool wait_14b_response(bool only_first, uint32_t timeout, uint8_t *datale
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait a second time.
|
// wait a second time.
|
||||||
if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, MIN(TIMEOUT, timeout)) == false) {
|
if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, TIMEOUT) == false) {
|
||||||
PrintAndLogEx(WARNING, "timeout while waiting for reply");
|
PrintAndLogEx(WARNING, "timeout while waiting for reply");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resp.status != PM3_SUCCESS) {
|
if (resp.status != PM3_SUCCESS) {
|
||||||
|
PrintAndLogEx(DEBUG, "second response failed... %d", resp.status);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,7 +1195,7 @@ static bool HF14B_other_reader(bool verbose) {
|
||||||
SendCommandNG(CMD_HF_ISO14443B_COMMAND, (uint8_t *)packet, sizeof(iso14b_raw_cmd_t) + packet->rawlen);
|
SendCommandNG(CMD_HF_ISO14443B_COMMAND, (uint8_t *)packet, sizeof(iso14b_raw_cmd_t) + packet->rawlen);
|
||||||
|
|
||||||
// wait for the select message and wait for response
|
// wait for the select message and wait for response
|
||||||
if (wait_14b_response(false, 400, NULL, NULL) ) {
|
if (wait_14b_response(false, NULL, NULL) ) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "unknown tag type answered to a " _YELLOW_("0x000b3f80") " command");
|
PrintAndLogEx(SUCCESS, "unknown tag type answered to a " _YELLOW_("0x000b3f80") " command");
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
|
@ -1206,7 +1208,7 @@ static bool HF14B_other_reader(bool verbose) {
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommandNG(CMD_HF_ISO14443B_COMMAND, (uint8_t *)packet, sizeof(iso14b_raw_cmd_t) + packet->rawlen);
|
SendCommandNG(CMD_HF_ISO14443B_COMMAND, (uint8_t *)packet, sizeof(iso14b_raw_cmd_t) + packet->rawlen);
|
||||||
|
|
||||||
if (wait_14b_response(false, 400, NULL, NULL)) {
|
if (wait_14b_response(false, NULL, NULL)) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "Unknown tag type answered to a " _YELLOW_("0x0A") " command");
|
PrintAndLogEx(SUCCESS, "Unknown tag type answered to a " _YELLOW_("0x0A") " command");
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
|
@ -1218,7 +1220,7 @@ static bool HF14B_other_reader(bool verbose) {
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommandNG(CMD_HF_ISO14443B_COMMAND, (uint8_t *)packet, sizeof(iso14b_raw_cmd_t) + packet->rawlen);
|
SendCommandNG(CMD_HF_ISO14443B_COMMAND, (uint8_t *)packet, sizeof(iso14b_raw_cmd_t) + packet->rawlen);
|
||||||
free(packet);
|
free(packet);
|
||||||
if (wait_14b_response(false, 400, NULL, NULL)) {
|
if (wait_14b_response(false, NULL, NULL)) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "Unknown tag type answered to a " _YELLOW_("0x0C") " command");
|
PrintAndLogEx(SUCCESS, "Unknown tag type answered to a " _YELLOW_("0x0C") " command");
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue