summaryrefslogtreecommitdiff
path: root/gr-uhd
diff options
context:
space:
mode:
authorJosh Blum2011-10-16 11:49:11 -0700
committerJosh Blum2011-11-07 18:56:28 -0800
commitf3d2a28dc8d1abfe42435a4b5040eb20dd295479 (patch)
tree6ca9404727990f03f7cf6d3acbfc44458c1c75d0 /gr-uhd
parent1f3014a355c3eb320e77d2875058edac2c7c86de (diff)
downloadgnuradio-f3d2a28dc8d1abfe42435a4b5040eb20dd295479.tar.gz
gnuradio-f3d2a28dc8d1abfe42435a4b5040eb20dd295479.tar.bz2
gnuradio-f3d2a28dc8d1abfe42435a4b5040eb20dd295479.zip
uhd: added get_samp_rates calls
Diffstat (limited to 'gr-uhd')
-rw-r--r--gr-uhd/include/gr_uhd_usrp_sink.h6
-rw-r--r--gr-uhd/include/gr_uhd_usrp_source.h6
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_sink.cc8
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc8
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
){