From bb49ce887a2485d20a1e66375818708de617579c Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Fri, 5 Jun 2020 11:14:29 +0100 Subject: [PATCH] Change fixed location timings at startup. --- YSFGateway/APRSWriter.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/YSFGateway/APRSWriter.cpp b/YSFGateway/APRSWriter.cpp index db8ca0c..0c25676 100644 --- a/YSFGateway/APRSWriter.cpp +++ b/YSFGateway/APRSWriter.cpp @@ -101,23 +101,17 @@ bool CAPRSWriter::open() ::gps_stream(&m_gpsdData, WATCH_ENABLE | WATCH_JSON, NULL); LogMessage("Connected to GPSD"); - - // Poll the GPS every minute - m_idTimer.setTimeout(60U); - } else { - m_idTimer.setTimeout(20U * 60U); } -#else - m_idTimer.setTimeout(20U * 60U); #endif - m_idTimer.start(); - bool ret = m_aprsSocket.open(); if (!ret) return false; LogMessage("Opened connection to the APRS Gateway"); + m_idTimer.setTimeout(60U); + m_idTimer.start(); + return true; } @@ -200,6 +194,7 @@ void CAPRSWriter::clock(unsigned int ms) #endif if (m_idTimer.hasExpired()) { sendIdFrameFixed(); + m_idTimer.setTimeout(20U * 60U); m_idTimer.start(); } #if !defined(_WIN32) && !defined(_WIN64)