From b4abe9b90e5619f272468bb34a8b08c36bba19da Mon Sep 17 00:00:00 2001 From: michael-west Date: Fri, 30 Mar 2018 16:04:02 -0700 Subject: UBX: Change antenna functions to coercers on antenna/value properties --- host/lib/usrp/dboard/db_ubx.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp index 7b153d170..0e85cf188 100644 --- a/host/lib/usrp/dboard/db_ubx.cpp +++ b/host/lib/usrp/dboard/db_ubx.cpp @@ -474,7 +474,7 @@ public: get_tx_subtree()->create >("antenna/options") .set(ubx_tx_antennas); get_tx_subtree()->create("antenna/value") - .add_coerced_subscriber(boost::bind(&ubx_xcvr::set_tx_ant, this, _1)) + .set_coercer(boost::bind(&ubx_xcvr::set_tx_ant, this, _1)) .set(ubx_tx_antennas.at(0)); get_tx_subtree()->create("connection") .set("QI"); @@ -511,7 +511,7 @@ public: get_rx_subtree()->create >("antenna/options") .set(ubx_rx_antennas); get_rx_subtree()->create("antenna/value") - .add_coerced_subscriber(boost::bind(&ubx_xcvr::set_rx_ant, this, _1)).set("RX2"); + .set_coercer(boost::bind(&ubx_xcvr::set_rx_ant, this, _1)).set("RX2"); get_rx_subtree()->create("connection") .set("IQ"); get_rx_subtree()->create("enabled") @@ -735,16 +735,17 @@ private: return sensor_value_t("Unknown", false, "locked", "unlocked"); } - void set_tx_ant(const std::string &ant) + std::string set_tx_ant(const std::string &ant) { //validate input assert_has(ubx_tx_antennas, ant, "ubx tx antenna name"); set_cpld_field(CAL_ENABLE, (ant == "CAL")); write_cpld_reg(); + return ant; } // Set RX antennas - void set_rx_ant(const std::string &ant) + std::string set_rx_ant(const std::string &ant) { boost::mutex::scoped_lock lock(_mutex); //validate input @@ -767,6 +768,8 @@ private: } write_gpio(); write_cpld_reg(); + + return ant; } /*********************************************************************** -- cgit v1.2.3