From 93aee136535aa77348d3b7f3520f066a4167126d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 18 Aug 2011 10:11:57 -0700 Subject: usrp: dboard sensors fix, populate for tvrx, and should be empty on basics/unknown --- host/lib/usrp/dboard/db_basic_and_lf.cpp | 4 ++-- host/lib/usrp/dboard/db_tvrx.cpp | 4 ++++ host/lib/usrp/dboard/db_unknown.cpp | 4 ++-- host/lib/usrp/dboard_manager.cpp | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp index ff93f1d89..64d4a5bee 100644 --- a/host/lib/usrp/dboard/db_basic_and_lf.cpp +++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp @@ -162,7 +162,7 @@ void basic_rx::rx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_SENSOR_NAMES: - val = prop_names_t(1, ""); //vector of 1 empty string + val = std::vector(); //empty return; case SUBDEV_PROP_CONNECTION: @@ -272,7 +272,7 @@ void basic_tx::tx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_SENSOR_NAMES: - val = prop_names_t(1, ""); //vector of 1 empty string + val = std::vector(); //empty return; case SUBDEV_PROP_CONNECTION: diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp index 3b8b276e0..907d798dd 100644 --- a/host/lib/usrp/dboard/db_tvrx.cpp +++ b/host/lib/usrp/dboard/db_tvrx.cpp @@ -463,6 +463,10 @@ void tvrx::rx_get(const wax::obj &key_, wax::obj &val){ val = 6.0e6; return; + case SUBDEV_PROP_SENSOR_NAMES: + val = std::vector(); //empty + return; + default: UHD_THROW_PROP_GET_ERROR(); } } diff --git a/host/lib/usrp/dboard/db_unknown.cpp b/host/lib/usrp/dboard/db_unknown.cpp index 0587d015c..cd7ffe348 100644 --- a/host/lib/usrp/dboard/db_unknown.cpp +++ b/host/lib/usrp/dboard/db_unknown.cpp @@ -142,7 +142,7 @@ void unknown_rx::rx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_SENSOR_NAMES: - val = prop_names_t(1, ""); //vector of 1 empty string + val = std::vector(); //empty return; case SUBDEV_PROP_CONNECTION: @@ -242,7 +242,7 @@ void unknown_tx::tx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_SENSOR_NAMES: - val = prop_names_t(1, ""); //vector of 1 empty string + val = std::vector(); //empty return; case SUBDEV_PROP_CONNECTION: diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp index 3f4b5a511..0326c28ce 100644 --- a/host/lib/usrp/dboard_manager.cpp +++ b/host/lib/usrp/dboard_manager.cpp @@ -483,6 +483,7 @@ void dboard_manager::populate_prop_tree_from_subdev( subtree->create("name").set(subdev[SUBDEV_PROP_NAME].as()); const prop_names_t sensor_names = subdev[SUBDEV_PROP_SENSOR_NAMES].as(); + subtree->create("sensors"); //phony property so this dir exists BOOST_FOREACH(const std::string &name, sensor_names){ subtree->create("sensors/" + name) .publish(boost::bind(&get_sensor, subdev, name)); -- cgit v1.2.3