diff options
author | Ben Kempke <bpkempke@umich.edu> | 2018-10-01 10:32:43 -0400 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2018-12-20 19:18:49 -0800 |
commit | d27dd7b6df652e78c582b560dbfaccd487501b19 (patch) | |
tree | 5b3ee8891aabfab5f09aaf24c336739a8caff992 /host/lib/usrp/gpsd_iface.cpp | |
parent | 4a1401770aa3629daf0e9321b1e05f845112b105 (diff) | |
download | uhd-d27dd7b6df652e78c582b560dbfaccd487501b19.tar.gz uhd-d27dd7b6df652e78c582b560dbfaccd487501b19.tar.bz2 uhd-d27dd7b6df652e78c582b560dbfaccd487501b19.zip |
gpsd: GPGGA string formatting fixes
- Add missing commas for empty fields
- Zeroize longitude and latitude
Diffstat (limited to 'host/lib/usrp/gpsd_iface.cpp')
-rw-r--r-- | host/lib/usrp/gpsd_iface.cpp | 8 |
1 files 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)); |