From d8a65dc7663bb2c884901c1e4f6612413ac424b4 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sat, 13 Jun 2026 11:46:03 -0400 Subject: [PATCH] perform network watchdog handling in a more centralized manner in Voice::processNetwork(); fix condition where remote grant demands may happen even though TG hangtimers are running; --- src/host/p25/Control.cpp | 16 +++++++++++----- src/host/p25/packet/Voice.cpp | 6 +++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/host/p25/Control.cpp b/src/host/p25/Control.cpp index 012f3f49..8d9563d0 100644 --- a/src/host/p25/Control.cpp +++ b/src/host/p25/Control.cpp @@ -1010,11 +1010,6 @@ void Control::clock() } } - if (m_netState != RS_NET_IDLE) { - m_voice->resetNet(); - m_netState = RS_NET_IDLE; - } - m_netLastDstId = 0U; m_netLastSrcId = 0U; } @@ -1648,6 +1643,17 @@ void Control::processNetwork() return; } + // if we're non-dedicated control, and if either of the talkgroup hang timers are running, ignore the grant demand + if (!m_dedicatedControl) { + if (m_rfTGHang.isRunning() && !m_rfTGHang.hasExpired()) { + return; + } + + if (m_netTGHang.isRunning() && !m_netTGHang.hasExpired()) { + return; + } + } + // validate source RID if (!acl::AccessControl::validateSrcId(srcId)) { return; diff --git a/src/host/p25/packet/Voice.cpp b/src/host/p25/packet/Voice.cpp index c32aa90e..832a4dac 100644 --- a/src/host/p25/packet/Voice.cpp +++ b/src/host/p25/packet/Voice.cpp @@ -1151,6 +1151,9 @@ bool Voice::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L if (checkNetTrafficCollision(srcId, dstId, duid)) return false; + if (m_p25->m_netState == RS_NET_AUDIO && (duid != DUID::TDU && duid != DUID::TDULC)) + m_p25->m_networkWatchdog.start(); + uint32_t count = 0U; switch (duid) { case DUID::LDU1: @@ -1891,7 +1894,6 @@ void Voice::writeNet_LDU1() } } - m_p25->m_networkWatchdog.start(); m_hadVoice = true; m_p25->m_netState = RS_NET_AUDIO; m_p25->m_netLastDstId = dstId; @@ -2105,8 +2107,6 @@ void Voice::writeNet_LDU2() return; } - m_p25->m_networkWatchdog.start(); - uint8_t mi[MI_LENGTH_BYTES]; control.getMI(mi);