diff options
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_sink.h | 6 | ||||
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_source.h | 6 | ||||
-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, 28 insertions, 0 deletions
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h index a74cadab2..4ddb51920 100644 --- a/gr-uhd/include/gr_uhd_usrp_sink.h +++ b/gr-uhd/include/gr_uhd_usrp_sink.h @@ -138,6 +138,12 @@ public: virtual double get_samp_rate(void) = 0; /*! + * Get the possible sample rates for the usrp device. + * \return a range of rates in Sps + */ + virtual uhd::meta_range_t get_samp_rates(void) = 0; + + /*! * 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 diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h index d22d67241..e0c2cfe50 100644 --- a/gr-uhd/include/gr_uhd_usrp_source.h +++ b/gr-uhd/include/gr_uhd_usrp_source.h @@ -130,6 +130,12 @@ public: virtual double get_samp_rate(void) = 0; /*! + * Get the possible sample rates for the usrp device. + * \return a range of rates in Sps + */ + virtual uhd::meta_range_t get_samp_rates(void) = 0; + + /*! * 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 diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc index 56b16dbc2..82352c7d4 100644 --- a/gr-uhd/lib/gr_uhd_usrp_sink.cc +++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc @@ -76,6 +76,14 @@ public: return _dev->get_tx_rate(); } + uhd::meta_range_t get_samp_rates(void){ + #ifdef UHD_USRP_MULTI_USRP_GET_RATES_API + return _dev->get_tx_rates(); + #else + throw std::runtime_error("not implemented in this version"); + #endif + } + uhd::tune_result_t set_center_freq( const uhd::tune_request_t tune_request, size_t chan ){ diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc index adb234f25..207e049d8 100644 --- a/gr-uhd/lib/gr_uhd_usrp_source.cc +++ b/gr-uhd/lib/gr_uhd_usrp_source.cc @@ -80,6 +80,14 @@ public: return _dev->get_rx_rate(); } + uhd::meta_range_t get_samp_rates(void){ + #ifdef UHD_USRP_MULTI_USRP_GET_RATES_API + return _dev->get_rx_rates(); + #else + throw std::runtime_error("not implemented in this version"); + #endif + } + uhd::tune_result_t set_center_freq( const uhd::tune_request_t tune_request, size_t chan ){ |