From 35dc86aaa5c880641b80f494f044f21963207dbc Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 12 Oct 2017 11:13:07 -0700 Subject: mg: Add dboard EEPROM properties Signed-off-by: Martin Braun --- .../dboard/magnesium/magnesium_radio_ctrl_impl.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp index 7b6b83339..b78177023 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -232,6 +233,9 @@ UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(magnesium_radio_ctrl) } } + // EEPROM paths subject to change FIXME + _tree->create(_root_path / "eeprom").set(eeprom_map_t()); + // TODO change codec names _tree->create("rx_codecs" / _radio_slot / "gains"); _tree->create("tx_codecs" / _radio_slot / "gains"); @@ -350,10 +354,22 @@ double magnesium_radio_ctrl_impl::get_output_samp_rate(size_t port) void magnesium_radio_ctrl_impl::set_rpc_client( uhd::rpc_client::sptr rpcc, const uhd::device_addr_t &block_args -) -{ +) { _rpcc = rpcc; _block_args = block_args; + + // EEPROM paths subject to change FIXME + const size_t db_idx = get_block_id().get_block_count(); + _tree->access(_root_path / "eeprom") + .add_coerced_subscriber([this, db_idx](const eeprom_map_t& db_eeprom){ + this->_rpcc->notify_with_token("set_db_eeprom", db_idx, db_eeprom); + }) + .set_publisher([this, db_idx](){ + return this->_rpcc->request_with_token( + "get_db_eeprom", db_idx + ); + }) + ; } double magnesium_radio_ctrl_impl::_set_frequency(const double freq, const size_t chan, const direction_t dir) -- cgit v1.2.3