diff options
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;  | 
