aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2016-07-18 14:34:00 -0700
committerMartin Braun <martin.braun@ettus.com>2016-09-02 11:10:46 -0700
commit59ed6e1a0f9710c7bfca0a348d07f8c96f9f6bc0 (patch)
tree368f9aa5e9b2031beb92bc3916fa2a7bba8b372a /host/lib/usrp/x300
parent196e93a387dea47ab8a3ad600b90446e98840a54 (diff)
downloaduhd-59ed6e1a0f9710c7bfca0a348d07f8c96f9f6bc0.tar.gz
uhd-59ed6e1a0f9710c7bfca0a348d07f8c96f9f6bc0.tar.bz2
uhd-59ed6e1a0f9710c7bfca0a348d07f8c96f9f6bc0.zip
GPSDO: Make sure read_uart() returns only complete strings for all devices.
Diffstat (limited to 'host/lib/usrp/x300')
-rw-r--r--host/lib/usrp/x300/x300_fw_uart.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/host/lib/usrp/x300/x300_fw_uart.cpp b/host/lib/usrp/x300/x300_fw_uart.cpp
index b0fae124d..86141ca9a 100644
--- a/host/lib/usrp/x300/x300_fw_uart.cpp
+++ b/host/lib/usrp/x300/x300_fw_uart.cpp
@@ -132,6 +132,10 @@ struct x300_uart_iface : uart_iface
if (ch == '\r')
continue;
+ // avoid returning empty strings
+ if (ch == '\n' and _rxbuff.empty())
+ continue;
+
// store character to buffer
_rxbuff += std::string(1, (char)ch);