for LDU LC's pass thru any non-standard MFIDs without any further processing as-is;

pull/59/head
Bryan Biedenkapp 2 years ago
parent c7b0fc3a9d
commit 5650db1657

@ -61,7 +61,7 @@ namespace p25
const uint32_t P25_LDU_FRAME_TIME = 180U; const uint32_t P25_LDU_FRAME_TIME = 180U;
const uint32_t P25_HDU_LENGTH_BYTES = 81U; const uint32_t P25_HDU_LENGTH_BYTES = 81U;
const uint32_t P25_LDU_LC_LENGTH_BYTES = 18U; const uint32_t P25_LDU_LC_FEC_LENGTH_BYTES = 18U;
const uint32_t P25_TDULC_FEC_LENGTH_BYTES = 36U; const uint32_t P25_TDULC_FEC_LENGTH_BYTES = 36U;
const uint32_t P25_TDULC_LENGTH_BYTES = 18U; const uint32_t P25_TDULC_LENGTH_BYTES = 18U;
@ -92,6 +92,8 @@ namespace p25
const uint8_t P25_ENCRYPTED_NULL_IMBE[] = { 0xFCU, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U }; const uint8_t P25_ENCRYPTED_NULL_IMBE[] = { 0xFCU, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U };
const uint8_t P25_MFG_STANDARD = 0x00U; const uint8_t P25_MFG_STANDARD = 0x00U;
const uint8_t P25_MFG_STANDARD_ALT = 0x01U;
const uint8_t P25_MFG_MOT = 0x90U; const uint8_t P25_MFG_MOT = 0x90U;
const uint8_t P25_MFG_DVM_OCS = 0x9CU; // P25 MFId used for internal signalling; Omaha Communication Systems, LLC ($9C) const uint8_t P25_MFG_DVM_OCS = 0x9CU; // P25 MFId used for internal signalling; Omaha Communication Systems, LLC ($9C)

@ -251,8 +251,8 @@ void LC::encodeLDU1(uint8_t* data, const uint8_t* imbe)
break; break;
} }
uint8_t rs[P25_LDU_LC_LENGTH_BYTES]; uint8_t rs[P25_LDU_LC_FEC_LENGTH_BYTES];
::memset(rs, 0x00U, P25_LDU_LC_LENGTH_BYTES); ::memset(rs, 0x00U, P25_LDU_LC_FEC_LENGTH_BYTES);
rs[0U] = m_control->getLCO(); // LCO rs[0U] = m_control->getLCO(); // LCO
rs[1U] = m_control->getMFId(); // MFId rs[1U] = m_control->getMFId(); // MFId
@ -504,8 +504,8 @@ void LC::encodeLDU2(uint8_t* data, const uint8_t* imbe)
break; break;
} }
uint8_t rs[P25_LDU_LC_LENGTH_BYTES]; uint8_t rs[P25_LDU_LC_FEC_LENGTH_BYTES];
::memset(rs, 0x00U, P25_LDU_LC_LENGTH_BYTES); ::memset(rs, 0x00U, P25_LDU_LC_FEC_LENGTH_BYTES);
for (uint32_t i = 0; i < P25_MI_LENGTH_BYTES; i++) for (uint32_t i = 0; i < P25_MI_LENGTH_BYTES; i++)
rs[i] = mi[i]; // Message Indicator rs[i] = mi[i]; // Message Indicator

