diff options
author | Josh Blum | 2010-10-25 16:22:05 -0700 |
---|---|---|
committer | Josh Blum | 2010-10-25 16:22:05 -0700 |
commit | 5a2de999da86d48cd7f005d08cc48965cb8c7a65 (patch) | |
tree | cc46fb2e2a024146133bb81308203a69bd603619 /gr-uhd | |
parent | df9a3f3bad0942fe0d6ec45dd02eec62544d02be (diff) | |
download | gnuradio-5a2de999da86d48cd7f005d08cc48965cb8c7a65.tar.gz gnuradio-5a2de999da86d48cd7f005d08cc48965cb8c7a65.tar.bz2 gnuradio-5a2de999da86d48cd7f005d08cc48965cb8c7a65.zip |
uhd: move tune functions to tune_request and provide wrapper for simple case
Diffstat (limited to 'gr-uhd')
-rw-r--r-- | gr-uhd/lib/uhd_multi_usrp_sink.cc | 7 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_multi_usrp_sink.h | 16 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_multi_usrp_source.cc | 7 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_multi_usrp_source.h | 16 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_sink.cc | 7 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_sink.h | 16 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_source.cc | 7 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_source.h | 16 | ||||
-rw-r--r-- | gr-uhd/swig/uhd_swig.i | 1 |
9 files changed, 77 insertions, 16 deletions
diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.cc b/gr-uhd/lib/uhd_multi_usrp_sink.cc index b75a8303c..ee16e2928 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 a94e7bd5a..370e59d0e 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 226e8b86f..029a763e3 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 081c82ee6..b3cbdae1f 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 24981a59a..622f506b5 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 390667df9..a4c4e6452 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 f7c7fc839..907e8be54 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 415c52e9a..495f8c611 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 5b3b52472..d332bb617 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> |