diff options
| author | michael-west <michael.west@ettus.com> | 2014-05-06 16:29:22 -0700 | 
|---|---|---|
| committer | michael-west <michael.west@ettus.com> | 2014-05-06 16:29:22 -0700 | 
| commit | 583208af1e4b5cedc03464e52d5be527bc3b9286 (patch) | |
| tree | 1f9578cc4d55946ee38dfcd8d50c09ab20820a2d | |
| parent | 41d217d0a7e70be4804d30bfa1c64cdcedfffa42 (diff) | |
| parent | d878f8e42b1f5750c456cec3da5f5c2c39126414 (diff) | |
| download | uhd-583208af1e4b5cedc03464e52d5be527bc3b9286.tar.gz uhd-583208af1e4b5cedc03464e52d5be527bc3b9286.tar.bz2 uhd-583208af1e4b5cedc03464e52d5be527bc3b9286.zip  | |
Merge branch 'mwest/gpsdo_empty_strings' into maint
| -rw-r--r-- | host/lib/usrp/gps_ctrl.cpp | 9 | 
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;  | 
