From e88a3a0b2ab3d48ac12bdb65edf13784be4c70cb Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sat, 8 Feb 2025 15:07:34 -0500 Subject: [PATCH] add support to decode LC_CALL_TERM when DVM is used in some reverse repeater situations; --- src/common/p25/lc/tdulc/LC_CALL_TERM.cpp | 14 ++++++++++++-- src/common/p25/lc/tdulc/TDULCFactory.cpp | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/common/p25/lc/tdulc/LC_CALL_TERM.cpp b/src/common/p25/lc/tdulc/LC_CALL_TERM.cpp index 96377749..84634f4c 100644 --- a/src/common/p25/lc/tdulc/LC_CALL_TERM.cpp +++ b/src/common/p25/lc/tdulc/LC_CALL_TERM.cpp @@ -4,7 +4,7 @@ * GPLv2 Open Source. Use is subject to license terms. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (C) 2022,2024 Bryan Biedenkapp, N2PLL + * Copyright (C) 2022,2024,2025 Bryan Biedenkapp, N2PLL * */ #include "Defines.h" @@ -34,7 +34,17 @@ bool LC_CALL_TERM::decode(const uint8_t* data) { assert(data != nullptr); - /* stub */ + uint8_t rs[P25_TDULC_LENGTH_BYTES + 1U]; + ::memset(rs, 0x00U, P25_TDULC_LENGTH_BYTES); + + bool ret = TDULC::decode(data, rs); + if (!ret) + return false; + + ulong64_t rsValue = TDULC::toValue(rs); + + m_implicit = true; + m_dstId = (uint32_t)(rsValue & 0xFFFFFFU); // Target Address return true; } diff --git a/src/common/p25/lc/tdulc/TDULCFactory.cpp b/src/common/p25/lc/tdulc/TDULCFactory.cpp index 8d3bd6a2..4d5a9890 100644 --- a/src/common/p25/lc/tdulc/TDULCFactory.cpp +++ b/src/common/p25/lc/tdulc/TDULCFactory.cpp @@ -79,6 +79,8 @@ std::unique_ptr TDULCFactory::createTDULC(const uint8_t* data) return decode(new LC_PRIVATE(), data); case LCO::TEL_INT_VCH_USER: return decode(new LC_TEL_INT_VCH_USER(), data); + case LCO::CALL_TERM: + return decode(new LC_CALL_TERM(), data); default: LogError(LOG_P25, "TDULCFactory::create(), unknown TDULC LCO value, lco = $%02X", lco); break;