aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/e100/e100_ctrl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-09-02 11:27:37 -0700
committerMartin Braun <martin.braun@ettus.com>2016-09-02 11:27:37 -0700
commit83912104a9c1ab3631f755a4d98ee86e195db690 (patch)
tree4c7ba7da761b1b9b5508bffdb77b9e0696ff46ae /host/lib/usrp/e100/e100_ctrl.cpp
parent670eeda6e4c9ff2ab81f4e387bce49ea4dc79dcc (diff)
parent065065e90ce970f8eed0941ded6ae4377e649c2b (diff)
downloaduhd-83912104a9c1ab3631f755a4d98ee86e195db690.tar.gz
uhd-83912104a9c1ab3631f755a4d98ee86e195db690.tar.bz2
uhd-83912104a9c1ab3631f755a4d98ee86e195db690.zip
Merge branch 'UHD-3.9.LTS' into maint
This provides the GPS fixes. Conflicts: host/CMakeLists.txt tools/debs/upload_debs.sh
Diffstat (limited to 'host/lib/usrp/e100/e100_ctrl.cpp')
-rw-r--r--host/lib/usrp/e100/e100_ctrl.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/host/lib/usrp/e100/e100_ctrl.cpp b/host/lib/usrp/e100/e100_ctrl.cpp
index cdbbff6dd..c164a6fb0 100644
--- a/host/lib/usrp/e100/e100_ctrl.cpp
+++ b/host/lib/usrp/e100/e100_ctrl.cpp
@@ -232,10 +232,13 @@ public:
//got a character -> process it
if (ret == 1){
- const bool flush = ch == '\n' or ch == '\r';
- if (flush and line.empty()) continue; //avoid flushing on empty lines
- line += std::string(1, ch);
- if (flush) break;
+ _line += ch;
+ if (ch == '\n')
+ {
+ line = _line;
+ _line.clear();
+ break;
+ }
}
//didnt get a character, check the timeout
@@ -251,7 +254,9 @@ public:
return line;
}
-private: int _node_fd;
+private:
+ int _node_fd;
+ std::string _line;
};
uhd::uart_iface::sptr e100_ctrl::make_gps_uart_iface(const std::string &node){