From 3eb787383fedfffb2a0d3f934c8cae42561b8265 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Mon, 9 May 2022 21:25:21 -0400 Subject: [PATCH] copy the late entry support from parent VoicePacket class to implement queue clear and state resets; --- p25/dfsi/DFSIVoicePacket.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/p25/dfsi/DFSIVoicePacket.cpp b/p25/dfsi/DFSIVoicePacket.cpp index 2ad913d7..fbde1a78 100644 --- a/p25/dfsi/DFSIVoicePacket.cpp +++ b/p25/dfsi/DFSIVoicePacket.cpp @@ -90,8 +90,10 @@ bool DFSIVoicePacket::process(uint8_t* data, uint32_t len) uint8_t frameType = m_rfDFSILC.getFrameType(); if (frameType == P25_DFSI_VHDR2) { - if (m_p25->m_rfState == RS_RF_LISTENING && m_p25->m_ccRunning) { - //m_p25->m_modem->clearP25Data(); + if (m_p25->m_rfState == RS_RF_LISTENING) { + if (!m_p25->m_dedicatedControl) { + m_p25->m_modem->clearP25Data(); + } m_p25->m_queue.clear(); resetRF(); resetNet(); @@ -175,6 +177,16 @@ bool DFSIVoicePacket::process(uint8_t* data, uint32_t len) m_lastDUID = P25_DUID_LDU1; if (m_p25->m_rfState == RS_RF_LISTENING) { + // if this is a late entry call, clear states + if (m_rfLastHDU.getDstId() == 0U) { + if (!m_p25->m_dedicatedControl) { + m_p25->m_modem->clearP25Data(); + } + m_p25->m_queue.clear(); + resetRF(); + resetNet(); + } + if (m_p25->m_control) { if (!m_p25->m_ccRunning && m_p25->m_voiceOnControl) { m_p25->m_trunk->writeRF_ControlData(255U, 0U, false);