From 50cb75e4b3b9585e63201c297a288897d543019d Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Fri, 10 Dec 2021 09:47:26 -0500 Subject: [PATCH] correct logic when dealing with RF or network traffic when configured for dedicated control channel; transmit voice grants across network; --- p25/Control.cpp | 25 ++++++++++++++++++++++--- p25/TrunkPacket.cpp | 16 ++++++++++++++-- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/p25/Control.cpp b/p25/Control.cpp index 0b7aefcc..b6913e5f 100644 --- a/p25/Control.cpp +++ b/p25/Control.cpp @@ -440,7 +440,13 @@ bool Control::processFrame(uint8_t* data, uint32_t len) case P25_DUID_HDU: case P25_DUID_LDU1: case P25_DUID_LDU2: - ret = m_voice->process(data, len); + if (!m_dedicatedControl) + ret = m_voice->process(data, len); + else { + if (m_voiceOnControl && m_trunk->isChBusy(m_siteData.channelNo())) { + ret = m_voice->process(data, len); + } + } break; case P25_DUID_TDU: @@ -449,7 +455,13 @@ bool Control::processFrame(uint8_t* data, uint32_t len) break; case P25_DUID_PDU: - ret = m_data->process(data, len); + if (!m_dedicatedControl) + ret = m_data->process(data, len); + else { + if (m_voiceOnControl && m_trunk->isChBusy(m_siteData.channelNo())) { + ret = m_data->process(data, len); + } + } break; case P25_DUID_TSDU: @@ -765,13 +777,20 @@ void Control::processNetwork() case P25_DUID_HDU: case P25_DUID_LDU1: case P25_DUID_LDU2: + if (!m_dedicatedControl) + ret = m_voice->processNetwork(data, length, control, lsd, duid); + // dedicated control ignores network voice frames -- always + break; + case P25_DUID_TDU: case P25_DUID_TDULC: m_voice->processNetwork(data, length, control, lsd, duid); break; case P25_DUID_PDU: - m_data->processNetwork(data, length, control, lsd, duid); + if (!m_dedicatedControl) + ret = m_data->processNetwork(data, length, control, lsd, duid); + // dedicated control ignores network data frames -- always break; case P25_DUID_TSDU: diff --git a/p25/TrunkPacket.cpp b/p25/TrunkPacket.cpp index 2fc30876..d4a3492e 100644 --- a/p25/TrunkPacket.cpp +++ b/p25/TrunkPacket.cpp @@ -563,6 +563,18 @@ bool TrunkPacket::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, d uint32_t dstId = m_netTSBK.getDstId(); switch (m_netTSBK.getLCO()) { + case TSBK_IOSP_GRP_VCH: + if (m_verbose) { + LogMessage(LOG_NET, P25_TSDU_STR ", TSBK_IOSP_GRP_VCH (Group Voice Channel Grant), emerg = %u, encrypt = %u, prio = %u, chNo = %u, srcId = %u, dstId = %u", + m_netTSBK.getEmergency(), m_netTSBK.getEncrypted(), m_netTSBK.getPriority(), m_netTSBK.getGrpVchNo(), srcId, dstId); + } + break; + case TSBK_IOSP_UU_VCH: + if (m_verbose) { + LogMessage(LOG_NET, P25_TSDU_STR ", TSBK_IOSP_UU_VCH (Unit-to-Unit Voice Channel Grant), emerg = %u, encrypt = %u, prio = %u, chNo = %u, srcId = %u, dstId = %u", + m_netTSBK.getEmergency(), m_netTSBK.getEncrypted(), m_netTSBK.getPriority(), m_netTSBK.getGrpVchNo(), srcId, dstId); + } + break; case TSBK_IOSP_UU_ANS: if (m_netTSBK.getResponse() > 0U) { if (m_verbose) { @@ -1857,7 +1869,7 @@ bool TrunkPacket::writeRF_TSDU_Grant(bool grp, bool skip, bool net) // transmit group grant m_rfTSBK.setLCO(TSBK_IOSP_GRP_VCH); - writeRF_TSDU_SBF(true, true); + writeRF_TSDU_SBF(false, true); } else { if (!net) { @@ -1871,7 +1883,7 @@ bool TrunkPacket::writeRF_TSDU_Grant(bool grp, bool skip, bool net) // transmit private grant m_rfTSBK.setLCO(TSBK_IOSP_UU_VCH); - writeRF_TSDU_SBF(true, true); + writeRF_TSDU_SBF(false, true); } m_rfTSBK.setLCO(lco);