From bc85ad9df0670e534fa73440c26609573ce1bc8f Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 15 Nov 2017 22:27:56 -0800 Subject: mg: Add stubs for lo_locked sensor --- .../dboard/magnesium/magnesium_radio_ctrl_init.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp index 5bbcacdf0..c35a15418 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp @@ -9,6 +9,7 @@ #include "spi_core_3000.hpp" #include #include +#include #include #include @@ -330,12 +331,27 @@ void magnesium_radio_ctrl_impl::_init_frontend_subtree( }) ; // FIXME separate DSA and Myk gains + // TX LO lock sensor + // Note: The lowband and AD9371 LO lock sensors are generated + // programmatically in set_rpc_client(). The actual lo_locked publisher is + // also set there. + subtree->create(tx_fe_path / "sensors" / "lo_locked") + .set(sensor_value_t("all_los", false, "locked", "unlocked")) + .add_coerced_subscriber([](const sensor_value_t &){ + throw uhd::runtime_error( + "Attempting to write to sensor!"); + }) + ; + // RX LO lock sensor (see not on TX LO lock sensor) + subtree->create(rx_fe_path / "sensors" / "lo_locked") + .set(sensor_value_t("all_los", false, "locked", "unlocked")) + ; } void magnesium_radio_ctrl_impl::_init_prop_tree() { const fs_path fe_base = fs_path("dboards") / _radio_slot; - this->_init_frontend_subtree(_tree->subtree(fe_base), 0); + this->_init_frontend_subtree(_tree->subtree(fe_base), 0); // TODO: When we go to one radio per dboard, the above if statement goes // away, and instead we have something like this: /* -- cgit v1.2.3