diff options
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/query_gpsdo_sensors.cpp | 34 |
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(); |