diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-10-12 11:13:07 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:04:02 -0800 |
commit | 35dc86aaa5c880641b80f494f044f21963207dbc (patch) | |
tree | c8659be2d81421db5eaacd15719b407d9409f0b0 /host | |
parent | c6f228452db79982cc08a9f0af1322b8585fc90e (diff) | |
download | uhd-35dc86aaa5c880641b80f494f044f21963207dbc.tar.gz uhd-35dc86aaa5c880641b80f494f044f21963207dbc.tar.bz2 uhd-35dc86aaa5c880641b80f494f044f21963207dbc.zip |
mg: Add dboard EEPROM properties
Signed-off-by: Martin Braun <martin.braun@ettus.com>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
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 <uhd/transport/chdr.hpp> #include <uhd/utils/math.hpp> #include <uhd/types/direction.hpp> +#include <uhd/types/eeprom.hpp> #include <boost/algorithm/string.hpp> #include <boost/make_shared.hpp> #include <boost/format.hpp> @@ -232,6 +233,9 @@ UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(magnesium_radio_ctrl) } } + // EEPROM paths subject to change FIXME + _tree->create<eeprom_map_t>(_root_path / "eeprom").set(eeprom_map_t()); + // TODO change codec names _tree->create<int>("rx_codecs" / _radio_slot / "gains"); _tree->create<int>("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<eeprom_map_t>(_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<eeprom_map_t>( + "get_db_eeprom", db_idx + ); + }) + ; } double magnesium_radio_ctrl_impl::_set_frequency(const double freq, const size_t chan, const direction_t dir) |