made incoming traffic update P25 channel grant timer to fix embedded STC; fixed VC LDU2 grant check (#25)

pull/26/head 2023-03-29
K4YT3X 3 years ago committed by GitHub
parent ca9703233d
commit 43d6420b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1056,13 +1056,7 @@ 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, frameType);
else {
if (m_voiceOnControl) {
ret = m_voice->processNetwork(data, length, control, lsd, duid, frameType);
}
}
break;
case P25_DUID_TDU:

@ -783,6 +783,15 @@ bool Voice::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L
m_netLastLDU1 = control;
m_netLastFrameType = frameType;
if (m_p25->m_control) {
lc::LC control = lc::LC(*m_dfsiLC.control());
m_p25->m_affiliations.touchGrant(control.getDstId());
}
if (m_p25->m_dedicatedControl && !m_p25->m_voiceOnControl) {
return true;
}
if (m_p25->m_netState == RS_NET_IDLE) {
// are we interrupting a running CC?
if (m_p25->m_ccRunning) {
@ -838,6 +847,15 @@ bool Voice::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L
m_dfsiLC.decodeLDU2(data + count, m_netLDU2 + 204U);
count += 16U;
if (m_p25->m_control) {
lc::LC control = lc::LC(*m_dfsiLC.control());
m_p25->m_affiliations.touchGrant(control.getDstId());
}
if (m_p25->m_dedicatedControl && !m_p25->m_voiceOnControl) {
return true;
}
if (m_p25->m_netState == RS_NET_IDLE) {
if (!m_p25->m_voiceOnControl) {
m_p25->m_modem->clearP25Data();
@ -1113,8 +1131,7 @@ void Voice::writeNet_LDU1()
// don't process network frames if this modem isn't authoritative
if (!m_p25->m_authoritative && m_p25->m_permittedDstId != dstId) {
// bryanb: do we want to log this condition?
//LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted!");
LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic (LDU1), destination not permitted!");
resetNet();
return;
}
@ -1395,6 +1412,15 @@ void Voice::writeNet_LDU2()
lc::LC control = lc::LC(*m_dfsiLC.control());
data::LowSpeedData lsd = data::LowSpeedData(*m_dfsiLC.lsd());
uint32_t dstId = control.getDstId();
// don't process network frames if this modem isn't authoritative
if (!m_p25->m_authoritative && m_p25->m_permittedDstId != dstId) {
LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic (LDU2), destination not permitted!");
resetNet();
return;
}
// don't process network frames if the destination ID's don't match and the network TG hang timer is running
if (m_p25->m_rfLastDstId != 0U) {
if (m_p25->m_rfLastDstId != m_netLastLDU1.getDstId() && (m_p25->m_rfTGHang.isRunning() && !m_p25->m_rfTGHang.hasExpired())) {

Loading…
Cancel
Save

Powered by TurnKey Linux.