summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2014-05-06 16:11:10 -0700
committermichael-west <michael.west@ettus.com>2014-05-06 16:11:10 -0700
commitd878f8e42b1f5750c456cec3da5f5c2c39126414 (patch)
tree1f9578cc4d55946ee38dfcd8d50c09ab20820a2d /host/lib
parent41d217d0a7e70be4804d30bfa1c64cdcedfffa42 (diff)
downloaduhd-d878f8e42b1f5750c456cec3da5f5c2c39126414.tar.gz
uhd-d878f8e42b1f5750c456cec3da5f5c2c39126414.tar.bz2
uhd-d878f8e42b1f5750c456cec3da5f5c2c39126414.zip
BUG #460: X300: GPGGA sensor most often empty, while RMC is usually OK
- It was found that strings containing only a newline character were being returned by N-series and X-series devices. - Added better handling of strings received under 6 bytes. - Added erasing of end of line characters.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/gps_ctrl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp
index 6f5c75dec..d327a84f9 100644
--- a/host/lib/usrp/gps_ctrl.cpp
+++ b/host/lib/usrp/gps_ctrl.cpp
@@ -74,8 +74,15 @@ private:
// Get all GPSDO messages available
// Creating a map here because we only want the latest of each message type
- for (std::string msg = _recv(); msg.length() > 6; msg = _recv())
+ for (std::string msg = _recv(); msg.length(); msg = _recv())
{
+ if (msg.length() < 6)
+ continue;
+
+ // Strip any end of line characters
+ erase_all(msg, "\r");
+ erase_all(msg, "\n");
+
// Look for SERVO message
if (boost::regex_search(msg, status_regex, boost::regex_constants::match_continuous))
msgs["SERVO"] = msg;