From 6f4a283526a4067d10f48f78bf634dda4a381081 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 4 Jun 2020 08:52:29 +0100 Subject: [PATCH] Add more gpsd sanity checking. --- YSFGateway/APRSWriter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/YSFGateway/APRSWriter.cpp b/YSFGateway/APRSWriter.cpp index 869d9a1..6bc5992 100644 --- a/YSFGateway/APRSWriter.cpp +++ b/YSFGateway/APRSWriter.cpp @@ -279,6 +279,9 @@ void CAPRSWriter::sendIdFrameMobile() if (::gps_read(&m_gpsdData, NULL, 0) <= 0) return; + if (m_gpsdData.status != STATUS_FIX) + return; + bool latlonSet = (m_gpsdData.set & LATLON_SET) == LATLON_SET; bool altitudeSet = (m_gpsdData.set & ALTITUDE_SET) == ALTITUDE_SET; bool velocitySet = (m_gpsdData.set & SPEED_SET) == SPEED_SET;