summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-uhd/include/gr_uhd_usrp_sink.h32
-rw-r--r--gr-uhd/include/gr_uhd_usrp_source.h32
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_sink.cc16
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc16
4 files changed, 96 insertions, 0 deletions
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h
index 0475957de..320d07d41 100644
--- a/gr-uhd/include/gr_uhd_usrp_sink.h
+++ b/gr-uhd/include/gr_uhd_usrp_sink.h
@@ -101,6 +101,14 @@ public:
virtual void set_gain(double gain, size_t chan = 0) = 0;
/*!
+ * Set the named gain on the dboard.
+ * \param gain the gain in dB
+ * \param name the name of the gain stage
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_gain(double gain, const std::string &name, size_t chan = 0) = 0;
+
+ /*!
* Get the actual dboard gain setting.
* \param chan the channel index 0 to N-1
* \return the actual gain in dB
@@ -108,6 +116,22 @@ public:
virtual double get_gain(size_t chan = 0) = 0;
/*!
+ * Get the actual dboard gain setting of named stage.
+ * \param name the name of the gain stage
+ * \param chan the channel index 0 to N-1
+ * \return the actual gain in dB
+ */
+ virtual double get_gain(const std::string &name, size_t chan = 0) = 0;
+
+ /*!
+ * Get the actual dboard gain setting of named stage.
+ * \param name the name of the gain stage
+ * \param chan the channel index 0 to N-1
+ * \return the actual gain in dB
+ */
+ virtual std::vector<std::string> get_gain_names(size_t chan = 0) = 0;
+
+ /*!
* Get the settable gain range.
* \param chan the channel index 0 to N-1
* \return the gain range in dB
@@ -115,6 +139,14 @@ public:
virtual uhd::gain_range_t get_gain_range(size_t chan = 0) = 0;
/*!
+ * Get the settable gain range.
+ * \param name the name of the gain stage
+ * \param chan the channel index 0 to N-1
+ * \return the gain range in dB
+ */
+ virtual uhd::gain_range_t get_gain_range(const std::string &name, size_t chan = 0) = 0;
+
+ /*!
* Set the antenna to use.
* \param ant the antenna string
* \param chan the channel index 0 to N-1
diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h
index 038f9a91e..36331f782 100644
--- a/gr-uhd/include/gr_uhd_usrp_source.h
+++ b/gr-uhd/include/gr_uhd_usrp_source.h
@@ -101,6 +101,14 @@ public:
virtual void set_gain(double gain, size_t chan = 0) = 0;
/*!
+ * Set the named gain on the dboard.
+ * \param gain the gain in dB
+ * \param name the name of the gain stage
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_gain(double gain, const std::string &name, size_t chan = 0) = 0;
+
+ /*!
* Get the actual dboard gain setting.
* \param chan the channel index 0 to N-1
* \return the actual gain in dB
@@ -108,6 +116,22 @@ public:
virtual double get_gain(size_t chan = 0) = 0;
/*!
+ * Get the actual dboard gain setting of named stage.
+ * \param name the name of the gain stage
+ * \param chan the channel index 0 to N-1
+ * \return the actual gain in dB
+ */
+ virtual double get_gain(const std::string &name, size_t chan = 0) = 0;
+
+ /*!
+ * Get the actual dboard gain setting of named stage.
+ * \param name the name of the gain stage
+ * \param chan the channel index 0 to N-1
+ * \return the actual gain in dB
+ */
+ virtual std::vector<std::string> get_gain_names(size_t chan = 0) = 0;
+
+ /*!
* Get the settable gain range.
* \param chan the channel index 0 to N-1
* \return the gain range in dB
@@ -115,6 +139,14 @@ public:
virtual uhd::gain_range_t get_gain_range(size_t chan = 0) = 0;
/*!
+ * Get the settable gain range.
+ * \param name the name of the gain stage
+ * \param chan the channel index 0 to N-1
+ * \return the gain range in dB
+ */
+ virtual uhd::gain_range_t get_gain_range(const std::string &name, size_t chan = 0) = 0;
+
+ /*!
* Set the antenna to use.
* \param ant the antenna string
* \param chan the channel index 0 to N-1
diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc
index d44af25ab..ce9d89d8d 100644
--- a/gr-uhd/lib/gr_uhd_usrp_sink.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc
@@ -76,14 +76,30 @@ public:
return _dev->set_tx_gain(gain, chan);
}
+ void set_gain(double gain, const std::string &name, size_t chan){
+ return _dev->set_tx_gain(gain, name, chan);
+ }
+
double get_gain(size_t chan){
return _dev->get_tx_gain(chan);
}
+ double get_gain(const std::string &name, size_t chan){
+ return _dev->get_tx_gain(name, chan);
+ }
+
+ std::vector<std::string> get_gain_names(size_t chan){
+ return _dev->get_tx_gain_names(chan);
+ }
+
uhd::gain_range_t get_gain_range(size_t chan){
return _dev->get_tx_gain_range(chan);
}
+ uhd::gain_range_t get_gain_range(const std::string &name, size_t chan){
+ return _dev->get_tx_gain_range(name, chan);
+ }
+
void set_antenna(const std::string &ant, size_t chan){
return _dev->set_tx_antenna(ant, chan);
}
diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc
index fed8e6624..9983489c3 100644
--- a/gr-uhd/lib/gr_uhd_usrp_source.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_source.cc
@@ -78,14 +78,30 @@ public:
return _dev->set_rx_gain(gain, chan);
}
+ void set_gain(double gain, const std::string &name, size_t chan){
+ return _dev->set_rx_gain(gain, name, chan);
+ }
+
double get_gain(size_t chan){
return _dev->get_rx_gain(chan);
}
+ double get_gain(const std::string &name, size_t chan){
+ return _dev->get_rx_gain(name, chan);
+ }
+
+ std::vector<std::string> get_gain_names(size_t chan){
+ return _dev->get_rx_gain_names(chan);
+ }
+
uhd::gain_range_t get_gain_range(size_t chan){
return _dev->get_rx_gain_range(chan);
}
+ uhd::gain_range_t get_gain_range(const std::string &name, size_t chan){
+ return _dev->get_rx_gain_range(name, chan);
+ }
+
void set_antenna(const std::string &ant, size_t chan){
return _dev->set_rx_antenna(ant, chan);
}