diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-08-06 20:55:35 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-17 16:22:35 -0500 |
commit | b9f9ca2d0fd43f2a55e4ed5301070585cbb1be3c (patch) | |
tree | 9f5d41f396b5721b153b659f115fc1ebf71096e9 /host/lib/rfnoc | |
parent | 34729381733f22b36d34d8d451b80de5b0e83203 (diff) | |
download | uhd-b9f9ca2d0fd43f2a55e4ed5301070585cbb1be3c.tar.gz uhd-b9f9ca2d0fd43f2a55e4ed5301070585cbb1be3c.tar.bz2 uhd-b9f9ca2d0fd43f2a55e4ed5301070585cbb1be3c.zip |
uhd: Add APIs for getting the available power range
The previously added APIs for getting/setting power reference levels was
missing an option to read back the currently available power levels
(minimum and maximum power levels).
This adds getters for TX and RX power ranges to multi_usrp and
radio_control. The power API is thus now more similar to the gain API,
which always had getters for gain ranges.
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/radio_control_impl.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp index 23a885a83..61937e080 100644 --- a/host/lib/rfnoc/radio_control_impl.cpp +++ b/host/lib/rfnoc/radio_control_impl.cpp @@ -636,6 +636,24 @@ std::vector<std::string> radio_control_impl::get_tx_power_ref_keys(const size_t return {_tx_pwr_mgr.at(chan)->get_key(), _tx_pwr_mgr.at(chan)->get_serial()}; } +uhd::meta_range_t radio_control_impl::get_rx_power_range(const size_t chan) +{ + if (_rx_pwr_mgr.empty()) { + throw uhd::not_implemented_error( + "get_rx_power_range() is not supported on this radio!"); + } + return _rx_pwr_mgr.at(chan)->get_power_range(); +} + +uhd::meta_range_t radio_control_impl::get_tx_power_range(const size_t chan) +{ + if (_tx_pwr_mgr.empty()) { + throw uhd::not_implemented_error( + "get_tx_power_range() is not supported on this radio!"); + } + return _tx_pwr_mgr.at(chan)->get_power_range(); +} + /****************************************************************************** * LO Default API |