aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-22 10:59:21 -0800
committerJosh Blum <josh@joshknows.com>2011-02-22 10:59:21 -0800
commit557d62ee648cef2a8edfd15602544064550f82fc (patch)
tree0614b00317b55a5a2b09315924cc43865ad6dc73 /host/lib/usrp/dboard
parentde35e125bc6e09fbe4da60f8f18390c137c77c43 (diff)
parent4613f454c781d258d6d9b210ff1b9043a2125981 (diff)
downloaduhd-557d62ee648cef2a8edfd15602544064550f82fc.tar.gz
uhd-557d62ee648cef2a8edfd15602544064550f82fc.tar.bz2
uhd-557d62ee648cef2a8edfd15602544064550f82fc.zip
Merge branch 'sensors' into dboard_serial
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r--host/lib/usrp/dboard/db_basic_and_lf.cpp8
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp10
-rw-r--r--host/lib/usrp/dboard/db_dbsrx2.cpp10
-rw-r--r--host/lib/usrp/dboard/db_rfx.cpp19
-rw-r--r--host/lib/usrp/dboard/db_tvrx.cpp5
-rw-r--r--host/lib/usrp/dboard/db_unknown.cpp8
-rw-r--r--host/lib/usrp/dboard/db_wbx.cpp19
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp25
8 files changed, 66 insertions, 38 deletions
diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp
index b311576d2..b319289db 100644
--- a/host/lib/usrp/dboard/db_basic_and_lf.cpp
+++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp
@@ -173,10 +173,6 @@ void basic_rx::rx_get(const wax::obj &key_, wax::obj &val){
val = false;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = true; //there is no LO, so it must be true!
- return;
-
case SUBDEV_PROP_BANDWIDTH:
val = subdev_bandwidth_scalar[get_subdev_name()]*_max_freq;
return;
@@ -284,10 +280,6 @@ void basic_tx::tx_get(const wax::obj &key_, wax::obj &val){
val = false;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = true; //there is no LO, so it must be true!
- return;
-
case SUBDEV_PROP_BANDWIDTH:
val = subdev_bandwidth_scalar[get_subdev_name()]*_max_freq;
return;
diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp
index 3ea9cea80..98d9479fc 100644
--- a/host/lib/usrp/dboard/db_dbsrx.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx.cpp
@@ -25,6 +25,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>
@@ -561,8 +562,13 @@ void dbsrx::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:
+ 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:
diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp
index defb70ff5..f4b797995 100644
--- a/host/lib/usrp/dboard/db_dbsrx2.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx2.cpp
@@ -22,6 +22,7 @@
#include <uhd/utils/assert.hpp>
#include <uhd/utils/algorithm.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>
@@ -400,8 +401,13 @@ void dbsrx2::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:
+ 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:
diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp
index 2c672ded8..3e3cf00f2 100644
--- a/host/lib/usrp/dboard/db_rfx.cpp
+++ b/host/lib/usrp/dboard/db_rfx.cpp
@@ -36,6 +36,7 @@
#include <uhd/types/dict.hpp>
#include <uhd/usrp/subdev_props.hpp>
#include <uhd/types/ranges.hpp>
+#include <uhd/types/sensors.hpp>
#include <uhd/utils/assert.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/utils/algorithm.hpp>
@@ -449,8 +450,13 @@ void rfx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){
val = false;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = this->get_locked(dboard_iface::UNIT_RX);
+ case SUBDEV_PROP_SENSOR:
+ UHD_ASSERT_THROW(key.name == "lo_locked");
+ val = sensor_value_t("LO", this->get_locked(dboard_iface::UNIT_RX), "locked", "unlocked");
+ return;
+
+ case SUBDEV_PROP_SENSOR_NAMES:
+ val = prop_names_t(1, "lo_locked");
return;
case SUBDEV_PROP_BANDWIDTH:
@@ -546,8 +552,13 @@ void rfx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){
val = true;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = this->get_locked(dboard_iface::UNIT_TX);
+ case SUBDEV_PROP_SENSOR:
+ UHD_ASSERT_THROW(key.name == "lo_locked");
+ val = sensor_value_t("LO", this->get_locked(dboard_iface::UNIT_TX), "locked", "unlocked");
+ return;
+
+ case SUBDEV_PROP_SENSOR_NAMES:
+ val = prop_names_t(1, "lo_locked");
return;
case SUBDEV_PROP_BANDWIDTH:
diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp
index a9ce38000..578999432 100644
--- a/host/lib/usrp/dboard/db_tvrx.cpp
+++ b/host/lib/usrp/dboard/db_tvrx.cpp
@@ -32,6 +32,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>
@@ -463,10 +464,6 @@ void tvrx::rx_get(const wax::obj &key_, wax::obj &val){
val = false;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = true;
- return;
-
case SUBDEV_PROP_BANDWIDTH:
val = 6.0e6;
return;
diff --git a/host/lib/usrp/dboard/db_unknown.cpp b/host/lib/usrp/dboard/db_unknown.cpp
index d91d58409..f0a4c000e 100644
--- a/host/lib/usrp/dboard/db_unknown.cpp
+++ b/host/lib/usrp/dboard/db_unknown.cpp
@@ -154,10 +154,6 @@ void unknown_rx::rx_get(const wax::obj &key_, wax::obj &val){
val = false;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = true; //there is no LO, so it must be true!
- return;
-
case SUBDEV_PROP_BANDWIDTH:
val = 0.0;
return;
@@ -256,10 +252,6 @@ void unknown_tx::tx_get(const wax::obj &key_, wax::obj &val){
val = false;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = true; //there is no LO, so it must be true!
- return;
-
case SUBDEV_PROP_BANDWIDTH:
val = 0.0;
return;
diff --git a/host/lib/usrp/dboard/db_wbx.cpp b/host/lib/usrp/dboard/db_wbx.cpp
index 135997789..0bc2d0ca1 100644
--- a/host/lib/usrp/dboard/db_wbx.cpp
+++ b/host/lib/usrp/dboard/db_wbx.cpp
@@ -68,6 +68,7 @@
#include <uhd/types/dict.hpp>
#include <uhd/usrp/subdev_props.hpp>
#include <uhd/types/ranges.hpp>
+#include <uhd/types/sensors.hpp>
#include <uhd/utils/assert.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/utils/algorithm.hpp>
@@ -521,8 +522,13 @@ void wbx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){
val = false;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = this->get_locked(dboard_iface::UNIT_RX);
+ case SUBDEV_PROP_SENSOR:
+ UHD_ASSERT_THROW(key.name == "lo_locked");
+ val = sensor_value_t("LO", this->get_locked(dboard_iface::UNIT_RX), "locked", "unlocked");
+ return;
+
+ case SUBDEV_PROP_SENSOR_NAMES:
+ val = prop_names_t(1, "lo_locked");
return;
case SUBDEV_PROP_BANDWIDTH:
@@ -622,8 +628,13 @@ void wbx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){
val = false;
return;
- case SUBDEV_PROP_LO_LOCKED:
- val = this->get_locked(dboard_iface::UNIT_TX);
+ case SUBDEV_PROP_SENSOR:
+ UHD_ASSERT_THROW(key.name == "lo_locked");
+ val = sensor_value_t("LO", this->get_locked(dboard_iface::UNIT_TX), "locked", "unlocked");
+ return;
+
+ case SUBDEV_PROP_SENSOR_NAMES:
+ val = prop_names_t(1, "lo_locked");
return;
case SUBDEV_PROP_BANDWIDTH:
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: