From 6fb3ede4ef4d4be5bbe6e211dd5dad609140412c Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Wed, 31 Jan 2024 15:14:06 -0500 Subject: [PATCH] whoops inadvertant bad logic; --- src/fne/network/fne/TagDMRData.cpp | 3 +-- src/fne/network/fne/TagNXDNData.cpp | 3 +-- src/fne/network/fne/TagP25Data.cpp | 12 ++++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/fne/network/fne/TagDMRData.cpp b/src/fne/network/fne/TagDMRData.cpp index 9243d7a9..e4da77c0 100644 --- a/src/fne/network/fne/TagDMRData.cpp +++ b/src/fne/network/fne/TagDMRData.cpp @@ -137,8 +137,7 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId if (std::find_if(m_status.begin(), m_status.end(), [&](StatusMapPair x) { return (x.second.dstId == dstId && x.second.slotNo == slotNo); }) != m_status.end()) { m_status.erase(dstId); - } - else { + // is this a parrot talkgroup? if so, clear any remaining frames from the buffer lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(dstId); if (tg.config().parrot()) { diff --git a/src/fne/network/fne/TagNXDNData.cpp b/src/fne/network/fne/TagNXDNData.cpp index 0adad3f1..3da4ce40 100644 --- a/src/fne/network/fne/TagNXDNData.cpp +++ b/src/fne/network/fne/TagNXDNData.cpp @@ -107,8 +107,7 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI if (std::find_if(m_status.begin(), m_status.end(), [&](StatusMapPair x) { return x.second.dstId == dstId; }) != m_status.end()) { m_status.erase(dstId); - } - else { + // is this a parrot talkgroup? if so, clear any remaining frames from the buffer lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(dstId); if (tg.config().parrot()) { diff --git a/src/fne/network/fne/TagP25Data.cpp b/src/fne/network/fne/TagP25Data.cpp index 963b6b9b..a439a17a 100644 --- a/src/fne/network/fne/TagP25Data.cpp +++ b/src/fne/network/fne/TagP25Data.cpp @@ -147,10 +147,18 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId RxStatus status = m_status[dstId]; uint64_t duration = hrc::diff(pktTime, status.callStartTime); + // perform a test for grant demands, and if the TG isn't valid ignore the demand + bool grantDemand = (data[14U] & 0x80U) == 0x80U; + if (grantDemand) { + lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(control.getDstId()); + if (!tg.config().active()) { + return false; + } + } + if (std::find_if(m_status.begin(), m_status.end(), [&](StatusMapPair x) { return x.second.dstId == dstId; }) != m_status.end()) { m_status.erase(dstId); - } - else { + // is this a parrot talkgroup? if so, clear any remaining frames from the buffer lookups::TalkgroupRuleGroupVoice tg = m_network->m_tidLookup->find(dstId); if (tg.config().parrot()) {