aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/query_gpsdo_sensors.cpp
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2015-05-01 17:04:38 -0700
committerMoritz Fischer <moritz.fischer@ettus.com>2015-05-01 17:04:53 -0700
commit96f044e2734b6bac56f54537d5b1ccd104ae4a1d (patch)
tree40b4c8483fbd10558533ecc4a65e790a7e6c5f42 /host/utils/query_gpsdo_sensors.cpp
parente1f466e24ebf3f890330d0dadbb399548d156ae4 (diff)
downloaduhd-96f044e2734b6bac56f54537d5b1ccd104ae4a1d.tar.gz
uhd-96f044e2734b6bac56f54537d5b1ccd104ae4a1d.tar.bz2
uhd-96f044e2734b6bac56f54537d5b1ccd104ae4a1d.zip
uhd: utils: query_gpsdo: Explicitly set time_source to 'gpsdo'.
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'host/utils/query_gpsdo_sensors.cpp')
-rw-r--r--host/utils/query_gpsdo_sensors.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/host/utils/query_gpsdo_sensors.cpp b/host/utils/query_gpsdo_sensors.cpp
index 9a40d2b42..3b98a634c 100644
--- a/host/utils/query_gpsdo_sensors.cpp
+++ b/host/utils/query_gpsdo_sensors.cpp
@@ -101,11 +101,15 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}else
std::cout << boost::format("ref_locked sensor not present on this board.\n");
+ // Explicitly set time source to gpsdo
+ usrp->set_time_source("gpsdo");
+
//Check PPS and compare UHD device time to GPS time
boost::this_thread::sleep(boost::posix_time::seconds(1));
uhd::sensor_value_t gps_time = usrp->get_mboard_sensor("gps_time");
const time_t pc_clock_time = time(NULL);
const uhd::time_spec_t last_pps_time = usrp->get_time_last_pps();
+
if (last_pps_time.to_ticks(1.0) == gps_time.to_int()) {
std::cout << boost::format("GPS and UHD Device time are aligned.\n");
} else {