diff options
author | michael-west <michael.west@ettus.com> | 2015-05-19 11:34:57 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-05-22 11:33:55 -0700 |
commit | 6113b921e4cce8fdb57575eb9418b84322d87c3c (patch) | |
tree | a737fabba7291d04b1ebbb4e85e40c013cc87149 /host | |
parent | da7302cacbcdad59df01a7d7789db3c6fa9c6b24 (diff) | |
download | uhd-6113b921e4cce8fdb57575eb9418b84322d87c3c.tar.gz uhd-6113b921e4cce8fdb57575eb9418b84322d87c3c.tar.bz2 uhd-6113b921e4cce8fdb57575eb9418b84322d87c3c.zip |
E300: Implement get_freq() for E300 network mode.
Diffstat (limited to 'host')
-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 | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/host/lib/usrp/e300/e300_network.cpp b/host/lib/usrp/e300/e300_network.cpp index bb904773b..408f9e62d 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 d3942d587..6742f5f86 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 cbc4b52d2..e21f2ef95 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.hpp @@ -44,6 +44,7 @@ public: static const boost::uint32_t ACTION_TUNE = 13; static const boost::uint32_t ACTION_SET_LOOPBACK = 14; static const boost::uint32_t ACTION_GET_RSSI = 15; + static const boost::uint32_t ACTION_GET_FREQ = 16; //Values for "which" static const boost::uint32_t CHAIN_NONE = 0; |