aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-10 18:18:25 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-05 09:11:21 +0200
commitd1d04465def44c3f736f6e1a6cf92c924422663f (patch)
tree261f5da446a169a4f4bc430b00d5fed861f9096f /host/utils
parentbfb9c1c77ecd06120a16cebce9de2225d87e50f2 (diff)
downloaduhd-d1d04465def44c3f736f6e1a6cf92c924422663f.tar.gz
uhd-d1d04465def44c3f736f6e1a6cf92c924422663f.tar.bz2
uhd-d1d04465def44c3f736f6e1a6cf92c924422663f.zip
Add support for LEA-M8F GPSDO boardlea-m8f-v3.14.1.0
Diffstat (limited to 'host/utils')
-rw-r--r--host/utils/query_gpsdo_sensors.cpp34
1 files changed, 28 insertions, 6 deletions
diff --git a/host/utils/query_gpsdo_sensors.cpp b/host/utils/query_gpsdo_sensors.cpp
index 4a8aa24d2..749e48869 100644
--- a/host/utils/query_gpsdo_sensors.cpp
+++ b/host/utils/query_gpsdo_sensors.cpp
@@ -26,6 +26,9 @@
namespace po = boost::program_options;
namespace fs = boost::filesystem;
+const size_t WARMUP_TIMEOUT_MS = 30000;
+const size_t LOCK_TIMEOUT_MS = 60000;
+
void print_notes(void)
{
// Helpful notes
@@ -59,14 +62,19 @@ int query_clock_sensors(const std::string& args)
// Print NMEA strings
try {
- uhd::sensor_value_t gga_string = clock->get_sensor("gps_gpgga");
- uhd::sensor_value_t rmc_string = clock->get_sensor("gps_gprmc");
+ uhd::sensor_value_t gpgga_string = clock->get_sensor("gps_gpgga");
+ uhd::sensor_value_t gprmc_string = clock->get_sensor("gps_gprmc");
+ uhd::sensor_value_t gngga_string = clock->get_sensor("gps_gngga");
+ uhd::sensor_value_t gnrmc_string = clock->get_sensor("gps_gnrmc");
uhd::sensor_value_t servo_string = clock->get_sensor("gps_servo");
+ uhd::sensor_value_t timelock_string = clock->get_sensor("gps_timelock");
std::cout << boost::format("\nPrinting available NMEA strings:\n");
- std::cout << boost::format("%s\n%s\n") % gga_string.to_pp_string()
- % rmc_string.to_pp_string();
+ std::cout << boost::format("%s\n%s\n") % gpgga_string.to_pp_string() % gprmc_string.to_pp_string();
+ std::cout << boost::format("%s\n%s\n") % gngga_string.to_pp_string() % gnrmc_string.to_pp_string();
std::cout << boost::format("\nPrinting GPS servo status:\n");
std::cout << boost::format("%s\n\n") % servo_string.to_pp_string();
+ std::cout << boost::format("\nPrinting GPS timelock:\n");
+ std::cout << boost::format("%s\n\n") % timelock_string.to_pp_string();
} catch (const uhd::lookup_error&) {
std::cout << "NMEA strings not implemented for this device." << std::endl;
}
@@ -123,6 +131,11 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
// Verify GPS sensors are present (i.e. EEPROM has been burnt)
std::vector<std::string> sensor_names = usrp->get_mboard_sensor_names(0);
+ std::cout << " Sensors: " << std::endl;
+ for (const auto& name : sensor_names) {
+ std::cout << " Sensor: " << name << std::endl;
+ }
+
if (std::find(sensor_names.begin(), sensor_names.end(), "gps_locked")
== sensor_names.end()) {
std::cout << boost::format("\ngps_locked sensor not found. This could mean that "
@@ -253,11 +266,20 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
try {
uhd::sensor_value_t gga_string = usrp->get_mboard_sensor("gps_gpgga");
uhd::sensor_value_t rmc_string = usrp->get_mboard_sensor("gps_gprmc");
- std::cout << boost::format("Printing available NMEA strings:\n");
+ std::cout << boost::format("Printing available GP NMEA strings:\n");
std::cout << boost::format("%s\n%s\n") % gga_string.to_pp_string()
% rmc_string.to_pp_string();
} catch (uhd::lookup_error&) {
- std::cout << "NMEA strings not implemented for this device." << std::endl;
+ std::cout << "GP NMEA strings not implemented for this device." << std::endl;
+ }
+ try {
+ uhd::sensor_value_t gga_string = usrp->get_mboard_sensor("gps_gngga");
+ uhd::sensor_value_t rmc_string = usrp->get_mboard_sensor("gps_gnrmc");
+ std::cout << boost::format("Printing available GN NMEA strings:\n");
+ std::cout << boost::format("%s\n%s\n") % gga_string.to_pp_string()
+ % rmc_string.to_pp_string();
+ } catch (uhd::lookup_error&) {
+ std::cout << "GN NMEA strings not implemented for this device." << std::endl;
}
std::cout << boost::format("GPS Epoch time at last PPS: %.5f seconds\n")
% usrp->get_mboard_sensor("gps_time").to_real();