From c491e9344d340e46f2a4c72d96a11b97ad7f5422 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sun, 17 Dec 2023 21:56:36 -0500 Subject: [PATCH] ensure the hotspot returns to an idle state in the instance where a host doesn't gracefully disconnect (prevents the hotspot from getting stuck Tx); --- IO.cpp | 9 ++++++--- SerialPort.h | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/IO.cpp b/IO.cpp index 9e5e155..f6c0330 100644 --- a/IO.cpp +++ b/IO.cpp @@ -105,12 +105,15 @@ void IO::process() if (m_started) { // Two seconds timeout if (m_watchdog >= 19200U) { -/* - if (m_modemState == STATE_DMR || m_modemState == STATE_P25) { + if (m_modemState == STATE_DMR || m_modemState == STATE_P25 || m_modemState == STATE_NXDN) { +#if defined(DUPLEX) + if (m_modemState == STATE_DMR && m_tx) + dmrTX.setStart(false); +#endif m_modemState = STATE_IDLE; setMode(m_modemState); } -*/ + m_watchdog = 0U; } diff --git a/SerialPort.h b/SerialPort.h index 81ec3ef..467905d 100644 --- a/SerialPort.h +++ b/SerialPort.h @@ -151,7 +151,6 @@ enum CMD_REASON_CODE { const uint8_t DVM_FRAME_START = 0xFEU; #define SERIAL_SPEED 115200 -#define STATE_SCAN_MAX 3 // --------------------------------------------------------------------------- // Class Declaration