From c8a60af83c1896fec2bac63cdad74a2aed576e96 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Thu, 25 Jul 2024 16:43:36 -0400 Subject: [PATCH] attempt to add pass thru support for some LCs; --- src/common/p25/lc/LC.cpp | 11 +++++++++++ src/common/p25/lc/LC.h | 6 ++++++ src/host/modem/ModemV24.cpp | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/common/p25/lc/LC.cpp b/src/common/p25/lc/LC.cpp index 1bd85186..ee1a057f 100644 --- a/src/common/p25/lc/LC.cpp +++ b/src/common/p25/lc/LC.cpp @@ -66,6 +66,7 @@ LC::LC() : m_rs(), m_encryptOverride(false), m_tsbkVendorSkip(false), + m_demandUseRawLC(false), m_callTimer(0U), m_mi(nullptr) { @@ -507,6 +508,7 @@ void LC::copy(const LC& data) m_callTimer = data.m_callTimer; m_rsValue = data.m_rsValue; + m_demandUseRawLC = data.m_demandUseRawLC; m_algId = data.m_algId; if (m_algId != ALGO_UNENCRYPT) { @@ -541,6 +543,8 @@ void LC::copy(const LC& data) bool LC::decodeLC(const uint8_t* rs) { + m_demandUseRawLC = false; + ulong64_t rsValue = 0U; // combine bytes into ulong64_t (8 byte) value @@ -563,6 +567,7 @@ bool LC::decodeLC(const uint8_t* rs) // as the packed RS value) if ((m_mfId != MFG_STANDARD) && (m_mfId != MFG_STANDARD_ALT)) { //Utils::dump(1U, "Decoded P25 Non-Standard RS", rs, P25_LDU_LC_FEC_LENGTH_BYTES); + m_demandUseRawLC = true; return true; } @@ -580,6 +585,9 @@ bool LC::decodeLC(const uint8_t* rs) m_dstId = (uint32_t)((rsValue >> 24) & 0xFFFFU); // Talkgroup Address m_srcId = (uint32_t)(rsValue & 0xFFFFFFU); // Source Radio Address break; + case LCO::GROUP_UPDT: + m_demandUseRawLC = true; + break; case LCO::PRIVATE: m_mfId = rs[1U]; // Mfg Id. m_group = false; @@ -607,6 +615,9 @@ bool LC::decodeLC(const uint8_t* rs) m_sysId = (uint32_t)((rsValue >> 24) & 0xFFFU); // System ID m_srcId = (uint32_t)(rsValue & 0xFFFFFFU); // Source Radio Address break; + case LCO::RFSS_STS_BCAST: + m_demandUseRawLC = true; + break; default: LogError(LOG_P25, "LC::decodeLC(), unknown LC value, mfId = $%02X, lco = $%02X", m_mfId, m_lco); return false; diff --git a/src/common/p25/lc/LC.h b/src/common/p25/lc/LC.h index 8e8ddc5f..97b0fa77 100644 --- a/src/common/p25/lc/LC.h +++ b/src/common/p25/lc/LC.h @@ -111,6 +111,11 @@ namespace p25 * @returns bool True, if the MFId contained for this LC is standard, otherwise false. */ bool isStandardMFId() const; + /** + * @brief Helper to determine if we should utilize the raw RS data from the decode. + * @returns bool True, if the raw LC value should be used, otherwise false. + */ + bool isDemandUseRawLC() const { return m_demandUseRawLC; } /** @name Encryption data */ /** @@ -234,6 +239,7 @@ namespace p25 edac::RS634717 m_rs; bool m_encryptOverride; bool m_tsbkVendorSkip; + bool m_demandUseRawLC; uint32_t m_callTimer; diff --git a/src/host/modem/ModemV24.cpp b/src/host/modem/ModemV24.cpp index 2aacf868..23273c45 100644 --- a/src/host/modem/ModemV24.cpp +++ b/src/host/modem/ModemV24.cpp @@ -1329,7 +1329,7 @@ void ModemV24::convertFromAir(uint8_t* data, uint32_t length) ::memset(rs, 0x00U, P25_LDU_LC_FEC_LENGTH_BYTES); if (duid == DUID::LDU1) { - if (lc.isStandardMFId()) { + if (lc.isStandardMFId() && !lc.isDemandUseRawLC()) { uint8_t serviceOptions = (lc.getEmergency() ? 0x80U : 0x00U) + (lc.getEncrypted() ? 0x40U : 0x00U) +