From 9b85f8032177d9423ab5d9a3b70107fddc0fa20c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 16 May 2019 08:02:56 +0200 Subject: [PATCH] chg: the reconnect now works good on ubuntu and mingw (for me :)) chg: increased timeout for FPC from 170 -> 200. Mingw seems slower. --- client/comms.c | 11 +++++++---- include/pm3_cmd.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/comms.c b/client/comms.c index 74ff518de..d6bf91d7c 100644 --- a/client/comms.c +++ b/client/comms.c @@ -623,13 +623,16 @@ int TestProxmark(void) { PrintAndLogEx(INFO, "Communicating with PM3 over %s", conn.send_via_fpc_usart ? _YELLOW_("FPC UART") : _YELLOW_("USB-CDC")); + int res; if (conn.send_via_fpc_usart) { PrintAndLogEx(INFO, "UART Serial baudrate: " _YELLOW_("%u") "\n", conn.uart_speed); + res = uart_reconfigure_timeouts(UART_FPC_CLIENT_RX_TIMEOUT_MS); } else { - int res = uart_reconfigure_timeouts(UART_USB_CLIENT_RX_TIMEOUT_MS); - if (res != PM3_SUCCESS) { - return res; - } + res = uart_reconfigure_timeouts(UART_USB_CLIENT_RX_TIMEOUT_MS); + } + + if (res != PM3_SUCCESS) { + return res; } return PM3_SUCCESS; } diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index eff5d44f5..6608b8477 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -483,7 +483,7 @@ typedef struct { // took settings from libnfc/buses/uart.c // uart_windows.c & uart_posix.c -# define UART_FPC_CLIENT_RX_TIMEOUT_MS 170 +# define UART_FPC_CLIENT_RX_TIMEOUT_MS 200 # define UART_USB_CLIENT_RX_TIMEOUT_MS 20 # define UART_TCP_CLIENT_RX_TIMEOUT_MS 300