From 84b13d668a2f6c90e0c47060d0f5782375e55138 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Wed, 26 Jul 2023 13:42:57 -0400 Subject: [PATCH] move netId and sysId 0 check; --- src/p25/Control.cpp | 9 +++++++++ src/p25/packet/Voice.cpp | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/p25/Control.cpp b/src/p25/Control.cpp index ef901704..2d9763bc 100644 --- a/src/p25/Control.cpp +++ b/src/p25/Control.cpp @@ -1135,6 +1135,15 @@ void Control::processNetwork() uint8_t frameType = p25::P25_FT_DATA_UNIT; + // if the netId or sysId is missing; default to our netId and sysId + if (netId == 0U) { + netId = lc::LC::getSiteData().netId(); + } + + if (sysId == 0U) { + sysId = lc::LC::getSiteData().sysId(); + } + if (m_debug) { LogDebug(LOG_NET, "P25, duid = $%02X, lco = $%02X, MFId = $%02X, srcId = %u, dstId = %u, len = %u", duid, lco, MFId, srcId, dstId, length); } diff --git a/src/p25/packet/Voice.cpp b/src/p25/packet/Voice.cpp index 19696f92..15f24f85 100644 --- a/src/p25/packet/Voice.cpp +++ b/src/p25/packet/Voice.cpp @@ -1430,14 +1430,6 @@ void Voice::writeNet_LDU1() // is the network peer a different WACN or system ID? if (m_p25->m_control && m_p25->m_allowExplicitSourceId) { - if (netId == 0U) { - netId = lc::LC::getSiteData().netId(); - } - - if (sysId == 0U) { - sysId = lc::LC::getSiteData().sysId(); - } - if (sysId != lc::LC::getSiteData().sysId()) { // per TIA-102.AABD-D transmit EXPLICIT_SOURCE_ID every other frame (e.g. every other LDU1) m_roamLDU1Count++;