@ -233,7 +233,7 @@ bool LC::decodeLDU1(const uint8_t* data)
{ {
assert(data != nullptr); assert(data != nullptr);
uint8_t rs[P25_LDU_LC_LENGTH_BYTES + 1U]; uint8_t rs[P25_LDU_LC_FEC_LENGTH_BYTES + 1U];
// deinterleave and decode Hamming (10,6,3) for LC data // deinterleave and decode Hamming (10,6,3) for LC data
uint8_t raw[5U]; uint8_t raw[5U];
@ -268,7 +268,7 @@ bool LC::decodeLDU1(const uint8_t* data)
} }
} }
catch (...) { catch (...) {
Utils::dump(2U, "P25, RS excepted with input data", rs, P25_LDU_LC_LENGTH_BYTES); Utils::dump(2U, "P25, RS excepted with input data", rs, P25_LDU_LC_FEC_LENGTH_BYTES);
return false; return false;
} }
@ -287,8 +287,8 @@ void LC::encodeLDU1(uint8_t* data)
{ {
assert(data != nullptr); assert(data != nullptr);
uint8_t rs[P25_LDU_LC_LENGTH_BYTES]; uint8_t rs[P25_LDU_LC_FEC_LENGTH_BYTES];
::memset(rs, 0x00U, P25_LDU_LC_LENGTH_BYTES); ::memset(rs, 0x00U, P25_LDU_LC_FEC_LENGTH_BYTES);
encodeLC(rs); encodeLC(rs);
@ -337,7 +337,7 @@ bool LC::decodeLDU2(const uint8_t* data)
{ {
assert(data != nullptr); assert(data != nullptr);
uint8_t rs[P25_LDU_LC_LENGTH_BYTES + 1U]; uint8_t rs[P25_LDU_LC_FEC_LENGTH_BYTES + 1U];
// deinterleave and decode Hamming (10,6,3) for LC data // deinterleave and decode Hamming (10,6,3) for LC data
uint8_t raw[5U]; uint8_t raw[5U];
@ -372,7 +372,7 @@ bool LC::decodeLDU2(const uint8_t* data)
} }
} }
catch (...) { catch (...) {
Utils::dump(2U, "P25, RS excepted with input data", rs, P25_LDU_LC_LENGTH_BYTES); Utils::dump(2U, "P25, RS excepted with input data", rs, P25_LDU_LC_FEC_LENGTH_BYTES);
return false; return false;
} }
@ -415,8 +415,8 @@ void LC::encodeLDU2(uint8_t* data)
assert(data != nullptr); assert(data != nullptr);
assert(m_mi != nullptr); assert(m_mi != nullptr);
uint8_t rs[P25_LDU_LC_LENGTH_BYTES]; uint8_t rs[P25_LDU_LC_FEC_LENGTH_BYTES];
::memset(rs, 0x00U, P25_LDU_LC_LENGTH_BYTES); ::memset(rs, 0x00U, P25_LDU_LC_FEC_LENGTH_BYTES);
for (uint32_t i = 0; i < P25_MI_LENGTH_BYTES; i++) for (uint32_t i = 0; i < P25_MI_LENGTH_BYTES; i++)
rs[i] = m_mi[i]; // Message Indicator rs[i] = m_mi[i]; // Message Indicator
@ -566,20 +566,10 @@ bool LC::decodeLC(const uint8_t* rs)
m_mfId = rs[1U]; // Mfg Id. m_mfId = rs[1U]; // Mfg Id.
// Motorola P25 vendor opcodes (these are just detected for passthru) // non-standard P25 vendor opcodes (these are just detected for passthru)
if (m_mfId == P25_MFG_MOT) { if ((m_mfId != P25_MFG_STANDARD) && (m_mfId != P25_MFG_STANDARD_ALT)) {
switch (m_lco) { m_rsValue = rsValue;
case LC_TEL_INT_VCH_USER: // MOT GPS DATA return true;
m_rsValue = rsValue;
break;
default:
LogError(LOG_P25, "LC::decodeLC(), unknown LC value, mfId = $%02X, lco = $%02X", m_mfId, m_lco);
break;
}
if (m_mfId == P25_MFG_MOT) {
return true;
}
} }
// standard P25 reference opcodes // standard P25 reference opcodes
@ -703,18 +693,10 @@ void LC::encodeLC(uint8_t* rs)
break; break;
} }
// Motorola P25 vendor opcodes (these are just detected for passthru) // non-standard P25 vendor opcodes (these are just detected for passthru)
if (m_mfId == P25_MFG_MOT) { if ((m_mfId != P25_MFG_STANDARD) && (m_mfId != P25_MFG_STANDARD_ALT)) {
rsValue = 0U; rsValue = 0U;
rsValue = m_rsValue;
switch (m_lco) {
case LC_TEL_INT_VCH_USER: // MOT GPS DATA
rsValue = m_rsValue;
break;
default:
LogError(LOG_P25, "LC::encodeLC(), unknown LC value, mfId = $%02X, lco = $%02X", m_mfId, m_lco);
break;
}
} }
// split ulong64_t (8 byte) value into bytes // split ulong64_t (8 byte) value into bytes

Loading…
Cancel
Save

Powered by TurnKey Linux.