aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_xcvr2450.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-11 18:43:20 -0800
committerJosh Blum <josh@joshknows.com>2011-02-11 18:43:20 -0800
commit9de6f36bc5d9f5d9d602547166c92b53b278b428 (patch)
tree6ad2101b5c5e1051188067318dcd045fbd37834a /host/lib/usrp/dboard/db_xcvr2450.cpp
parente4b45cca1b99d92baab061d36b6c0ceaebdfe5b7 (diff)
downloaduhd-9de6f36bc5d9f5d9d602547166c92b53b278b428.tar.gz
uhd-9de6f36bc5d9f5d9d602547166c92b53b278b428.tar.bz2
uhd-9de6f36bc5d9f5d9d602547166c92b53b278b428.zip
usrp: implement sensors in all the dboards, deprecated read rssi and get lo locked
Diffstat (limited to 'host/lib/usrp/dboard/db_xcvr2450.cpp')
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp25
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: