From a19732bb6ec0517488386c8e63bb04af43e54067 Mon Sep 17 00:00:00 2001 From: wh201906 Date: Tue, 4 Jul 2023 16:19:33 +0800 Subject: [PATCH 1/2] Fix timeout of TCP connections --- client/src/comms.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/comms.c b/client/src/comms.c index 64bea9f65..a17bdbaf9 100644 --- a/client/src/comms.c +++ b/client/src/comms.c @@ -623,6 +623,7 @@ int TestProxmark(pm3_device_t *dev) { PacketResponseNG resp; uint16_t len = 32; + bool is_tcp_conn = false; uint8_t data[len]; for (uint16_t i = 0; i < len; i++) data[i] = i & 0xFF; @@ -665,16 +666,17 @@ int TestProxmark(pm3_device_t *dev) { memcpy(&g_pm3_capabilities, resp.data.asBytes, MIN(sizeof(capabilities_t), resp.length)); g_conn.send_via_fpc_usart = g_pm3_capabilities.via_fpc; g_conn.uart_speed = g_pm3_capabilities.baudrate; + is_tcp_conn = memcmp(g_conn.serial_port_name, "tcp:", 4) == 0; PrintAndLogEx(INFO, "Communicating with PM3 over %s%s%s", g_conn.send_via_fpc_usart ? _YELLOW_("FPC UART") : _YELLOW_("USB-CDC"), - memcmp(g_conn.serial_port_name, "tcp:", 4) == 0 ? " over " _YELLOW_("TCP") : "", + is_tcp_conn ? " over " _YELLOW_("TCP") : "", memcmp(g_conn.serial_port_name, "bt:", 3) == 0 ? " over " _YELLOW_("BT") : ""); if (g_conn.send_via_fpc_usart) { PrintAndLogEx(INFO, "PM3 UART serial baudrate: " _YELLOW_("%u") "\n", g_conn.uart_speed); } else { - int res = uart_reconfigure_timeouts(UART_USB_CLIENT_RX_TIMEOUT_MS); + int res = uart_reconfigure_timeouts(is_tcp_conn ? UART_TCP_CLIENT_RX_TIMEOUT_MS : UART_USB_CLIENT_RX_TIMEOUT_MS); if (res != PM3_SUCCESS) { return res; } From 879bf5876f2f98301e246dec0b0c44bb5ddd82d1 Mon Sep 17 00:00:00 2001 From: wh201906 Date: Tue, 4 Jul 2023 16:21:51 +0800 Subject: [PATCH 2/2] Add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca0fede15..6bfc7c134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] + - Fixed timeout of TCP connections (@wh201906) ## [Seven.4.16717][2023-06-25] - Change `hf 14a info` - now identifes QL88 tags (@iceman1001)