diff options
author | Josh Blum <josh@joshknows.com> | 2011-02-22 10:59:21 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-02-22 10:59:21 -0800 |
commit | 557d62ee648cef2a8edfd15602544064550f82fc (patch) | |
tree | 0614b00317b55a5a2b09315924cc43865ad6dc73 /host/lib/usrp/dboard/db_xcvr2450.cpp | |
parent | de35e125bc6e09fbe4da60f8f18390c137c77c43 (diff) | |
parent | 4613f454c781d258d6d9b210ff1b9043a2125981 (diff) | |
download | uhd-557d62ee648cef2a8edfd15602544064550f82fc.tar.gz uhd-557d62ee648cef2a8edfd15602544064550f82fc.tar.bz2 uhd-557d62ee648cef2a8edfd15602544064550f82fc.zip |
Merge branch 'sensors' into dboard_serial
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: |