em4x50: reply deadline for read / info retries
The retry check estimated the next attempt from the longest one so far. That does not bound it: - get_pulse_length() waits up to 4 bit periods - one find_double_listen_window() can take about 3.2 s with no signal - a login + read attempt can take over 6 s - setup before tstart was not counted A slow attempt after fast failures could end after the client gave up, leaving the late reply queued for the next command. read and info now set a deadline after setup, 1 s before the client timeout. The listen window, ACK and word decode loops stop at the deadline, as do the retries. With no deadline set (write, brute, sim, ...) they behave as before. The client waits 5 s for read, as it already did for info / dump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6cdccfb2df
commit
1f543f3ced
4 files changed
+29
-21
No files matched your search
@@ -646,7 +646,7 @@ int em4x50_read(em4x50_data_t *etd, em4x50_word_t *out) {
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_LF_EM4X50_READ, (uint8_t *)&edata, sizeof(edata));
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_LF_EM4X50_READ, &resp, EM4X50_TIMEOUT_CMD) == false) {
|
||||
if (WaitForResponseTimeout(CMD_LF_EM4X50_READ, &resp, EM4X50_TIMEOUT_READ) == false) {
|
||||
PrintAndLogEx(WARNING, "(em4x50) timeout while waiting for reply");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user