properly log a TOT state;

pull/128/head
Bryan Biedenkapp 3 months ago
parent 4e7a08ea18
commit 3324b67bc8

@ -691,7 +691,7 @@ void Slot::clock()
if (m_rfTimeoutTimer.isRunning() && m_rfTimeoutTimer.hasExpired()) {
if (!m_rfTimeout) {
LogInfoEx(LOG_RF, "DMR Slot %u, user has timed out", m_slotNo);
LogInfoEx(LOG_RF, "DMR Slot %u, traffic timeout timer has expired, traffic will not transmit", m_slotNo);
m_rfTimeout = true;
}
}
@ -733,7 +733,7 @@ void Slot::clock()
if (m_netTimeoutTimer.isRunning() && m_netTimeoutTimer.hasExpired()) {
if (!m_netTimeout) {
LogInfoEx(LOG_NET, "DMR Slot %u, user has timed out", m_slotNo);
LogInfoEx(LOG_NET, "DMR Slot %u, traffic timeout timer has expired, traffic will not transmit", m_slotNo);
m_netTimeout = true;
}
}

@ -96,10 +96,10 @@ Control::Control(bool authoritative, uint32_t ran, uint32_t callHang, uint32_t q
m_ccRunning(false),
m_ccPrevRunning(false),
m_ccHalted(false),
m_rfTimeout(1000U, timeout),
m_rfTimeoutTimer(1000U, timeout),
m_rfTGHang(1000U, tgHang),
m_rfLossWatchdog(1000U, 0U, 1500U),
m_netTimeout(1000U, timeout),
m_netTimeoutTimer(1000U, timeout),
m_netTGHang(1000U, 2U),
m_networkWatchdog(1000U, 0U, 1500U),
m_ccPacketInterval(1000U, 0U, 80U),
@ -115,6 +115,8 @@ Control::Control(bool authoritative, uint32_t ran, uint32_t callHang, uint32_t q
m_minRSSI(0U),
m_aveRSSI(0U),
m_rssiCount(0U),
m_rfTimeout(false),
m_netTimeout(false),
m_dumpRCCH(dumpRCCHData),
m_notifyCC(true),
m_ccDebug(debug),
@ -666,8 +668,15 @@ void Control::clock()
}
// handle timeouts and hang timers
m_rfTimeout.clock(ms);
m_netTimeout.clock(ms);
m_rfTimeoutTimer.clock(ms);
m_netTimeoutTimer.clock(ms);
if (m_rfTimeoutTimer.isRunning() && m_rfTimeoutTimer.hasExpired()) {
if (!m_rfTimeout) {
LogInfoEx(LOG_RF, "traffic timeout timer has expired, traffic will not transmit");
m_rfTimeout = true;
}
}
if (m_rfTGHang.isRunning()) {
m_rfTGHang.clock(ms);
@ -704,6 +713,13 @@ void Control::clock()
}
}
if (m_netTimeoutTimer.isRunning() && m_netTimeoutTimer.hasExpired()) {
if (!m_netTimeout) {
LogInfoEx(LOG_NET, "timeout timer has expired, traffic will not transmit");
m_netTimeout = true;
}
}
if (m_authoritative) {
if (m_netTGHang.isRunning()) {
m_netTGHang.clock(ms);
@ -752,7 +768,8 @@ void Control::clock()
m_netState = RS_NET_IDLE;
m_netTimeout.stop();
m_netTimeoutTimer.stop();
m_netTimeout = false;
writeEndNet();
}
@ -899,10 +916,10 @@ void Control::addFrame(const uint8_t *data, bool net, bool imm)
std::lock_guard<std::mutex> lock(s_queueLock);
if (!net) {
if (m_rfTimeout.isRunning() && m_rfTimeout.hasExpired())
if (m_rfTimeoutTimer.isRunning() && m_rfTimeoutTimer.hasExpired())
return;
} else {
if (m_netTimeout.isRunning() && m_netTimeout.hasExpired())
if (m_netTimeoutTimer.isRunning() && m_netTimeoutTimer.hasExpired())
return;
}
@ -1094,7 +1111,8 @@ void Control::processFrameLoss(RPT_RF_LOSS_TYPE type)
m_rfTGHang.stop();
m_rfLossWatchdog.stop();
m_rfTimeout.stop();
m_rfTimeoutTimer.stop();
m_rfTimeout = false;
m_txQueue.clear();
if (m_network != nullptr)
@ -1416,7 +1434,8 @@ void Control::writeEndRF()
m_rfMask = 0x00U;
m_rfLC.reset();
m_rfTimeout.stop();
m_rfTimeoutTimer.stop();
m_rfTimeout = false;
//m_queue.clear();
if (m_network != nullptr)
@ -1432,7 +1451,8 @@ void Control::writeEndNet()
m_netMask = 0x00U;
m_netLC.reset();
m_netTimeout.stop();
m_netTimeoutTimer.stop();
m_netTimeout = false;
m_networkWatchdog.stop();
if (m_network != nullptr)

@ -322,10 +322,10 @@ namespace nxdn
bool m_ccPrevRunning;
bool m_ccHalted;
Timer m_rfTimeout;
Timer m_rfTimeoutTimer;
Timer m_rfTGHang;
Timer m_rfLossWatchdog;
Timer m_netTimeout;
Timer m_netTimeoutTimer;
Timer m_netTGHang;
Timer m_networkWatchdog;
@ -350,6 +350,9 @@ namespace nxdn
uint32_t m_aveRSSI;
uint32_t m_rssiCount;
bool m_rfTimeout;
bool m_netTimeout;
bool m_dumpRCCH;
bool m_notifyCC;

@ -317,7 +317,7 @@ void ControlSignaling::writeNetwork(const uint8_t *data, uint32_t len)
if (m_nxdn->m_network == nullptr)
return;
if (m_nxdn->m_rfTimeout.isRunning() && m_nxdn->m_rfTimeout.hasExpired())
if (m_nxdn->m_rfTimeoutTimer.isRunning() && m_nxdn->m_rfTimeoutTimer.hasExpired())
return;
m_nxdn->m_network->writeNXDN(m_nxdn->m_rfLC, data, len, true);

@ -405,7 +405,7 @@ void Data::writeNetwork(const uint8_t *data, uint32_t len)
if (m_nxdn->m_network == nullptr)
return;
if (m_nxdn->m_rfTimeout.isRunning() && m_nxdn->m_rfTimeout.hasExpired())
if (m_nxdn->m_rfTimeoutTimer.isRunning() && m_nxdn->m_rfTimeoutTimer.hasExpired())
return;
m_nxdn->m_network->writeNXDN(m_nxdn->m_rfLC, data, len);

@ -257,7 +257,7 @@ bool Voice::process(FuncChannelType::E fct, ChOption::E option, uint8_t* data, u
m_rfErrs = 0U;
m_rfBits = 1U;
m_nxdn->m_networkWatchdog.start();
m_nxdn->m_rfTimeout.start();
m_nxdn->m_rfTimeoutTimer.start();
m_nxdn->m_rfState = RS_RF_AUDIO;
m_nxdn->m_minRSSI = m_nxdn->m_rssi;
@ -409,7 +409,7 @@ bool Voice::process(FuncChannelType::E fct, ChOption::E option, uint8_t* data, u
m_rfFrames = 0U;
m_rfErrs = 0U;
m_rfBits = 1U;
m_nxdn->m_rfTimeout.start();
m_nxdn->m_rfTimeoutTimer.start();
m_nxdn->m_rfState = RS_RF_AUDIO;
m_nxdn->m_minRSSI = m_nxdn->m_rssi;
@ -775,7 +775,7 @@ bool Voice::processNetwork(FuncChannelType::E fct, ChOption::E option, lc::RTCH&
m_nxdn->writeEndNet();
} else {
m_netFrames = 0U;
m_nxdn->m_netTimeout.start();
m_nxdn->m_netTimeoutTimer.start();
m_nxdn->m_netState = RS_NET_AUDIO;
m_nxdn->m_networkWatchdog.start();
@ -913,7 +913,7 @@ bool Voice::processNetwork(FuncChannelType::E fct, ChOption::E option, lc::RTCH&
m_rfFrames = 0U;
m_rfErrs = 0U;
m_rfBits = 1U;
m_nxdn->m_netTimeout.start();
m_nxdn->m_netTimeoutTimer.start();
m_nxdn->m_netState = RS_NET_AUDIO;
m_nxdn->m_networkWatchdog.start();
@ -1104,7 +1104,7 @@ void Voice::writeNetwork(const uint8_t *data, uint32_t len)
if (m_nxdn->m_network == nullptr)
return;
if (m_nxdn->m_rfTimeout.isRunning() && m_nxdn->m_rfTimeout.hasExpired())
if (m_nxdn->m_rfTimeoutTimer.isRunning() && m_nxdn->m_rfTimeoutTimer.hasExpired())
return;
m_nxdn->m_network->writeNXDN(m_nxdn->m_rfLC, data, len);

@ -110,10 +110,10 @@ Control::Control(bool authoritative, uint32_t nac, uint32_t callHang, uint32_t q
m_ccRunning(false),
m_ccPrevRunning(false),
m_ccHalted(false),
m_rfTimeout(1000U, timeout),
m_rfTimeoutTimer(1000U, timeout),
m_rfTGHang(1000U, tgHang),
m_rfLossWatchdog(1000U, 0U, 1500U),
m_netTimeout(1000U, timeout),
m_netTimeoutTimer(1000U, timeout),
m_netTGHang(1000U, 2U),
m_networkWatchdog(1000U, 0U, 1500U),
m_adjSiteUpdate(1000U, 75U),
@ -137,6 +137,8 @@ Control::Control(bool authoritative, uint32_t nac, uint32_t callHang, uint32_t q
m_minRSSI(0U),
m_aveRSSI(0U),
m_rssiCount(0U),
m_rfTimeout(false),
m_netTimeout(false),
m_ccNotifyActiveTG(false),
m_disableAdjSiteBroadcast(false),
m_notifyCC(true),
@ -925,10 +927,17 @@ void Control::clock()
}
// handle timeouts and hang timers
m_rfTimeout.clock(ms);
m_netTimeout.clock(ms);
m_rfTimeoutTimer.clock(ms);
m_netTimeoutTimer.clock(ms);
m_rfVoiceCallTermTimeout.clock(ms);
if (m_rfTimeoutTimer.isRunning() && m_rfTimeoutTimer.hasExpired()) {
if (!m_rfTimeout) {
LogInfoEx(LOG_RF, "traffic timeout timer has expired, traffic will not transmit");
m_rfTimeout = true;
}
}
if (m_rfTGHang.isRunning()) {
m_rfTGHang.clock(ms);
@ -964,6 +973,13 @@ void Control::clock()
}
}
if (m_netTimeoutTimer.isRunning() && m_netTimeoutTimer.hasExpired()) {
if (!m_netTimeout) {
LogInfoEx(LOG_NET, "timeout timer has expired, traffic will not transmit");
m_netTimeout = true;
}
}
if (m_authoritative) {
if (m_netTGHang.isRunning()) {
m_netTGHang.clock(ms);
@ -991,7 +1007,8 @@ void Control::clock()
m_data->resetReceivedBlocks();
m_netState = RS_NET_IDLE;
m_tailOnIdle = true;
m_netTimeout.stop();
m_netTimeoutTimer.stop();
m_netTimeout = false;
}
m_netLastDstId = 0U;
@ -1047,7 +1064,8 @@ void Control::clock()
m_voice->resetNet();
m_data->resetReceivedBlocks();
m_netTimeout.stop();
m_netTimeoutTimer.stop();
m_netTimeout = false;
}
}
@ -1365,10 +1383,10 @@ void Control::addFrame(const uint8_t* data, uint32_t length, bool net, bool imm)
std::lock_guard<std::mutex> lock(s_queueLock);
if (!net) {
if (m_rfTimeout.isRunning() && m_rfTimeout.hasExpired())
if (m_rfTimeoutTimer.isRunning() && m_rfTimeoutTimer.hasExpired())
return;
} else {
if (m_netTimeout.isRunning() && m_netTimeout.hasExpired())
if (m_netTimeoutTimer.isRunning() && m_netTimeoutTimer.hasExpired())
return;
}
@ -1774,7 +1792,8 @@ void Control::processFrameLoss(RPT_RF_LOSS_TYPE type)
m_tailOnIdle = true;
m_rfTimeout.stop();
m_rfTimeoutTimer.stop();
m_rfTimeout = false;
m_txQueue.clear();
if (m_network != nullptr)
@ -1792,7 +1811,8 @@ void Control::processFrameLoss(RPT_RF_LOSS_TYPE type)
m_data->resetRF();
m_rfTimeout.stop();
m_rfTimeoutTimer.stop();
m_rfTimeout = false;
m_txQueue.clear();
}

@ -358,10 +358,10 @@ namespace p25
bool m_ccPrevRunning;
bool m_ccHalted;
Timer m_rfTimeout;
Timer m_rfTimeoutTimer;
Timer m_rfTGHang;
Timer m_rfLossWatchdog;
Timer m_netTimeout;
Timer m_netTimeoutTimer;
Timer m_netTGHang;
Timer m_networkWatchdog;
@ -409,6 +409,9 @@ namespace p25
uint32_t m_aveRSSI;
uint32_t m_rssiCount;
bool m_rfTimeout;
bool m_netTimeout;
static std::mutex s_activeTGLock;
bool m_ccNotifyActiveTG;

@ -1344,7 +1344,7 @@ void ControlSignaling::writeNetworkRF(lc::TSBK* tsbk, const uint8_t* data, bool
if (m_p25->m_network == nullptr)
return;
if (m_p25->m_rfTimeout.isRunning() && m_p25->m_rfTimeout.hasExpired())
if (m_p25->m_rfTimeoutTimer.isRunning() && m_p25->m_rfTimeoutTimer.hasExpired())
return;
lc::LC lc = lc::LC();
@ -1367,7 +1367,7 @@ void ControlSignaling::writeNetworkRF(lc::TDULC* tduLc, const uint8_t* data, boo
if (m_p25->m_network == nullptr)
return;
if (m_p25->m_rfTimeout.isRunning() && m_p25->m_rfTimeout.hasExpired())
if (m_p25->m_rfTimeoutTimer.isRunning() && m_p25->m_rfTimeoutTimer.hasExpired())
return;
lc::LC lc = lc::LC();
@ -1404,7 +1404,8 @@ void ControlSignaling::writeRF_TDULC(lc::TDULC* lc, bool noNetwork)
// add status bits
P25Utils::addStatusBits(data + 2U, P25_TDULC_FRAME_LENGTH_BITS, false, false);
m_p25->m_rfTimeout.stop();
m_p25->m_rfTimeoutTimer.stop();
m_p25->m_rfTimeout = false;
if (!noNetwork)
writeNetworkRF(lc, data + 2U, false);
@ -1460,7 +1461,8 @@ void ControlSignaling::writeNet_TDULC(lc::TDULC* lc)
if (m_p25->m_network != nullptr)
m_p25->m_network->resetP25();
m_p25->m_netTimeout.stop();
m_p25->m_netTimeoutTimer.stop();
m_p25->m_netTimeout = false;
m_p25->m_networkWatchdog.stop();
m_p25->m_netState = RS_NET_IDLE;
m_p25->m_tailOnIdle = true;

@ -963,7 +963,7 @@ void Data::writeNetwork(const uint8_t currentBlock, const uint8_t* data, uint32_
if (m_p25->m_network == nullptr)
return;
if (m_p25->m_rfTimeout.isRunning() && m_p25->m_rfTimeout.hasExpired())
if (m_p25->m_rfTimeoutTimer.isRunning() && m_p25->m_rfTimeoutTimer.hasExpired())
return;
m_p25->m_network->writeP25PDU(m_rfAssembler->dataHeader, currentBlock, data, len, lastBlock);

@ -601,7 +601,7 @@ bool Voice::process(uint8_t* data, uint32_t len)
m_pktLDU1Count = 0U;
m_grpUpdtCount = 0U;
m_roamLDU1Count = 0U;
m_p25->m_rfTimeout.start();
m_p25->m_rfTimeoutTimer.start();
m_lastDUID = DUID::HDU;
m_rfLastHDU = lc::LC();
@ -1027,7 +1027,7 @@ bool Voice::process(uint8_t* data, uint32_t len)
m_pktLDU1Count = 0U;
m_grpUpdtCount = 0U;
m_roamLDU1Count = 0U;
m_p25->m_rfTimeout.start();
m_p25->m_rfTimeoutTimer.start();
m_lastDUID = DUID::HDU;
m_rfLastHDU = lc::LC();
@ -1130,7 +1130,8 @@ bool Voice::process(uint8_t* data, uint32_t len)
m_lastDUID = duid;
m_p25->m_rfTimeout.stop();
m_p25->m_rfTimeoutTimer.stop();
m_p25->m_rfTimeout = false;
}
else {
std::unique_ptr<lc::TDULC> tdulc = lc::tdulc::TDULCFactory::createTDULC(data + 2U);
@ -1439,7 +1440,7 @@ void Voice::writeNetwork(const uint8_t *data, defines::DUID::E duid, defines::Fr
if (m_p25->m_network == nullptr)
return;
if (m_p25->m_rfTimeout.isRunning() && m_p25->m_rfTimeout.hasExpired())
if (m_p25->m_rfTimeoutTimer.isRunning() && m_p25->m_rfTimeoutTimer.hasExpired())
return;
uint8_t controlByte = 0U;
@ -1715,7 +1716,8 @@ void Voice::writeNet_TDU()
resetWithNullAudio(m_netLDU1, false);
resetWithNullAudio(m_netLDU2, false);
m_p25->m_netTimeout.stop();
m_p25->m_netTimeoutTimer.stop();
m_p25->m_netTimeout = false;
m_p25->m_networkWatchdog.stop();
resetNet();
m_p25->m_netState = RS_NET_IDLE;
@ -1877,7 +1879,8 @@ void Voice::writeNet_LDU1()
resetWithNullAudio(m_netLDU1, false);
resetWithNullAudio(m_netLDU2, false);
m_p25->m_netTimeout.stop();
m_p25->m_netTimeoutTimer.stop();
m_p25->m_netTimeout = false;
m_p25->m_networkWatchdog.stop();
m_netLC = lc::LC();
@ -1945,7 +1948,7 @@ void Voice::writeNet_LDU1()
m_p25->m_netLastSrcId = srcId;
m_p25->m_networkWatchdog.start();
m_p25->m_netTGHang.start();
m_p25->m_netTimeout.start();
m_p25->m_netTimeoutTimer.start();
m_netFrames = 0U;
m_netLost = 0U;
m_pktLDU1Count = 0U;

Loading…
Cancel
Save

Powered by TurnKey Linux.