Add communication_delay also to dl_it timeout
This commit is contained in:
@@ -706,6 +706,10 @@ static bool dl_it(uint8_t *dest, uint32_t bytes, uint32_t start_index, PacketRes
|
|||||||
uint32_t bytes_completed = 0;
|
uint32_t bytes_completed = 0;
|
||||||
timeout_start_time = msclock();
|
timeout_start_time = msclock();
|
||||||
|
|
||||||
|
// Add delay depending on the communication channel & speed
|
||||||
|
if (ms_timeout != (size_t)-1)
|
||||||
|
ms_timeout += communication_delay();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
if (getReply(response)) {
|
if (getReply(response)) {
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ struct timeval timeout = {
|
|||||||
.tv_usec = 100000 // 100 000 micro seconds
|
.tv_usec = 100000 // 100 000 micro seconds
|
||||||
};
|
};
|
||||||
|
|
||||||
Add automatically some communication delay in the WaitForResponseTimeout timeout
|
Add automatically some communication delay in the WaitForResponseTimeout & dl_it timeouts
|
||||||
Only when using FPC, timeout = 2* empirically measured delay (FTDI cable)
|
Only when using FPC, timeout = 2* empirically measured delay (FTDI cable)
|
||||||
Empirically measured delay (FTDI cable) with "hw pingng 512" :
|
Empirically measured delay (FTDI cable) with "hw pingng 512" :
|
||||||
usb -> 6.. 32ms
|
usb -> 6.. 32ms
|
||||||
@@ -269,6 +269,11 @@ static size_t communication_delay(void) {
|
|||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Because some commands send a lot of frames before finishing (hw status, lf read,...),
|
||||||
|
WaitForResponseTimeout & dl_it timeouts are reset at each packet reception,
|
||||||
|
so timeout is actually counted after latest received packet,
|
||||||
|
it doesn't depend anymore on the number of received packets.
|
||||||
|
|
||||||
Needed to tune pm3 RX usart maxtry
|
Needed to tune pm3 RX usart maxtry
|
||||||
(common/usart.c)
|
(common/usart.c)
|
||||||
uint32_t usart_read_ng(uint8_t *data, size_t len) {
|
uint32_t usart_read_ng(uint8_t *data, size_t len) {
|
||||||
@@ -303,6 +308,10 @@ time client/proxmark3 -p /dev/ttyUSB0 -b 115200 -c "hw status"
|
|||||||
time client/proxmark3 -p /dev/ttyUSB0 -b 9600 -c "hw status"
|
time client/proxmark3 -p /dev/ttyUSB0 -b 9600 -c "hw status"
|
||||||
5.75s
|
5.75s
|
||||||
|
|
||||||
|
time client/proxmark3 -p /dev/ttyUSB0 -b 9600 -c "lf read"
|
||||||
|
50.38s
|
||||||
|
time client/proxmark3 -p /dev/ttyUSB0 -b 115200 -c "lf read"
|
||||||
|
6.28s
|
||||||
|
|
||||||
Reference frames
|
Reference frames
|
||||||
================
|
================
|
||||||
|
|||||||
Reference in New Issue
Block a user