diff options
author | Martin Braun <martin@gnuradio.org> | 2020-04-27 21:53:51 -0700 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2020-08-26 00:11:42 -0700 |
commit | 028b2167d7c1a6e7c4eb428b1c6cdd5225add264 (patch) | |
tree | c947b74c386ae1c53766f49478a90ea84cf21409 /gr-uhd/lib/usrp_source_impl.h | |
parent | f871040e8129ccf7b0392aee3744d9867ffa0a1a (diff) |
uhd: Add power reference APIs
UHD 4.0 is introducing a power reference level API, which will now
become available in GNU Radio. Its availability is conditionally
compiled into GNU Radio based on whether or not the feature is available
in the UHD version GNU Radio was compiled against.
USRP source and sink blocks receive the following new APIs:
- has_power_reference()
- set_power_reference()
- get_power_reference()
The command interface now understands a new `power_dbm` dictionary key.
The GRC bindings can now switch between absolute gain, normalized gain,
and absolute power settings.
If GNU Radio was compiled against an older version of UHD (prior to UHD
4.0) which doesn't have this API, an error or warning is printed, the
has_power_reference() will return false, and the others will throw an
exception.
Diffstat (limited to 'gr-uhd/lib/usrp_source_impl.h')
-rw-r--r-- | gr-uhd/lib/usrp_source_impl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gr-uhd/lib/usrp_source_impl.h b/gr-uhd/lib/usrp_source_impl.h index 371e7295a7..a5235b50b9 100644 --- a/gr-uhd/lib/usrp_source_impl.h +++ b/gr-uhd/lib/usrp_source_impl.h @@ -51,6 +51,9 @@ public: std::vector<std::string> get_gain_names(size_t chan); ::uhd::gain_range_t get_gain_range(size_t chan); ::uhd::gain_range_t get_gain_range(const std::string& name, size_t chan); + bool has_power_reference(size_t chan); + double get_power_reference(size_t chan); + ::uhd::meta_range_t get_power_range(size_t chan); std::string get_antenna(size_t chan); std::vector<std::string> get_antennas(size_t chan); ::uhd::sensor_value_t get_sensor(const std::string& name, size_t chan); @@ -72,6 +75,7 @@ public: void set_gain(double gain, const std::string& name, size_t chan); void set_rx_agc(const bool enable, size_t chan); void set_normalized_gain(double gain, size_t chan); + void set_power_reference(double power_dbm, size_t chan); void set_antenna(const std::string& ant, size_t chan); void set_bandwidth(double bandwidth, size_t chan); double get_bandwidth(size_t chan); |