fix issue where next MI wouldn't be calculated from the HDU MI if we received a valid HDU; fix issue with first superframe LDU1 containing a non-standard MFID resulting in incorrect destination IDs (if this happens and we've received a valid HDU, attempt to use the HDUs destination ID);

4.01b_maint
Bryan Biedenkapp 2 years ago
parent da2f6130a8
commit 07d6d3c91f

@ -49,8 +49,10 @@ void Voice::resetRF()
m_rfLC = lc; m_rfLC = lc;
//m_rfLastHDU = lc; //m_rfLastHDU = lc;
m_rfLastHDUValid = false;
m_rfLastLDU1 = lc; m_rfLastLDU1 = lc;
m_rfLastLDU2 = lc; m_rfLastLDU2 = lc;
m_rfFirstLDU2 = true;
m_rfFrames = 0U; m_rfFrames = 0U;
m_rfErrs = 0U; m_rfErrs = 0U;
@ -171,6 +173,7 @@ bool Voice::process(uint8_t* data, uint32_t len)
m_p25->m_rfLastSrcId = lc.getSrcId(); m_p25->m_rfLastSrcId = lc.getSrcId();
m_rfLastHDU = lc; m_rfLastHDU = lc;
m_rfLastHDUValid = true;
if (m_p25->m_rfState == RS_RF_LISTENING) { if (m_p25->m_rfState == RS_RF_LISTENING) {
if (!m_p25->m_dedicatedControl) { if (!m_p25->m_dedicatedControl) {
@ -206,6 +209,10 @@ bool Voice::process(uint8_t* data, uint32_t len)
uint32_t srcId = lc.getSrcId(); uint32_t srcId = lc.getSrcId();
uint32_t dstId = lc.getDstId(); uint32_t dstId = lc.getDstId();
if (dstId == 0U && !lc.isStandardMFId() && m_rfLastHDUValid) {
dstId = m_rfLastHDU.getDstId();
}
bool group = lc.getGroup(); bool group = lc.getGroup();
bool encrypted = lc.getEncrypted(); bool encrypted = lc.getEncrypted();
@ -767,12 +774,20 @@ bool Voice::process(uint8_t* data, uint32_t len)
uint8_t nextMI[MI_LENGTH_BYTES]; uint8_t nextMI[MI_LENGTH_BYTES];
::memset(nextMI, 0x00U, MI_LENGTH_BYTES); ::memset(nextMI, 0x00U, MI_LENGTH_BYTES);
if (m_rfFirstLDU2) {
m_rfFirstLDU2 = false;
if (m_rfLastHDUValid) {
m_rfLastHDU.getMI(lastMI);
}
}
else {
m_rfLastLDU2.getMI(lastMI); m_rfLastLDU2.getMI(lastMI);
getNextMI(lastMI, nextMI); }
getNextMI(lastMI, nextMI);
if (m_verbose && m_debug) { if (m_verbose && m_debug) {
Utils::dump(1U, "Previous P25 HDU MI", lastMI, MI_LENGTH_BYTES); Utils::dump(1U, "Previous P25 MI", lastMI, MI_LENGTH_BYTES);
Utils::dump(1U, "Calculated next P25 HDU MI", nextMI, MI_LENGTH_BYTES); Utils::dump(1U, "Calculated next P25 MI", nextMI, MI_LENGTH_BYTES);
} }
m_rfLC.setMI(nextMI); m_rfLC.setMI(nextMI);
@ -780,6 +795,7 @@ bool Voice::process(uint8_t* data, uint32_t len)
} }
else { else {
m_rfLastLDU2 = m_rfLC; m_rfLastLDU2 = m_rfLC;
m_rfFirstLDU2 = false;
} }
m_inbound = true; m_inbound = true;
@ -1371,8 +1387,10 @@ Voice::Voice(Control* p25, bool debug, bool verbose) :
m_audio(), m_audio(),
m_rfLC(), m_rfLC(),
m_rfLastHDU(), m_rfLastHDU(),
m_rfLastHDUValid(false),
m_rfLastLDU1(), m_rfLastLDU1(),
m_rfLastLDU2(), m_rfLastLDU2(),
m_rfFirstLDU2(true),
m_netLC(), m_netLC(),
m_netLastLDU1(), m_netLastLDU1(),
m_netLastFrameType(FrameType::DATA_UNIT), m_netLastFrameType(FrameType::DATA_UNIT),

@ -98,8 +98,10 @@ namespace p25
lc::LC m_rfLC; lc::LC m_rfLC;
lc::LC m_rfLastHDU; lc::LC m_rfLastHDU;
bool m_rfLastHDUValid;
lc::LC m_rfLastLDU1; lc::LC m_rfLastLDU1;
lc::LC m_rfLastLDU2; lc::LC m_rfLastLDU2;
bool m_rfFirstLDU2;
lc::LC m_netLC; lc::LC m_netLC;
lc::LC m_netLastLDU1; lc::LC m_netLastLDU1;

Loading…
Cancel
Save

Powered by TurnKey Linux.