move buffer size checks to host watchdog thread; add additional checks to prevent aggressive buffer overflow check logging;

pull/69/head
Bryan Biedenkapp 1 year ago
parent 0c247a2b37
commit cac58cea1f

@ -276,10 +276,6 @@ void* Host::threadDMRWriter1(void* arg)
host->m_lastDstId = host->m_dmr->getLastDstId(1U);
host->m_lastSrcId = host->m_dmr->getLastSrcId(1U);
}
} else {
if (host->m_dmr->isQueueFull(1U)) {
LogError(LOG_HOST, "PANIC; modem->hasDMRSpace1() = %u, and DMR slot 1 queue is full!", ret);
}
}
}
}
@ -540,10 +536,6 @@ void* Host::threadDMRWriter2(void* arg)
host->m_lastDstId = host->m_dmr->getLastDstId(2U);
host->m_lastSrcId = host->m_dmr->getLastSrcId(2U);
}
} else {
if (host->m_dmr->isQueueFull(2U)) {
LogError(LOG_HOST, "PANIC; modem->hasDMRSpace2() = %u, and DMR slot 2 queue is full!", ret);
}
}
}
}

@ -213,10 +213,6 @@ void* Host::threadNXDNWriter(void* arg)
host->m_lastDstId = host->m_nxdn->getLastDstId();
host->m_lastSrcId = host->m_nxdn->getLastSrcId();
}
} else {
if (host->m_nxdn->isQueueFull()) {
LogError(LOG_HOST, "PANIC; modem->hasNXDNSpace() = %u, and NXDN queue is full!", ret);
}
}
}
}

@ -259,10 +259,6 @@ void* Host::threadP25Writer(void* arg)
else {
nextLen = 0U;
}
} else {
if (host->m_p25->isQueueFull()) {
LogError(LOG_HOST, "PANIC; modem->hasP25Space() = %u, and P25 queue is full!", ret);
}
}
}

@ -735,6 +735,11 @@ int Host::run()
if (m_network != nullptr)
m_network->clock(ms);
if (m_p25 != nullptr)
m_p25->reset();
if (m_nxdn != nullptr)
m_nxdn->reset();
Thread::sleep(IDLE_WARMUP_MS);
if (elapsedMs > 15000U)
@ -1706,12 +1711,26 @@ void* Host::threadWatchdog(void* arg)
LogError(LOG_HOST, "DMR, slot 1 frame processor hung >%us, ms = %u", host->m_dmrTx1WatchdogTimer.getTimeout(), host->m_dmrTx1LoopMS);
}
if (host->m_dmr->getTSCCSlotNo() != 1U) {
if (host->m_modem->gotModemStatus() && !host->m_modem->hasDMRSpace1() && host->m_dmr->isQueueFull(1U) &&
!host->m_dmrBeaconDurationTimer.isRunning()) {
LogError(LOG_HOST, "PANIC; has no DMR slot 1 buffer space, and DMR slot 1 queue is full!");
}
}
if (host->m_dmrTx2WatchdogTimer.isRunning())
host->m_dmrTx2WatchdogTimer.clock(ms);
if (host->m_dmrTx2WatchdogTimer.isRunning() && host->m_dmrTx2WatchdogTimer.hasExpired() && !host->m_dmrTx2WatchdogTimer.isPaused()) {
host->m_dmrTx2WatchdogTimer.pause();
LogError(LOG_HOST, "DMR, slot 2 frame processor hung >%us, ms = %u", host->m_dmrTx2WatchdogTimer.getTimeout(), host->m_dmrTx2LoopMS);
}
if (host->m_dmr->getTSCCSlotNo() != 2U) {
if (host->m_modem->gotModemStatus() && !host->m_modem->hasDMRSpace2() && host->m_dmr->isQueueFull(2U) &&
!host->m_dmrBeaconDurationTimer.isRunning()) {
LogError(LOG_HOST, "PANIC; has no DMR slot 2 buffer space, and DMR slot 2 queue is full!");
}
}
}
/** Project 25 */
@ -1720,7 +1739,12 @@ void* Host::threadWatchdog(void* arg)
host->m_p25TxWatchdogTimer.clock(ms);
if (host->m_p25TxWatchdogTimer.isRunning() && host->m_p25TxWatchdogTimer.hasExpired() && !host->m_p25TxWatchdogTimer.isPaused()) {
host->m_p25TxWatchdogTimer.pause();
LogError(LOG_HOST, "P25, frame processor hung >%us, ms = %u", host->m_p25TxWatchdogTimer.getTimeout(), host->m_p25TxLoopMS);
LogError(LOG_HOST, "P25, PANIC; frame processor hung >%us, ms = %u", host->m_p25TxWatchdogTimer.getTimeout(), host->m_p25TxLoopMS);
}
if (host->m_modem->gotModemStatus() && !host->m_modem->hasP25Space(P25DEF::P25_LDU_FRAME_LENGTH_BYTES) && host->m_p25->isQueueFull() &&
!host->m_p25CtrlChannel && !host->m_p25BcastDurationTimer.isRunning()) {
LogError(LOG_HOST, "PANIC; modem has no P25 buffer space, and internal P25 queue is full!");
}
}
@ -1732,6 +1756,11 @@ void* Host::threadWatchdog(void* arg)
host->m_nxdnTxWatchdogTimer.pause();
LogError(LOG_HOST, "NXDN, frame processor hung >%us, ms = %u", host->m_nxdnTxWatchdogTimer.getTimeout(), host->m_nxdnTxLoopMS);
}
if (host->m_modem->gotModemStatus() && !host->m_modem->hasNXDNSpace() && host->m_nxdn->isQueueFull() &&
!host->m_nxdnCtrlChannel && !host->m_nxdnBcastDurationTimer.isRunning()) {
LogError(LOG_HOST, "PANIC; modem has no NXDN buffer space, and NXDN queue is full!");
}
}
}

Loading…
Cancel
Save

Powered by TurnKey Linux.