aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/e300/e300_ublox_control_impl.cpp
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2015-05-01 16:06:12 -0700
committerMoritz Fischer <moritz.fischer@ettus.com>2015-05-01 16:06:12 -0700
commite1f466e24ebf3f890330d0dadbb399548d156ae4 (patch)
tree556d6f99b4f3c0224a0cb1eaa2eeb9e71668a0cb /host/lib/usrp/e300/e300_ublox_control_impl.cpp
parent4d3b80c338f34d7dc9516e7cdff7782aaf922b9c (diff)
downloaduhd-e1f466e24ebf3f890330d0dadbb399548d156ae4.tar.gz
uhd-e1f466e24ebf3f890330d0dadbb399548d156ae4.tar.bz2
uhd-e1f466e24ebf3f890330d0dadbb399548d156ae4.zip
e300: gps: If gps doesn't have lock return 0 as time.
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'host/lib/usrp/e300/e300_ublox_control_impl.cpp')
-rw-r--r--host/lib/usrp/e300/e300_ublox_control_impl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/host/lib/usrp/e300/e300_ublox_control_impl.cpp b/host/lib/usrp/e300/e300_ublox_control_impl.cpp
index 0b8a2048d..389bf79fa 100644
--- a/host/lib/usrp/e300/e300_ublox_control_impl.cpp
+++ b/host/lib/usrp/e300/e300_ublox_control_impl.cpp
@@ -65,7 +65,10 @@ std::vector<std::string> control_impl::get_sensors(void)
uhd::sensor_value_t control_impl::get_sensor(std::string key)
{
if (key == "gps_time") {
- return sensor_value_t("GPS epoch time", int(_get_epoch_time()), "seconds");
+ bool lock;
+ _locked.wait_and_see(lock);
+ return sensor_value_t("GPS epoch time",
+ lock ? int(_get_epoch_time()) : 0, "seconds");
} else if (key == "gps_locked") {
bool lock;
_locked.wait_and_see(lock);