From c416e55ceef1e0150fe086183b28b7fa690817b9 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 4 Jun 2020 08:54:12 +0100 Subject: [PATCH] Add more gpsd sanity checking. --- NXDNGateway/APRSWriter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NXDNGateway/APRSWriter.cpp b/NXDNGateway/APRSWriter.cpp index 43518d5..b6c9dd0 100644 --- a/NXDNGateway/APRSWriter.cpp +++ b/NXDNGateway/APRSWriter.cpp @@ -224,6 +224,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;