From d27dd7b6df652e78c582b560dbfaccd487501b19 Mon Sep 17 00:00:00 2001 From: Ben Kempke Date: Mon, 1 Oct 2018 10:32:43 -0400 Subject: gpsd: GPGGA string formatting fixes - Add missing commas for empty fields - Zeroize longitude and latitude --- host/lib/usrp/gpsd_iface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/host/lib/usrp/gpsd_iface.cpp b/host/lib/usrp/gpsd_iface.cpp index 1858a6a24..c70011771 100644 --- a/host/lib/usrp/gpsd_iface.cpp +++ b/host/lib/usrp/gpsd_iface.cpp @@ -242,9 +242,9 @@ private: // member functions % tm.tm_hour % tm.tm_min % tm.tm_sec - % _deg_to_dm(std::abs(_gps_data.fix.latitude)) + % _zeroize(_deg_to_dm(std::abs(_gps_data.fix.latitude))) % ((_gps_data.fix.latitude > 0) ? 'N' : 'S') - % _deg_to_dm(std::abs(_gps_data.fix.longitude)) + % _zeroize(_deg_to_dm(std::abs(_gps_data.fix.longitude))) % ((_gps_data.fix.longitude > 0) ? 'E' : 'W') % _gps_data.status % _gps_data.satellites_used); @@ -256,13 +256,13 @@ private: // member functions str(boost::format("%.2f,") % _gps_data.dop.hdop)); if (boost::math::isnan(_gps_data.fix.altitude)) - string.append(","); + string.append(",,"); else string.append( str(boost::format("%.2f,M,") % _gps_data.fix.altitude)); if (boost::math::isnan(_gps_data.separation)) - string.append(","); + string.append(",,"); else string.append( str(boost::format("%.3f,M,") % _gps_data.separation)); -- cgit v1.2.3