diff options
Diffstat (limited to 'host/lib/usrp/dboard/db_xcvr2450.cpp')
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 6fb5a26a8..f4f74eb86 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -53,6 +53,7 @@ #include <uhd/utils/algorithm.hpp> #include <uhd/utils/warning.hpp> #include <uhd/types/ranges.hpp> +#include <uhd/types/sensors.hpp> #include <uhd/types/dict.hpp> #include <uhd/usrp/subdev_props.hpp> #include <uhd/usrp/dboard_base.hpp> @@ -616,12 +617,19 @@ void xcvr2450::rx_get(const wax::obj &key_, wax::obj &val){ val = false; return; - case SUBDEV_PROP_LO_LOCKED: - val = this->get_locked(); + case SUBDEV_PROP_SENSOR: + if (key.name == "lo_locked") + val = sensor_value_t("LO", this->get_locked(), "locked", "unlocked"); + else if (key.name == "rssi") + val = sensor_value_t("RSSI", this->get_rssi(), "dB"); + else + UHD_THROW_INVALID_CODE_PATH(); return; - case SUBDEV_PROP_RSSI: - val = this->get_rssi(); + case SUBDEV_PROP_SENSOR_NAMES:{ + prop_names_t names = list_of("lo_locked")("rssi"); + val = names; + } return; case SUBDEV_PROP_BANDWIDTH: @@ -719,8 +727,13 @@ void xcvr2450::tx_get(const wax::obj &key_, wax::obj &val){ val = false; return; - case SUBDEV_PROP_LO_LOCKED: - val = this->get_locked(); + case SUBDEV_PROP_SENSOR: + UHD_ASSERT_THROW(key.name == "lo_locked"); + val = sensor_value_t("LO", this->get_locked(), "locked", "unlocked"); + return; + + case SUBDEV_PROP_SENSOR_NAMES: + val = prop_names_t(1, "lo_locked"); return; case SUBDEV_PROP_BANDWIDTH: |