summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2010-10-19 15:46:27 -0700
committerJosh Blum2010-10-19 15:46:27 -0700
commitf13e1e1a87cf3d8b891e94226be047cff3733bb7 (patch)
tree10b39f0b6acd22a75f37ce4a995e8f4eee7dc76d
parentc6e4a54769e2d5be3cfd28df6697c54c4a4a7e90 (diff)
downloadgnuradio-f13e1e1a87cf3d8b891e94226be047cff3733bb7.tar.gz
gnuradio-f13e1e1a87cf3d8b891e94226be047cff3733bb7.tar.bz2
gnuradio-f13e1e1a87cf3d8b891e94226be047cff3733bb7.zip
uhd: implement set bandwidth for uhd blocks, remove chan=0 default for multi blocks
-rw-r--r--gr-uhd/lib/uhd_multi_usrp_sink.cc4
-rw-r--r--gr-uhd/lib/uhd_multi_usrp_sink.h22
-rw-r--r--gr-uhd/lib/uhd_multi_usrp_source.cc4
-rw-r--r--gr-uhd/lib/uhd_multi_usrp_source.h22
-rw-r--r--gr-uhd/lib/uhd_single_usrp_sink.cc4
-rw-r--r--gr-uhd/lib/uhd_single_usrp_sink.h6
-rw-r--r--gr-uhd/lib/uhd_single_usrp_source.cc4
-rw-r--r--gr-uhd/lib/uhd_single_usrp_source.h6
8 files changed, 56 insertions, 16 deletions
diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.cc b/gr-uhd/lib/uhd_multi_usrp_sink.cc
index 17cd1ad78..b75a8303c 100644
--- a/gr-uhd/lib/uhd_multi_usrp_sink.cc
+++ b/gr-uhd/lib/uhd_multi_usrp_sink.cc
@@ -95,6 +95,10 @@ public:
return _dev->get_tx_antennas(chan);
}
+ void set_bandwidth(double bandwidth, size_t chan){
+ return _dev->set_tx_bandwidth(bandwidth, chan);
+ }
+
void set_clock_config(const uhd::clock_config_t &clock_config, size_t mboard){
return _dev->set_clock_config(clock_config, mboard);
}
diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.h b/gr-uhd/lib/uhd_multi_usrp_sink.h
index 5dacc1fac..0ccc0fe6c 100644
--- a/gr-uhd/lib/uhd_multi_usrp_sink.h
+++ b/gr-uhd/lib/uhd_multi_usrp_sink.h
@@ -66,49 +66,55 @@ public:
* \param freq the desired frequency in Hz
* \return a tune result with the actual frequencies
*/
- virtual uhd::tune_result_t set_center_freq(double freq, size_t chan = 0) = 0;
+ virtual uhd::tune_result_t set_center_freq(double freq, size_t chan) = 0;
/*!
* Get the tunable frequency range.
* \return the frequency range in Hz
*/
- virtual uhd::freq_range_t get_freq_range(size_t chan = 0) = 0;
+ virtual uhd::freq_range_t get_freq_range(size_t chan) = 0;
/*!
* Set the gain for the dboard.
* \param gain the gain in dB
*/
- virtual void set_gain(float gain, size_t chan = 0) = 0;
+ virtual void set_gain(float gain, size_t chan) = 0;
/*!
* Get the actual dboard gain setting.
* \return the actual gain in dB
*/
- virtual float get_gain(size_t chan = 0) = 0;
+ virtual float get_gain(size_t chan) = 0;
/*!
* Get the settable gain range.
* \return the gain range in dB
*/
- virtual uhd::gain_range_t get_gain_range(size_t chan = 0) = 0;
+ virtual uhd::gain_range_t get_gain_range(size_t chan) = 0;
/*!
* Set the antenna to use.
* \param ant the antenna string
*/
- virtual void set_antenna(const std::string &ant, size_t chan = 0) = 0;
+ virtual void set_antenna(const std::string &ant, size_t chan) = 0;
/*!
* Get the antenna in use.
* \return the antenna string
*/
- virtual std::string get_antenna(size_t chan = 0) = 0;
+ virtual std::string get_antenna(size_t chan) = 0;
/*!
* Get a list of possible antennas.
* \return a vector of antenna strings
*/
- virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0;
+ virtual std::vector<std::string> get_antennas(size_t chan) = 0;
+
+ /*!
+ * Set the subdevice bandpass filter.
+ * \param bandwidth the filter bandwidth in Hz
+ */
+ virtual void set_bandwidth(double bandwidth, size_t chan) = 0;
/*!
* Set the clock configuration.
diff --git a/gr-uhd/lib/uhd_multi_usrp_source.cc b/gr-uhd/lib/uhd_multi_usrp_source.cc
index 63dad1a25..226e8b86f 100644
--- a/gr-uhd/lib/uhd_multi_usrp_source.cc
+++ b/gr-uhd/lib/uhd_multi_usrp_source.cc
@@ -96,6 +96,10 @@ public:
return _dev->get_rx_antennas(chan);
}
+ void set_bandwidth(double bandwidth, size_t chan){
+ return _dev->set_rx_bandwidth(bandwidth, chan);
+ }
+
void set_clock_config(const uhd::clock_config_t &clock_config, size_t mboard){
return _dev->set_clock_config(clock_config, mboard);
}
diff --git a/gr-uhd/lib/uhd_multi_usrp_source.h b/gr-uhd/lib/uhd_multi_usrp_source.h
index 36c4b6fdc..483ce098c 100644
--- a/gr-uhd/lib/uhd_multi_usrp_source.h
+++ b/gr-uhd/lib/uhd_multi_usrp_source.h
@@ -66,49 +66,55 @@ public:
* \param freq the desired frequency in Hz
* \return a tune result with the actual frequencies
*/
- virtual uhd::tune_result_t set_center_freq(double freq, size_t chan = 0) = 0;
+ virtual uhd::tune_result_t set_center_freq(double freq, size_t chan) = 0;
/*!
* Get the tunable frequency range.
* \return the frequency range in Hz
*/
- virtual uhd::freq_range_t get_freq_range(size_t chan = 0) = 0;
+ virtual uhd::freq_range_t get_freq_range(size_t chan) = 0;
/*!
* Set the gain for the dboard.
* \param gain the gain in dB
*/
- virtual void set_gain(float gain, size_t chan = 0) = 0;
+ virtual void set_gain(float gain, size_t chan) = 0;
/*!
* Get the actual dboard gain setting.
* \return the actual gain in dB
*/
- virtual float get_gain(size_t chan = 0) = 0;
+ virtual float get_gain(size_t chan) = 0;
/*!
* Get the settable gain range.
* \return the gain range in dB
*/
- virtual uhd::gain_range_t get_gain_range(size_t chan = 0) = 0;
+ virtual uhd::gain_range_t get_gain_range(size_t chan) = 0;
/*!
* Set the antenna to use.
* \param ant the antenna string
*/
- virtual void set_antenna(const std::string &ant, size_t chan = 0) = 0;
+ virtual void set_antenna(const std::string &ant, size_t chan) = 0;
/*!
* Get the antenna in use.
* \return the antenna string
*/
- virtual std::string get_antenna(size_t chan = 0) = 0;
+ virtual std::string get_antenna(size_t chan) = 0;
/*!
* Get a list of possible antennas.
* \return a vector of antenna strings
*/
- virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0;
+ virtual std::vector<std::string> get_antennas(size_t chan) = 0;
+
+ /*!
+ * Set the subdevice bandpass filter.
+ * \param bandwidth the filter bandwidth in Hz
+ */
+ virtual void set_bandwidth(double bandwidth, size_t chan) = 0;
/*!
* Set the clock configuration.
diff --git a/gr-uhd/lib/uhd_single_usrp_sink.cc b/gr-uhd/lib/uhd_single_usrp_sink.cc
index 4297a83ff..24981a59a 100644
--- a/gr-uhd/lib/uhd_single_usrp_sink.cc
+++ b/gr-uhd/lib/uhd_single_usrp_sink.cc
@@ -95,6 +95,10 @@ public:
return _dev->get_tx_antennas(chan);
}
+ void set_bandwidth(double bandwidth, size_t chan){
+ return _dev->set_tx_bandwidth(bandwidth, chan);
+ }
+
void set_clock_config(const uhd::clock_config_t &clock_config){
return _dev->set_clock_config(clock_config);
}
diff --git a/gr-uhd/lib/uhd_single_usrp_sink.h b/gr-uhd/lib/uhd_single_usrp_sink.h
index e83bb6ded..0987685f4 100644
--- a/gr-uhd/lib/uhd_single_usrp_sink.h
+++ b/gr-uhd/lib/uhd_single_usrp_sink.h
@@ -111,6 +111,12 @@ public:
virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0;
/*!
+ * Set the subdevice bandpass filter.
+ * \param bandwidth the filter bandwidth in Hz
+ */
+ virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0;
+
+ /*!
* Set the clock configuration.
* \param clock_config the new configuration
*/
diff --git a/gr-uhd/lib/uhd_single_usrp_source.cc b/gr-uhd/lib/uhd_single_usrp_source.cc
index 27a788d96..f7c7fc839 100644
--- a/gr-uhd/lib/uhd_single_usrp_source.cc
+++ b/gr-uhd/lib/uhd_single_usrp_source.cc
@@ -96,6 +96,10 @@ public:
return _dev->get_rx_antennas(chan);
}
+ void set_bandwidth(double bandwidth, size_t chan){
+ return _dev->set_rx_bandwidth(bandwidth, chan);
+ }
+
void set_clock_config(const uhd::clock_config_t &clock_config){
return _dev->set_clock_config(clock_config);
}
diff --git a/gr-uhd/lib/uhd_single_usrp_source.h b/gr-uhd/lib/uhd_single_usrp_source.h
index c323fbd7e..1b71d2ad5 100644
--- a/gr-uhd/lib/uhd_single_usrp_source.h
+++ b/gr-uhd/lib/uhd_single_usrp_source.h
@@ -111,6 +111,12 @@ public:
virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0;
/*!
+ * Set the subdevice bandpass filter.
+ * \param bandwidth the filter bandwidth in Hz
+ */
+ virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0;
+
+ /*!
* Set the clock configuration.
* \param clock_config the new configuration
*/