fix issue with P25T VOC networked traffic where the P25T VOC channel would not process network voice frames (this is really a partial fix, there is still room for more improvement);

Bryan Biedenkapp 4 years ago
parent 26ca4ac578
commit cf364aa2c5

@ -834,23 +834,31 @@ void Control::writeRF_Nulls()
/// <summary> /// <summary>
/// Helper to write TDU preamble packet burst. /// Helper to write TDU preamble packet burst.
/// </summary> /// </summary>
void Control::writeRF_Preamble() /// <param name="preambleCount"></param>
/// <param name="force"></param>
void Control::writeRF_Preamble(uint32_t preambleCount, bool force)
{ {
if (m_modem->hasTX() || m_tduPreambleCount == 0U) { if (preambleCount == 0) {
return; preambleCount = m_tduPreambleCount;
} }
if (m_ccRunning) { if (!force) {
return; if (m_modem->hasTX() || m_tduPreambleCount == 0U) {
return;
}
if (m_ccRunning) {
return;
}
} }
if (m_tduPreambleCount > MAX_PREAMBLE_TDU_CNT) { if (m_tduPreambleCount > MAX_PREAMBLE_TDU_CNT) {
LogWarning(LOG_P25, "oversized TDU preamble count, reducing to maximum %u", MAX_PREAMBLE_TDU_CNT); LogWarning(LOG_P25, "oversized TDU preamble count, reducing to maximum %u", MAX_PREAMBLE_TDU_CNT);
m_tduPreambleCount = MAX_PREAMBLE_TDU_CNT; preambleCount = m_tduPreambleCount = MAX_PREAMBLE_TDU_CNT;
} }
// write TDUs if requested // write TDUs if requested
for (uint8_t i = 0U; i < m_tduPreambleCount; i++) { for (uint8_t i = 0U; i < preambleCount; i++) {
writeRF_TDU(true); writeRF_TDU(true);
} }
} }

@ -189,7 +189,7 @@ namespace p25
/// <summary>Helper to write data nulls.</summary> /// <summary>Helper to write data nulls.</summary>
void writeRF_Nulls(); void writeRF_Nulls();
/// <summary>Helper to write TDU preamble packet burst.</summary> /// <summary>Helper to write TDU preamble packet burst.</summary>
void writeRF_Preamble(); void writeRF_Preamble(uint32_t preambleCount = 0, bool force = false);
/// <summary>Helper to write a P25 TDU packet.</summary> /// <summary>Helper to write a P25 TDU packet.</summary>
void writeRF_TDU(bool noNetwork); void writeRF_TDU(bool noNetwork);

