attempt to add pass thru support for some LCs;

pull/65/head
Bryan Biedenkapp 2 years ago
parent 59a5482473
commit c8a60af83c

@ -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;

@ -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;

@ -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) +

Loading…
Cancel
Save

Powered by TurnKey Linux.