From a8734c0f31196440daabd8e4f51d090e86fdd36b Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Mon, 29 Dec 2025 15:41:59 -0500 Subject: [PATCH] BUGFIX: add more stream ID lockout reset handling; --- src/bridge/HostBridge.cpp | 21 ++++++++++++++++----- src/patch/HostPatch.cpp | 21 ++++++++++++++++----- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/bridge/HostBridge.cpp b/src/bridge/HostBridge.cpp index 7c03e2c2..d451207b 100644 --- a/src/bridge/HostBridge.cpp +++ b/src/bridge/HostBridge.cpp @@ -1410,8 +1410,11 @@ void HostBridge::processDMRNetwork(uint8_t* buffer, uint32_t length) using namespace dmr; using namespace dmr::defines; - if (m_txMode != TX_MODE_DMR) + if (m_txMode != TX_MODE_DMR) { + m_network->resetDMR(1U); + m_network->resetDMR(2U); return; + } // process network message header uint8_t seqNo = buffer[4U]; @@ -1474,10 +1477,14 @@ void HostBridge::processDMRNetwork(uint8_t* buffer, uint32_t length) return; // ensure destination ID matches and slot matches - if (dstId != m_dstId) + if (dstId != m_dstId) { + m_network->resetDMR(slotNo); return; - if (slotNo != m_slot) + } + if (slotNo != m_slot) { + m_network->resetDMR(slotNo); return; + } // is this a new call stream? if (m_network->getDMRStreamId(slotNo) != m_rxStreamId) { @@ -1877,8 +1884,10 @@ void HostBridge::processP25Network(uint8_t* buffer, uint32_t length) using namespace p25::dfsi::defines; using namespace p25::data; - if (m_txMode != TX_MODE_P25) + if (m_txMode != TX_MODE_P25) { + m_network->resetP25(); return; + } bool grantDemand = (buffer[14U] & network::NET_CTRL_GRANT_DEMAND) == network::NET_CTRL_GRANT_DEMAND; bool grantDenial = (buffer[14U] & network::NET_CTRL_GRANT_DENIAL) == network::NET_CTRL_GRANT_DENIAL; @@ -1952,8 +1961,10 @@ void HostBridge::processP25Network(uint8_t* buffer, uint32_t length) } // ensure destination ID matches - if (dstId != m_dstId) + if (dstId != m_dstId) { + m_network->resetP25(); return; + } // is this a new call stream? uint16_t callKID = 0U; diff --git a/src/patch/HostPatch.cpp b/src/patch/HostPatch.cpp index 45697a13..1bc2befa 100644 --- a/src/patch/HostPatch.cpp +++ b/src/patch/HostPatch.cpp @@ -608,8 +608,11 @@ void HostPatch::processDMRNetwork(uint8_t* buffer, uint32_t length) using namespace dmr; using namespace dmr::defines; - if (m_digiMode != TX_MODE_DMR) + if (m_digiMode != TX_MODE_DMR) { + m_network->resetDMR(1U); + m_network->resetDMR(2U); return; + } // process network message header uint32_t seqNo = buffer[4U]; @@ -673,10 +676,14 @@ void HostPatch::processDMRNetwork(uint8_t* buffer, uint32_t length) return; // ensure destination ID matches and slot matches - if (dstId != m_srcTGId && dstId != m_dstTGId) + if (dstId != m_srcTGId && dstId != m_dstTGId) { + m_network->resetDMR(slotNo); return; - if (slotNo != m_srcSlot && slotNo != m_dstSlot) + } + if (slotNo != m_srcSlot && slotNo != m_dstSlot) { + m_network->resetDMR(slotNo); return; + } uint32_t actualDstId = m_dstTGId; if (m_twoWayPatch) { @@ -897,8 +904,10 @@ void HostPatch::processP25Network(uint8_t* buffer, uint32_t length) DUID::E duid = (DUID::E)buffer[22U]; uint8_t MFId = buffer[15U]; - if (duid == DUID::HDU || duid == DUID::TSDU || duid == DUID::PDU) + if (duid == DUID::HDU || duid == DUID::TSDU || duid == DUID::PDU) { + m_network->resetP25(); return; + } // process raw P25 data bytes UInt8Array data; @@ -957,8 +966,10 @@ void HostPatch::processP25Network(uint8_t* buffer, uint32_t length) return; // ensure destination ID matches - if (dstId != m_srcTGId && dstId != m_dstTGId) + if (dstId != m_srcTGId && dstId != m_dstTGId) { + m_network->resetP25(); return; + } bool reverseEncrypt = false; bool tekEnable = m_tekSrcEnable;