@ -213,7 +213,7 @@ bool TrunkPacket::process(uint8_t* data, uint32_t len)
LogMessage(LOG_RF, P25_TSDU_STR ", TSBK_IOSP_GRP_VCH (Group Voice Channel Request), srcId = %u, dstId = %u", srcId, dstId); LogMessage(LOG_RF, P25_TSDU_STR ", TSBK_IOSP_GRP_VCH (Group Voice Channel Request), srcId = %u, dstId = %u", srcId, dstId);
} }
writeRF_TSDU_Grant(true, false, false); writeRF_TSDU_Grant(true);
break; break;
case TSBK_IOSP_UU_VCH: case TSBK_IOSP_UU_VCH:
// make sure control data is supported // make sure control data is supported
@ -236,7 +236,7 @@ bool TrunkPacket::process(uint8_t* data, uint32_t len)
writeRF_TSDU_UU_Ans_Req(srcId, dstId); writeRF_TSDU_UU_Ans_Req(srcId, dstId);
} }
else { else {
writeRF_TSDU_Grant(false, false, false); writeRF_TSDU_Grant(false);
} }
break; break;
case TSBK_IOSP_UU_ANS: case TSBK_IOSP_UU_ANS:
@ -259,7 +259,7 @@ bool TrunkPacket::process(uint8_t* data, uint32_t len)
writeRF_TSDU_ACK_FNE(dstId, TSBK_IOSP_UU_ANS, false, true); writeRF_TSDU_ACK_FNE(dstId, TSBK_IOSP_UU_ANS, false, true);
} }
writeRF_TSDU_Grant(false, false, false); writeRF_TSDU_Grant(false);
} }
else if (m_rfTSBK.getResponse() == P25_ANS_RSP_DENY) { else if (m_rfTSBK.getResponse() == P25_ANS_RSP_DENY) {
writeRF_TSDU_Deny(P25_DENY_RSN_TGT_UNIT_REFUSED, TSBK_IOSP_UU_ANS); writeRF_TSDU_Deny(P25_DENY_RSN_TGT_UNIT_REFUSED, TSBK_IOSP_UU_ANS);
@ -1465,7 +1465,8 @@ void TrunkPacket::writeRF_TDULC_ChanRelease(bool grp, uint32_t srcId, uint32_t d
/// </summary> /// </summary>
/// <param name="noNetwork"></param> /// <param name="noNetwork"></param>
/// <param name="clearBeforeWrite"></param> /// <param name="clearBeforeWrite"></param>
void TrunkPacket::writeRF_TSDU_SBF(bool noNetwork, bool clearBeforeWrite) /// <param name="force"></param>
void TrunkPacket::writeRF_TSDU_SBF(bool noNetwork, bool clearBeforeWrite, bool force)
{ {
if (!m_p25->m_control) if (!m_p25->m_control)
return; return;
@ -1496,19 +1497,21 @@ void TrunkPacket::writeRF_TSDU_SBF(bool noNetwork, bool clearBeforeWrite)
if (!noNetwork) if (!noNetwork)
writeNetworkRF(data + 2U, true); writeNetworkRF(data + 2U, true);
if (m_p25->m_dedicatedControl && m_ctrlTSDUMBF) { if (!force) {
writeRF_TSDU_MBF(clearBeforeWrite); if (m_p25->m_dedicatedControl && m_ctrlTSDUMBF) {
return; writeRF_TSDU_MBF(clearBeforeWrite);
} return;
}
if (m_p25->m_ccRunning && m_ctrlTSDUMBF) { if (m_p25->m_ccRunning && m_ctrlTSDUMBF) {
writeRF_TSDU_MBF(clearBeforeWrite); writeRF_TSDU_MBF(clearBeforeWrite);
return; return;
} }
if (clearBeforeWrite) { if (clearBeforeWrite) {
m_p25->m_modem->clearP25Data(); m_p25->m_modem->clearP25Data();
m_p25->m_queue.clear(); m_p25->m_queue.clear();
}
} }
if (m_p25->m_duplex) { if (m_p25->m_duplex) {
@ -1985,7 +1988,7 @@ bool TrunkPacket::writeRF_TSDU_Grant(bool grp, bool skip, bool net)
// transmit group grant // transmit group grant
m_rfTSBK.setLCO(TSBK_IOSP_GRP_VCH); m_rfTSBK.setLCO(TSBK_IOSP_GRP_VCH);
writeRF_TSDU_SBF(false, true); writeRF_TSDU_SBF(false, true, net);
} }
else { else {
if (!net) { if (!net) {
@ -1999,7 +2002,7 @@ bool TrunkPacket::writeRF_TSDU_Grant(bool grp, bool skip, bool net)
// transmit private grant // transmit private grant
m_rfTSBK.setLCO(TSBK_IOSP_UU_VCH); m_rfTSBK.setLCO(TSBK_IOSP_UU_VCH);
writeRF_TSDU_SBF(false, true); writeRF_TSDU_SBF(false, true, net);
} }
m_rfTSBK.setLCO(lco); m_rfTSBK.setLCO(lco);

@ -175,7 +175,7 @@ namespace p25
void writeRF_TDULC_ChanRelease(bool grp, uint32_t srcId, uint32_t dstId); void writeRF_TDULC_ChanRelease(bool grp, uint32_t srcId, uint32_t dstId);
/// <summary>Helper to write a single-block P25 TSDU packet.</summary> /// <summary>Helper to write a single-block P25 TSDU packet.</summary>
void writeRF_TSDU_SBF(bool noNetwork, bool clearBeforeWrite = false); void writeRF_TSDU_SBF(bool noNetwork, bool clearBeforeWrite = false, bool force = false);
/// <summary>Helper to write a multi-block (3-block) P25 TSDU packet.</summary> /// <summary>Helper to write a multi-block (3-block) P25 TSDU packet.</summary>
void writeRF_TSDU_MBF(bool clearBeforeWrite = false); void writeRF_TSDU_MBF(bool clearBeforeWrite = false);
@ -183,7 +183,7 @@ namespace p25
void queueRF_TSBK_Ctrl(uint8_t lco); void queueRF_TSBK_Ctrl(uint8_t lco);
/// <summary>Helper to write a grant packet.</summary> /// <summary>Helper to write a grant packet.</summary>
bool writeRF_TSDU_Grant(bool grp, bool skip, bool net); bool writeRF_TSDU_Grant(bool grp, bool skip = false, bool net = false);
/// <summary>Helper to write a unit to unit answer request packet.</summary> /// <summary>Helper to write a unit to unit answer request packet.</summary>
void writeRF_TSDU_UU_Ans_Req(uint32_t srcId, uint32_t dstId); void writeRF_TSDU_UU_Ans_Req(uint32_t srcId, uint32_t dstId);
/// <summary>Helper to write a acknowledge packet.</summary> /// <summary>Helper to write a acknowledge packet.</summary>

@ -343,7 +343,7 @@ bool VoicePacket::process(uint8_t* data, uint32_t len)
} }
} }
if (!m_p25->m_trunk->writeRF_TSDU_Grant(group, false, false)) { if (!m_p25->m_trunk->writeRF_TSDU_Grant(group)) {
return false; return false;
} }
} }
@ -356,7 +356,7 @@ bool VoicePacket::process(uint8_t* data, uint32_t len)
// single-channel trunking or voice on control support? // single-channel trunking or voice on control support?
if (m_p25->m_control && m_p25->m_voiceOnControl) { if (m_p25->m_control && m_p25->m_voiceOnControl) {
m_p25->m_ccRunning = false; // otherwise the grant will be bundled with other packets m_p25->m_ccRunning = false; // otherwise the grant will be bundled with other packets
m_p25->m_trunk->writeRF_TSDU_Grant(group, true, false); m_p25->m_trunk->writeRF_TSDU_Grant(group, true);
} }
m_hadVoice = true; m_hadVoice = true;
@ -779,6 +779,16 @@ bool VoicePacket::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, d
count += 16U; count += 16U;
if (m_p25->m_netState == RS_NET_IDLE) { if (m_p25->m_netState == RS_NET_IDLE) {
// are we interrupting a running CC?
if (m_p25->m_ccRunning) {
g_interruptP25Control = true;
}
// single-channel trunking or voice on control support?
if (m_p25->m_control && m_p25->m_voiceOnControl) {
m_p25->m_ccRunning = false; // otherwise the grant will be bundled with other packets
}
m_p25->m_modem->clearP25Data(); m_p25->m_modem->clearP25Data();
m_p25->m_queue.clear(); m_p25->m_queue.clear();
@ -1191,7 +1201,7 @@ void VoicePacket::writeNet_LDU1(const lc::LC& control, const data::LowSpeedData&
// single-channel trunking or voice on control support? // single-channel trunking or voice on control support?
if (m_p25->m_control && m_p25->m_voiceOnControl) { if (m_p25->m_control && m_p25->m_voiceOnControl) {
m_p25->m_ccRunning = false; // otherwise the grant will be bundled with other packets m_p25->m_ccRunning = false; // otherwise the grant will be bundled with other packets
if (!m_p25->m_trunk->writeRF_TSDU_Grant(group, true, true)) { if (!m_p25->m_trunk->writeRF_TSDU_Grant(group, false, true)) {
if (m_network != NULL) if (m_network != NULL)
m_network->resetP25(); m_network->resetP25();
@ -1213,6 +1223,8 @@ void VoicePacket::writeNet_LDU1(const lc::LC& control, const data::LowSpeedData&
return; return;
} }
m_p25->writeRF_Preamble(0, true);
} }
m_hadVoice = true; m_hadVoice = true;

Loading…
Cancel
Save

Powered by TurnKey Linux.