fix payload calculation for activity log; correct order of operations for testing if the RF hangtimer is running;

pull/33/head
Bryan Biedenkapp 3 years ago
parent 8cd92914ba
commit b1718f3e0a

@ -517,7 +517,7 @@ void FNENetwork::clock(uint32_t ms)
uint8_t rawPayload[length - 11U];
::memset(rawPayload, 0x00U, length - 11U);
::memcpy(rawPayload, buffer.get() + 11U, length - 11U);
std::string payload(rawPayload, rawPayload + sizeof(rawPayload));
std::string payload(rawPayload, rawPayload + (length - 11U));
std::stringstream ss;
ss << peerId << " " << payload;

@ -1151,6 +1151,18 @@ void Voice::writeNet_LDU1()
uint32_t srcId = control.getSrcId();
bool group = control.getLCO() == LC_GROUP;
// don't process network frames if the destination ID's don't match and the network TG hang timer is running
if (m_p25->m_rfLastDstId != 0U && dstId != 0U) {
if (m_p25->m_rfLastDstId != dstId && (m_p25->m_rfTGHang.isRunning() && !m_p25->m_rfTGHang.hasExpired())) {
resetNet();
return;
}
if (m_p25->m_rfLastDstId == dstId && (m_p25->m_rfTGHang.isRunning() && !m_p25->m_rfTGHang.hasExpired())) {
m_p25->m_rfTGHang.start();
}
}
// ensure our srcId and dstId are sane from the last LDU1
if (m_netLastLDU1.getDstId() != 0U) {
if (dstId != m_netLastLDU1.getDstId()) {
@ -1181,18 +1193,6 @@ void Voice::writeNet_LDU1()
return;
}
// don't process network frames if the destination ID's don't match and the network TG hang timer is running
if (m_p25->m_rfLastDstId != 0U) {
if (m_p25->m_rfLastDstId != dstId && (m_p25->m_rfTGHang.isRunning() && !m_p25->m_rfTGHang.hasExpired())) {
resetNet();
return;
}
if (m_p25->m_rfLastDstId == dstId && (m_p25->m_rfTGHang.isRunning() && !m_p25->m_rfTGHang.hasExpired())) {
m_p25->m_rfTGHang.start();
}
}
// don't process network frames if the RF modem isn't in a listening state
if (m_p25->m_rfState != RS_RF_LISTENING) {
if (m_rfLC.getSrcId() == srcId && m_rfLC.getDstId() == dstId) {

Loading…
Cancel
Save

Powered by TurnKey Linux.