diff options
author | Josh Blum | 2013-04-12 17:37:26 -0700 |
---|---|---|
committer | Josh Blum | 2013-06-25 14:13:50 -0700 |
commit | 4a2a578800fe18136615e51c6f1a8c072b5dd71e (patch) | |
tree | 25fa08c3bd3261354429b458c8c8464c02abc2a9 | |
parent | a88769e6f5ec9d6d3739d0b56dd9185c9c54009b (diff) | |
download | gnuradio-4a2a578800fe18136615e51c6f1a8c072b5dd71e.tar.gz gnuradio-4a2a578800fe18136615e51c6f1a8c072b5dd71e.tar.bz2 gnuradio-4a2a578800fe18136615e51c6f1a8c072b5dd71e.zip |
uhd: added getters for bandwidth setting and range
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_sink.h | 14 | ||||
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_source.h | 14 | ||||
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_sink.cc | 8 | ||||
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_source.cc | 8 |
4 files changed, 44 insertions, 0 deletions
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h index eaf60fb77..9cea6f3e2 100644 --- a/gr-uhd/include/gr_uhd_usrp_sink.h +++ b/gr-uhd/include/gr_uhd_usrp_sink.h @@ -290,6 +290,20 @@ public: virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0; /*! + * Get the bandpass filter setting on the RF frontend. + * \param chan the channel index 0 to N-1 + * \return bandwidth of the filter in Hz + */ + virtual double get_bandwidth(size_t chan = 0) = 0; + + /*! + * Get the bandpass filter range of the RF frontend. + * \param chan the channel index 0 to N-1 + * \return the range of the filter bandwidth in Hz + */ + virtual uhd::freq_range_t get_bandwidth_range(size_t chan = 0) = 0; + + /*! * Set a constant DC offset value. * The value is complex to control both I and Q. * \param offset the dc offset (1.0 is full-scale) diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h index 1243ddcc2..4d15bf160 100644 --- a/gr-uhd/include/gr_uhd_usrp_source.h +++ b/gr-uhd/include/gr_uhd_usrp_source.h @@ -300,6 +300,20 @@ public: virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0; /*! + * Get the bandpass filter setting on the RF frontend. + * \param chan the channel index 0 to N-1 + * \return bandwidth of the filter in Hz + */ + virtual double get_bandwidth(size_t chan = 0) = 0; + + /*! + * Get the bandpass filter range of the RF frontend. + * \param chan the channel index 0 to N-1 + * \return the range of the filter bandwidth in Hz + */ + virtual uhd::freq_range_t get_bandwidth_range(size_t chan = 0) = 0; + + /*! * Enable/disable the automatic DC offset correction. * The automatic correction subtracts out the long-run average. * diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc index 6216c94a8..99d8e03c3 100644 --- a/gr-uhd/lib/gr_uhd_usrp_sink.cc +++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc @@ -157,6 +157,14 @@ public: return _dev->set_tx_bandwidth(bandwidth, chan); } + double get_bandwidth(size_t chan){ + return _dev->get_tx_bandwidth(chan); + } + + uhd::freq_range_t get_bandwidth_range(size_t chan){ + return _dev->get_tx_bandwidth_range(chan); + } + void set_dc_offset(const std::complex<double> &offset, size_t chan){ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API return _dev->set_tx_dc_offset(offset, chan); diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc index 3813673b4..c6c82d56c 100644 --- a/gr-uhd/lib/gr_uhd_usrp_source.cc +++ b/gr-uhd/lib/gr_uhd_usrp_source.cc @@ -168,6 +168,14 @@ public: return _dev->set_rx_bandwidth(bandwidth, chan); } + double get_bandwidth(size_t chan){ + return _dev->get_rx_bandwidth(chan); + } + + uhd::freq_range_t get_bandwidth_range(size_t chan){ + return _dev->get_rx_bandwidth_range(chan); + } + void set_auto_dc_offset(const bool enable, size_t chan){ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API return _dev->set_rx_dc_offset(enable, chan); |