aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2021-06-04 08:27:50 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-06-10 12:01:53 -0500
commit2a575bf9b5a4942f60e979161764b9e942699e1e (patch)
tree2f0535625c30025559ebd7494a4b9e7122550a73 /host/lib/rfnoc
parente17916220cc955fa219ae37f607626ba88c4afe3 (diff)
downloaduhd-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')
-rw-r--r--host/lib/rfnoc/rf_control/gain_profile.cpp19
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