From 20fd5d5e4001165715212b7b9ee68eec6fd08591 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Mon, 19 Jun 2023 11:39:31 -0400 Subject: [PATCH] [EXPERIMENTAL] commit an experimental fix for VOC strangeness, VOC abuses P25 timing and should be transmitting the grant response at least twice; --- src/dmr/packet/ControlSignaling.cpp | 13 ++++++++++++- src/nxdn/packet/Trunk.cpp | 11 ++++++++++- src/p25/packet/Trunk.cpp | 11 ++++++++++- src/p25/packet/Voice.cpp | 2 +- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/dmr/packet/ControlSignaling.cpp b/src/dmr/packet/ControlSignaling.cpp index ec382d62..a93a83f5 100644 --- a/src/dmr/packet/ControlSignaling.cpp +++ b/src/dmr/packet/ControlSignaling.cpp @@ -861,7 +861,7 @@ bool ControlSignaling::writeRF_CSBK_Grant(uint32_t srcId, uint32_t dstId, uint8_ } } else { - if (!m_tscc->m_disableGrantSrcIdCheck) { + if (!m_tscc->m_disableGrantSrcIdCheck && !net) { // do collision check between grants to see if a SU is attempting a "grant retry" or if this is a // different source from the original grant uint32_t grantedSrcId = m_tscc->m_affiliations->getGrantedSrcId(dstId); @@ -884,6 +884,17 @@ bool ControlSignaling::writeRF_CSBK_Grant(uint32_t srcId, uint32_t dstId, uint8_ m_tscc->m_affiliations->touchGrant(dstId); } } + else { + if (m_tscc->m_affiliations->isGranted(dstId)) { + chNo = m_tscc->m_affiliations->getGrantedCh(dstId); + slot = m_tscc->m_affiliations->getGrantedSlot(dstId); + + m_tscc->m_affiliations->touchGrant(dstId); + } + else { + return false; + } + } if (grp) { if (!net) { diff --git a/src/nxdn/packet/Trunk.cpp b/src/nxdn/packet/Trunk.cpp index b4c4dba4..6343b2e1 100644 --- a/src/nxdn/packet/Trunk.cpp +++ b/src/nxdn/packet/Trunk.cpp @@ -563,7 +563,7 @@ bool Trunk::writeRF_Message_Grant(uint32_t srcId, uint32_t dstId, uint8_t servic } } else { - if (!m_disableGrantSrcIdCheck) { + if (!m_disableGrantSrcIdCheck && !net) { // do collision check between grants to see if a SU is attempting a "grant retry" or if this is a // different source from the original grant uint32_t grantedSrcId = m_nxdn->m_affiliations.getGrantedSrcId(dstId); @@ -584,6 +584,15 @@ bool Trunk::writeRF_Message_Grant(uint32_t srcId, uint32_t dstId, uint8_t servic m_nxdn->m_affiliations.touchGrant(dstId); } } + else { + if (m_nxdn->m_affiliations.isGranted(dstId)) { + chNo = m_nxdn->m_affiliations.getGrantedCh(dstId); + m_nxdn->m_affiliations.touchGrant(dstId); + } + else { + return false; + } + } if (grp) { if (!net) { diff --git a/src/p25/packet/Trunk.cpp b/src/p25/packet/Trunk.cpp index c00ed0b3..473f9378 100644 --- a/src/p25/packet/Trunk.cpp +++ b/src/p25/packet/Trunk.cpp @@ -2183,7 +2183,7 @@ bool Trunk::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOp } } else { - if (!m_disableGrantSrcIdCheck) { + if (!m_disableGrantSrcIdCheck && !net) { // do collision check between grants to see if a SU is attempting a "grant retry" or if this is a // different source from the original grant uint32_t grantedSrcId = m_p25->m_affiliations.getGrantedSrcId(dstId); @@ -2204,6 +2204,15 @@ bool Trunk::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOp m_p25->m_affiliations.touchGrant(dstId); } } + else { + if (m_p25->m_affiliations.isGranted(dstId)) { + chNo = m_p25->m_affiliations.getGrantedCh(dstId); + m_p25->m_affiliations.touchGrant(dstId); + } + else { + return false; + } + } if (chNo > 0U) { if (grp) { diff --git a/src/p25/packet/Voice.cpp b/src/p25/packet/Voice.cpp index 8ba4902d..492871dd 100644 --- a/src/p25/packet/Voice.cpp +++ b/src/p25/packet/Voice.cpp @@ -382,7 +382,7 @@ bool Voice::process(uint8_t* data, uint32_t len) // single-channel trunking or voice on control support? if (m_p25->m_control && m_p25->m_voiceOnControl) { - m_p25->m_trunk->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, group, true); + m_p25->m_trunk->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, group, true, true); } m_hadVoice = true;