diff options
Diffstat (limited to 'host/lib/usrp/e300')
-rw-r--r-- | host/lib/usrp/e300/e300_impl.cpp | 1 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_network.cpp | 3 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_remote_codec_ctrl.cpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_remote_codec_ctrl.hpp | 2 |
4 files changed, 19 insertions, 1 deletions
diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp index c7c007a20..231816fe8 100644 --- a/host/lib/usrp/e300/e300_impl.cpp +++ b/host/lib/usrp/e300/e300_impl.cpp @@ -1068,6 +1068,7 @@ void e300_impl::_setup_radio(const size_t dspno) _tree->create<meta_range_t>(rf_fe_path / "bandwidth" / "range") .publish(boost::bind(&ad9361_ctrl::get_bw_filter_range, key)); _tree->create<double>(rf_fe_path / "freq" / "value") + .publish(boost::bind(&ad9361_ctrl::get_freq, _codec_ctrl, key)) .coerce(boost::bind(&ad9361_ctrl::tune, _codec_ctrl, key, _1)) .subscribe(boost::bind(&e300_impl::_update_fe_lo_freq, this, key, _1)) .set(e300::DEFAULT_FE_FREQ); diff --git a/host/lib/usrp/e300/e300_network.cpp b/host/lib/usrp/e300/e300_network.cpp index 2a63abc25..d68dc4541 100644 --- a/host/lib/usrp/e300/e300_network.cpp +++ b/host/lib/usrp/e300/e300_network.cpp @@ -220,6 +220,9 @@ static void e300_codec_ctrl_tunnel( case codec_xact_t::ACTION_TUNE: out->freq = _codec_ctrl->tune(which_str, in->freq); break; + case codec_xact_t::ACTION_GET_FREQ: + out->freq = _codec_ctrl->get_freq(which_str); + break; case codec_xact_t::ACTION_SET_LOOPBACK: _codec_ctrl->data_port_loopback( uhd::ntohx<boost::uint32_t>(in->bits) & 1); diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp index d3efdb812..9708634dd 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp @@ -96,6 +96,20 @@ public: return _retval.freq; } + double get_freq(const std::string &which) + { + _clear(); + _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_GET_FREQ); + if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); + + _transact(); + return _retval.freq; + } + void data_port_loopback(const bool on) { _clear(); diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp index 065c5e7a0..43723e0d5 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp @@ -56,7 +56,7 @@ public: static const boost::uint32_t ACTION_SET_AGC = 19; static const boost::uint32_t ACTION_SET_AGC_MODE = 20; static const boost::uint32_t ACTION_SET_BW = 21; - + static const boost::uint32_t ACTION_GET_FREQ = 22; //Values for "which" static const boost::uint32_t CHAIN_NONE = 0; |