diff options
| author | Lars Amsel <lars.amsel@ni.com> | 2021-06-04 08:27:50 +0200 | 
|---|---|---|
| committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-06-10 12:01:53 -0500 | 
| commit | 2a575bf9b5a4942f60e979161764b9e942699e1e (patch) | |
| tree | 2f0535625c30025559ebd7494a4b9e7122550a73 /host/lib/rfnoc/rf_control/gain_profile.cpp | |
| parent | e17916220cc955fa219ae37f607626ba88c4afe3 (diff) | |
| download | uhd-2a575bf9b5a4942f60e979161764b9e942699e1e.tar.gz uhd-2a575bf9b5a4942f60e979161764b9e942699e1e.tar.bz2 uhd-2a575bf9b5a4942f60e979161764b9e942699e1e.zip  | |
uhd: Add support for the USRP X410
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
Diffstat (limited to 'host/lib/rfnoc/rf_control/gain_profile.cpp')
| -rw-r--r-- | host/lib/rfnoc/rf_control/gain_profile.cpp | 19 | 
1 files changed, 18 insertions, 1 deletions
diff --git a/host/lib/rfnoc/rf_control/gain_profile.cpp b/host/lib/rfnoc/rf_control/gain_profile.cpp index 54ccb9006..9d415cb45 100644 --- a/host/lib/rfnoc/rf_control/gain_profile.cpp +++ b/host/lib/rfnoc/rf_control/gain_profile.cpp @@ -21,13 +21,16 @@ std::vector<std::string> default_gain_profile::get_gain_profile_names(const size      return {DEFAULT_GAIN_PROFILE};  } -void default_gain_profile::set_gain_profile(const std::string& profile, const size_t) +void default_gain_profile::set_gain_profile(const std::string& profile, const size_t chan)  {      if (profile != DEFAULT_GAIN_PROFILE) {          throw uhd::value_error(              std::string("set_tx_gain_profile(): Unknown gain profile: `") + profile              + "'");      } +    if (_sub) { +        _sub(profile, chan); +    }  }  std::string default_gain_profile::get_gain_profile(const size_t) const @@ -35,6 +38,12 @@ std::string default_gain_profile::get_gain_profile(const size_t) const      return DEFAULT_GAIN_PROFILE;  } + +void default_gain_profile::add_subscriber(subscriber_type&& sub) +{ +    _sub = std::move(sub); +} +  enumerated_gain_profile::enumerated_gain_profile(      const std::vector<std::string>& possible_profiles,      const std::string& default_profile, @@ -52,6 +61,9 @@ void enumerated_gain_profile::set_gain_profile(          throw uhd::key_error(err_msg);      }      _gain_profile.at(chan) = profile; +    if (_sub) { +        _sub(profile, chan); +    }  }  std::string enumerated_gain_profile::get_gain_profile(const size_t chan) const @@ -65,4 +77,9 @@ std::vector<std::string> enumerated_gain_profile::get_gain_profile_names(      return _possible_profiles;  } +void enumerated_gain_profile::add_subscriber(subscriber_type&& sub) +{ +    _sub = std::move(sub); +} +  }}} // namespace uhd::rfnoc::rf_control  | 
