From 93917ef9b4bd79a712b532a2e6a263c1b1d91b74 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 28 Jun 2018 07:08:04 +0100 Subject: [PATCH] Add a timer to refresh the DAPNET Gateways status every 30 seconds. --- MMDVMHost.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 61e5d34..56df2dc 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -556,6 +556,8 @@ int CMMDVMHost::run() nxdn = new CNXDNControl(ran, id, selfOnly, m_nxdnNetwork, m_display, m_timeout, m_duplex, remoteGateway, m_nxdnLookup, rssi); } + CTimer pocsagTimer(1000U, 30U); + CPOCSAGControl* pocsag = NULL; if (m_pocsagEnabled) { unsigned int frequency = m_conf.getPOCSAGFrequency(); @@ -564,6 +566,8 @@ int CMMDVMHost::run() LogInfo(" Frequency: %uHz", frequency); pocsag = new CPOCSAGControl(m_pocsagNetwork, m_display); + + pocsagTimer.start(); } setMode(MODE_IDLE); @@ -958,6 +962,13 @@ int CMMDVMHost::run() m_dmrTXTimer.stop(); } + pocsagTimer.clock(ms); + if (pocsagTimer.isRunning() && pocsagTimer.hasExpired()) { + assert(m_pocsagNetwork != NULL); + m_pocsagNetwork->enable(m_mode == MODE_IDLE || m_mode == MODE_POCSAG); + pocsagTimer.start(); + } + if (m_ump != NULL) m_ump->clock(ms);