From 7f46efca9cb0c87e9130c117ac41650f6e0c25cc Mon Sep 17 00:00:00 2001 From: Josh Blum <josh@joshknows.com> Date: Mon, 18 Oct 2010 16:49:08 -0700 Subject: uhd: renamed make function params, cleanup, clock config for multi usrp --- gr-uhd/lib/uhd_single_usrp_source.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gr-uhd/lib/uhd_single_usrp_source.h') diff --git a/gr-uhd/lib/uhd_single_usrp_source.h b/gr-uhd/lib/uhd_single_usrp_source.h index 196b7c6759..c323fbd7ed 100644 --- a/gr-uhd/lib/uhd_single_usrp_source.h +++ b/gr-uhd/lib/uhd_single_usrp_source.h @@ -28,8 +28,8 @@ class uhd_single_usrp_source; boost::shared_ptr<uhd_single_usrp_source> uhd_make_single_usrp_source( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels = 1 ); -- cgit v1.2.3 From f13e1e1a87cf3d8b891e94226be047cff3733bb7 Mon Sep 17 00:00:00 2001 From: Josh Blum <josh@joshknows.com> Date: Tue, 19 Oct 2010 15:46:27 -0700 Subject: uhd: implement set bandwidth for uhd blocks, remove chan=0 default for multi blocks --- gr-uhd/lib/uhd_multi_usrp_sink.cc | 4 ++++ gr-uhd/lib/uhd_multi_usrp_sink.h | 22 ++++++++++++++-------- gr-uhd/lib/uhd_multi_usrp_source.cc | 4 ++++ gr-uhd/lib/uhd_multi_usrp_source.h | 22 ++++++++++++++-------- gr-uhd/lib/uhd_single_usrp_sink.cc | 4 ++++ gr-uhd/lib/uhd_single_usrp_sink.h | 6 ++++++ gr-uhd/lib/uhd_single_usrp_source.cc | 4 ++++ gr-uhd/lib/uhd_single_usrp_source.h | 6 ++++++ 8 files changed, 56 insertions(+), 16 deletions(-) (limited to 'gr-uhd/lib/uhd_single_usrp_source.h') diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.cc b/gr-uhd/lib/uhd_multi_usrp_sink.cc index 17cd1ad78e..b75a8303cb 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 5dacc1fac7..0ccc0fe6c5 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 63dad1a25e..226e8b86fb 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 36c4b6fdcc..483ce098cf 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 4297a83ffa..24981a59af 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 e83bb6ded8..0987685f47 100644 --- a/gr-uhd/lib/uhd_single_usrp_sink.h +++ b/gr-uhd/lib/uhd_single_usrp_sink.h @@ -110,6 +110,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 27a788d960..f7c7fc8396 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 c323fbd7ed..1b71d2ad54 100644 --- a/gr-uhd/lib/uhd_single_usrp_source.h +++ b/gr-uhd/lib/uhd_single_usrp_source.h @@ -110,6 +110,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 -- cgit v1.2.3 From 13970fed3ae4114689d08bf01cee8b8706d316a5 Mon Sep 17 00:00:00 2001 From: Josh Blum <josh@joshknows.com> Date: Wed, 20 Oct 2010 12:24:04 -0700 Subject: uhd: added channel param to docstrings --- gr-uhd/lib/uhd_multi_usrp_sink.h | 11 +++++++++++ gr-uhd/lib/uhd_multi_usrp_source.h | 11 +++++++++++ gr-uhd/lib/uhd_single_usrp_sink.h | 9 +++++++++ gr-uhd/lib/uhd_single_usrp_source.h | 9 +++++++++ 4 files changed, 40 insertions(+) (limited to 'gr-uhd/lib/uhd_single_usrp_source.h') diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.h b/gr-uhd/lib/uhd_multi_usrp_sink.h index 0ccc0fe6c5..a94e7bd5ae 100644 --- a/gr-uhd/lib/uhd_multi_usrp_sink.h +++ b/gr-uhd/lib/uhd_multi_usrp_sink.h @@ -45,6 +45,7 @@ public: /*! * Set the subdevice specification. * \param spec the subdev spec markup string + * \param mboard the motherboard index 0 to M-1 */ virtual void set_subdev_spec(const std::string &spec, size_t mboard) = 0; @@ -64,12 +65,14 @@ public: /*! * Tune the usrp device to the desired center frequency. * \param freq the desired frequency in Hz + * \param chan the channel index 0 to N-1 * \return a tune result with the actual frequencies */ virtual uhd::tune_result_t set_center_freq(double freq, size_t chan) = 0; /*! * Get the tunable frequency range. + * \param chan the channel index 0 to N-1 * \return the frequency range in Hz */ virtual uhd::freq_range_t get_freq_range(size_t chan) = 0; @@ -77,17 +80,20 @@ public: /*! * Set the gain for the dboard. * \param gain the gain in dB + * \param chan the channel index 0 to N-1 */ virtual void set_gain(float gain, size_t chan) = 0; /*! * Get the actual dboard gain setting. + * \param chan the channel index 0 to N-1 * \return the actual gain in dB */ virtual float get_gain(size_t chan) = 0; /*! * Get the settable gain range. + * \param chan the channel index 0 to N-1 * \return the gain range in dB */ virtual uhd::gain_range_t get_gain_range(size_t chan) = 0; @@ -95,23 +101,27 @@ public: /*! * Set the antenna to use. * \param ant the antenna string + * \param chan the channel index 0 to N-1 */ virtual void set_antenna(const std::string &ant, size_t chan) = 0; /*! * Get the antenna in use. + * \param chan the channel index 0 to N-1 * \return the antenna string */ virtual std::string get_antenna(size_t chan) = 0; /*! * Get a list of possible antennas. + * \param chan the channel index 0 to N-1 * \return a vector of antenna strings */ virtual std::vector<std::string> get_antennas(size_t chan) = 0; /*! * Set the subdevice bandpass filter. + * \param chan the channel index 0 to N-1 * \param bandwidth the filter bandwidth in Hz */ virtual void set_bandwidth(double bandwidth, size_t chan) = 0; @@ -119,6 +129,7 @@ public: /*! * Set the clock configuration. * \param clock_config the new configuration + * \param mboard the motherboard index 0 to M-1 */ virtual void set_clock_config(const uhd::clock_config_t &clock_config, size_t mboard) = 0; diff --git a/gr-uhd/lib/uhd_multi_usrp_source.h b/gr-uhd/lib/uhd_multi_usrp_source.h index 483ce098cf..081c82ee64 100644 --- a/gr-uhd/lib/uhd_multi_usrp_source.h +++ b/gr-uhd/lib/uhd_multi_usrp_source.h @@ -45,6 +45,7 @@ public: /*! * Set the subdevice specification. * \param spec the subdev spec markup string + * \param mboard the motherboard index 0 to M-1 */ virtual void set_subdev_spec(const std::string &spec, size_t mboard) = 0; @@ -64,12 +65,14 @@ public: /*! * Tune the usrp device to the desired center frequency. * \param freq the desired frequency in Hz + * \param chan the channel index 0 to N-1 * \return a tune result with the actual frequencies */ virtual uhd::tune_result_t set_center_freq(double freq, size_t chan) = 0; /*! * Get the tunable frequency range. + * \param chan the channel index 0 to N-1 * \return the frequency range in Hz */ virtual uhd::freq_range_t get_freq_range(size_t chan) = 0; @@ -77,17 +80,20 @@ public: /*! * Set the gain for the dboard. * \param gain the gain in dB + * \param chan the channel index 0 to N-1 */ virtual void set_gain(float gain, size_t chan) = 0; /*! * Get the actual dboard gain setting. + * \param chan the channel index 0 to N-1 * \return the actual gain in dB */ virtual float get_gain(size_t chan) = 0; /*! * Get the settable gain range. + * \param chan the channel index 0 to N-1 * \return the gain range in dB */ virtual uhd::gain_range_t get_gain_range(size_t chan) = 0; @@ -95,17 +101,20 @@ public: /*! * Set the antenna to use. * \param ant the antenna string + * \param chan the channel index 0 to N-1 */ virtual void set_antenna(const std::string &ant, size_t chan) = 0; /*! * Get the antenna in use. + * \param chan the channel index 0 to N-1 * \return the antenna string */ virtual std::string get_antenna(size_t chan) = 0; /*! * Get a list of possible antennas. + * \param chan the channel index 0 to N-1 * \return a vector of antenna strings */ virtual std::vector<std::string> get_antennas(size_t chan) = 0; @@ -113,12 +122,14 @@ public: /*! * Set the subdevice bandpass filter. * \param bandwidth the filter bandwidth in Hz + * \param chan the channel index 0 to N-1 */ virtual void set_bandwidth(double bandwidth, size_t chan) = 0; /*! * Set the clock configuration. * \param clock_config the new configuration + * \param mboard the motherboard index 0 to M-1 */ virtual void set_clock_config(const uhd::clock_config_t &clock_config, size_t mboard) = 0; diff --git a/gr-uhd/lib/uhd_single_usrp_sink.h b/gr-uhd/lib/uhd_single_usrp_sink.h index 0987685f47..390667df9c 100644 --- a/gr-uhd/lib/uhd_single_usrp_sink.h +++ b/gr-uhd/lib/uhd_single_usrp_sink.h @@ -64,12 +64,14 @@ public: /*! * Tune the usrp device to the desired center frequency. * \param freq the desired frequency in Hz + * \param chan the channel index 0 to N-1 * \return a tune result with the actual frequencies */ virtual uhd::tune_result_t set_center_freq(double freq, size_t chan = 0) = 0; /*! * Get the tunable frequency range. + * \param chan the channel index 0 to N-1 * \return the frequency range in Hz */ virtual uhd::freq_range_t get_freq_range(size_t chan = 0) = 0; @@ -77,17 +79,20 @@ public: /*! * Set the gain for the dboard. * \param gain the gain in dB + * \param chan the channel index 0 to N-1 */ virtual void set_gain(float gain, 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 */ virtual float get_gain(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 */ virtual uhd::gain_range_t get_gain_range(size_t chan = 0) = 0; @@ -95,17 +100,20 @@ public: /*! * Set the antenna to use. * \param ant the antenna string + * \param chan the channel index 0 to N-1 */ virtual void set_antenna(const std::string &ant, size_t chan = 0) = 0; /*! * Get the antenna in use. + * \param chan the channel index 0 to N-1 * \return the antenna string */ virtual std::string get_antenna(size_t chan = 0) = 0; /*! * Get a list of possible antennas. + * \param chan the channel index 0 to N-1 * \return a vector of antenna strings */ virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0; @@ -113,6 +121,7 @@ public: /*! * Set the subdevice bandpass filter. * \param bandwidth the filter bandwidth in Hz + * \param chan the channel index 0 to N-1 */ virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0; diff --git a/gr-uhd/lib/uhd_single_usrp_source.h b/gr-uhd/lib/uhd_single_usrp_source.h index 1b71d2ad54..415c52e9a5 100644 --- a/gr-uhd/lib/uhd_single_usrp_source.h +++ b/gr-uhd/lib/uhd_single_usrp_source.h @@ -64,12 +64,14 @@ public: /*! * Tune the usrp device to the desired center frequency. * \param freq the desired frequency in Hz + * \param chan the channel index 0 to N-1 * \return a tune result with the actual frequencies */ virtual uhd::tune_result_t set_center_freq(double freq, size_t chan = 0) = 0; /*! * Get the tunable frequency range. + * \param chan the channel index 0 to N-1 * \return the frequency range in Hz */ virtual uhd::freq_range_t get_freq_range(size_t chan = 0) = 0; @@ -77,17 +79,20 @@ public: /*! * Set the gain for the dboard. * \param gain the gain in dB + * \param chan the channel index 0 to N-1 */ virtual void set_gain(float gain, 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 */ virtual float get_gain(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 */ virtual uhd::gain_range_t get_gain_range(size_t chan = 0) = 0; @@ -95,17 +100,20 @@ public: /*! * Set the antenna to use. * \param ant the antenna string + * \param chan the channel index 0 to N-1 */ virtual void set_antenna(const std::string &ant, size_t chan = 0) = 0; /*! * Get the antenna in use. + * \param chan the channel index 0 to N-1 * \return the antenna string */ virtual std::string get_antenna(size_t chan = 0) = 0; /*! * Get a list of possible antennas. + * \param chan the channel index 0 to N-1 * \return a vector of antenna strings */ virtual std::vector<std::string> get_antennas(size_t chan = 0) = 0; @@ -113,6 +121,7 @@ public: /*! * Set the subdevice bandpass filter. * \param bandwidth the filter bandwidth in Hz + * \param chan the channel index 0 to N-1 */ virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0; -- cgit v1.2.3 From 5a2de999da86d48cd7f005d08cc48965cb8c7a65 Mon Sep 17 00:00:00 2001 From: Josh Blum <josh@joshknows.com> Date: Mon, 25 Oct 2010 16:22:05 -0700 Subject: uhd: move tune functions to tune_request and provide wrapper for simple case --- gr-uhd/lib/uhd_multi_usrp_sink.cc | 7 ++++--- gr-uhd/lib/uhd_multi_usrp_sink.h | 16 +++++++++++++++- gr-uhd/lib/uhd_multi_usrp_source.cc | 7 ++++--- gr-uhd/lib/uhd_multi_usrp_source.h | 16 +++++++++++++++- gr-uhd/lib/uhd_single_usrp_sink.cc | 7 ++++--- gr-uhd/lib/uhd_single_usrp_sink.h | 16 +++++++++++++++- gr-uhd/lib/uhd_single_usrp_source.cc | 7 ++++--- gr-uhd/lib/uhd_single_usrp_source.h | 16 +++++++++++++++- gr-uhd/swig/uhd_swig.i | 1 + 9 files changed, 77 insertions(+), 16 deletions(-) (limited to 'gr-uhd/lib/uhd_single_usrp_source.h') diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.cc b/gr-uhd/lib/uhd_multi_usrp_sink.cc index b75a8303cb..ee16e2928d 100644 --- a/gr-uhd/lib/uhd_multi_usrp_sink.cc +++ b/gr-uhd/lib/uhd_multi_usrp_sink.cc @@ -62,9 +62,10 @@ public: return _dev->get_tx_rate(); } - uhd::tune_result_t set_center_freq(double freq, size_t chan){ - uhd::tune_result_t tr = _dev->set_tx_freq(freq, chan); - return tr; + uhd::tune_result_t set_center_freq( + const uhd::tune_request_t tune_request, size_t chan + ){ + return _dev->set_tx_freq(tune_request, chan); } uhd::freq_range_t get_freq_range(size_t chan){ diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.h b/gr-uhd/lib/uhd_multi_usrp_sink.h index a94e7bd5ae..370e59d0e1 100644 --- a/gr-uhd/lib/uhd_multi_usrp_sink.h +++ b/gr-uhd/lib/uhd_multi_usrp_sink.h @@ -64,11 +64,25 @@ public: /*! * Tune the usrp device to the desired center frequency. + * \param tune_request the tune request instructions + * \param chan the channel index 0 to N-1 + * \return a tune result with the actual frequencies + */ + virtual uhd::tune_result_t set_center_freq( + const uhd::tune_request_t tune_request, size_t chan + ) = 0; + + /*! + * Tune the usrp device to the desired center frequency. + * This is a wrapper around set center freq so that in this case, + * the user can pass a single frequency in the call through swig. * \param freq the desired frequency in Hz * \param chan the channel index 0 to N-1 * \return a tune result with the actual frequencies */ - virtual uhd::tune_result_t set_center_freq(double freq, size_t chan) = 0; + uhd::tune_result_t set_center_freq(double freq, size_t chan){ + return set_center_freq(uhd::tune_request_t(freq), chan); + } /*! * Get the tunable frequency range. diff --git a/gr-uhd/lib/uhd_multi_usrp_source.cc b/gr-uhd/lib/uhd_multi_usrp_source.cc index 226e8b86fb..029a763e33 100644 --- a/gr-uhd/lib/uhd_multi_usrp_source.cc +++ b/gr-uhd/lib/uhd_multi_usrp_source.cc @@ -63,9 +63,10 @@ public: return _dev->get_rx_rate(); } - uhd::tune_result_t set_center_freq(double freq, size_t chan){ - uhd::tune_result_t tr = _dev->set_rx_freq(freq, chan); - return tr; + uhd::tune_result_t set_center_freq( + const uhd::tune_request_t tune_request, size_t chan + ){ + return _dev->set_rx_freq(tune_request, chan); } uhd::freq_range_t get_freq_range(size_t chan){ diff --git a/gr-uhd/lib/uhd_multi_usrp_source.h b/gr-uhd/lib/uhd_multi_usrp_source.h index 081c82ee64..b3cbdae1f6 100644 --- a/gr-uhd/lib/uhd_multi_usrp_source.h +++ b/gr-uhd/lib/uhd_multi_usrp_source.h @@ -64,11 +64,25 @@ public: /*! * Tune the usrp device to the desired center frequency. + * \param tune_request the tune request instructions + * \param chan the channel index 0 to N-1 + * \return a tune result with the actual frequencies + */ + virtual uhd::tune_result_t set_center_freq( + const uhd::tune_request_t tune_request, size_t chan + ) = 0; + + /*! + * Tune the usrp device to the desired center frequency. + * This is a wrapper around set center freq so that in this case, + * the user can pass a single frequency in the call through swig. * \param freq the desired frequency in Hz * \param chan the channel index 0 to N-1 * \return a tune result with the actual frequencies */ - virtual uhd::tune_result_t set_center_freq(double freq, size_t chan) = 0; + uhd::tune_result_t set_center_freq(double freq, size_t chan){ + return set_center_freq(uhd::tune_request_t(freq), chan); + } /*! * Get the tunable frequency range. diff --git a/gr-uhd/lib/uhd_single_usrp_sink.cc b/gr-uhd/lib/uhd_single_usrp_sink.cc index 24981a59af..622f506b55 100644 --- a/gr-uhd/lib/uhd_single_usrp_sink.cc +++ b/gr-uhd/lib/uhd_single_usrp_sink.cc @@ -62,9 +62,10 @@ public: return _dev->get_tx_rate(); } - uhd::tune_result_t set_center_freq(double freq, size_t chan){ - uhd::tune_result_t tr = _dev->set_tx_freq(freq, chan); - return tr; + uhd::tune_result_t set_center_freq( + const uhd::tune_request_t tune_request, size_t chan + ){ + return _dev->set_tx_freq(tune_request, chan); } uhd::freq_range_t get_freq_range(size_t chan){ diff --git a/gr-uhd/lib/uhd_single_usrp_sink.h b/gr-uhd/lib/uhd_single_usrp_sink.h index 390667df9c..a4c4e6452e 100644 --- a/gr-uhd/lib/uhd_single_usrp_sink.h +++ b/gr-uhd/lib/uhd_single_usrp_sink.h @@ -63,11 +63,25 @@ public: /*! * Tune the usrp device to the desired center frequency. + * \param tune_request the tune request instructions + * \param chan the channel index 0 to N-1 + * \return a tune result with the actual frequencies + */ + virtual uhd::tune_result_t set_center_freq( + const uhd::tune_request_t tune_request, size_t chan + ) = 0; + + /*! + * Tune the usrp device to the desired center frequency. + * This is a wrapper around set center freq so that in this case, + * the user can pass a single frequency in the call through swig. * \param freq the desired frequency in Hz * \param chan the channel index 0 to N-1 * \return a tune result with the actual frequencies */ - virtual uhd::tune_result_t set_center_freq(double freq, size_t chan = 0) = 0; + uhd::tune_result_t set_center_freq(double freq, size_t chan){ + return set_center_freq(uhd::tune_request_t(freq), chan); + } /*! * Get the tunable frequency range. diff --git a/gr-uhd/lib/uhd_single_usrp_source.cc b/gr-uhd/lib/uhd_single_usrp_source.cc index f7c7fc8396..907e8be542 100644 --- a/gr-uhd/lib/uhd_single_usrp_source.cc +++ b/gr-uhd/lib/uhd_single_usrp_source.cc @@ -63,9 +63,10 @@ public: return _dev->get_rx_rate(); } - uhd::tune_result_t set_center_freq(double freq, size_t chan){ - uhd::tune_result_t tr = _dev->set_rx_freq(freq, chan); - return tr; + uhd::tune_result_t set_center_freq( + const uhd::tune_request_t tune_request, size_t chan + ){ + return _dev->set_rx_freq(tune_request, chan); } uhd::freq_range_t get_freq_range(size_t chan){ diff --git a/gr-uhd/lib/uhd_single_usrp_source.h b/gr-uhd/lib/uhd_single_usrp_source.h index 415c52e9a5..495f8c6117 100644 --- a/gr-uhd/lib/uhd_single_usrp_source.h +++ b/gr-uhd/lib/uhd_single_usrp_source.h @@ -63,11 +63,25 @@ public: /*! * Tune the usrp device to the desired center frequency. + * \param tune_request the tune request instructions + * \param chan the channel index 0 to N-1 + * \return a tune result with the actual frequencies + */ + virtual uhd::tune_result_t set_center_freq( + const uhd::tune_request_t tune_request, size_t chan + ) = 0; + + /*! + * Tune the usrp device to the desired center frequency. + * This is a wrapper around set center freq so that in this case, + * the user can pass a single frequency in the call through swig. * \param freq the desired frequency in Hz * \param chan the channel index 0 to N-1 * \return a tune result with the actual frequencies */ - virtual uhd::tune_result_t set_center_freq(double freq, size_t chan = 0) = 0; + uhd::tune_result_t set_center_freq(double freq, size_t chan){ + return set_center_freq(uhd::tune_request_t(freq), chan); + } /*! * Get the tunable frequency range. diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i index 5b3b524720..d332bb6171 100644 --- a/gr-uhd/swig/uhd_swig.i +++ b/gr-uhd/swig/uhd_swig.i @@ -69,6 +69,7 @@ namespace std { //////////////////////////////////////////////////////////////////////// %include <uhd/config.hpp> %include <uhd/types/ranges.hpp> +%include <uhd/types/tune_request.hpp> %include <uhd/types/tune_result.hpp> %include <uhd/types/io_type.hpp> %include <uhd/types/time_spec.hpp> -- cgit v1.2.3