Beispiel #1
0
 uhd::sensor_value_t get_sensor(std::string key)
 {
     if (key == "gps_locked") {
         return sensor_value_t(
             "GPS lock status", _gps_locked(), "locked", "unlocked");
     } else if (key == "gps_time") {
         return sensor_value_t(
             "GPS epoch time", int(_epoch_time()), "seconds");
     } else if (key == "gps_gpgga") {
         return sensor_value_t(
             "GPGGA", _gps_gpgga(), "");
     } else if (key == "gps_gprmc") {
         return sensor_value_t(
             "GPRMC", _gps_gprmc(), "");
     } else if (key == "gps_position") {
         return sensor_value_t(
             "GPS Position", str(
                 boost::format("%s %s %s")
                 % _gps_position()["lat"]
                 % _gps_position()["lon"]
                 % _gps_position()["alt"]), "lat/lon/alt");
     } else
         throw uhd::key_error(
             str(boost::format("sensor %s unknown.") % key));
 }
Beispiel #2
0
 uhd::sensor_value_t get_ref_locked()
 {
     bool locked = false;
     if (_clock_source == "external" || _clock_source == "gpsdo") {
         locked = (_core_status_reg.read(fpga::core_status_reg_t::REF_LOCKED) == 1);
     } else {
         //If the source is internal, the charge pump on the ADF4001 is tristated which
         //means that the 40MHz VCTXXO is free running i.e. always "locked"
         locked = true;
     }
     return sensor_value_t("Ref", locked, "locked", "unlocked");
 }