summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-uhd/grc/uhd_simple_sink.xml9
-rw-r--r--gr-uhd/grc/uhd_simple_source.xml9
-rw-r--r--gr-uhd/lib/uhd_simple_sink.cc4
-rw-r--r--gr-uhd/lib/uhd_simple_sink.h2
-rw-r--r--gr-uhd/lib/uhd_simple_source.cc4
-rw-r--r--gr-uhd/lib/uhd_simple_source.h2
6 files changed, 28 insertions, 2 deletions
diff --git a/gr-uhd/grc/uhd_simple_sink.xml b/gr-uhd/grc/uhd_simple_sink.xml
index 078288e04..cad6194ee 100644
--- a/gr-uhd/grc/uhd_simple_sink.xml
+++ b/gr-uhd/grc/uhd_simple_sink.xml
@@ -10,8 +10,10 @@
<category>UHD</category>
<import>from gnuradio import uhd</import>
<make>uhd.simple_sink($args, "$type.type")
-self.$(id).set_samp_rate($samp_rate)</make>
+self.$(id).set_samp_rate($samp_rate)
+self.$(id).set_center_freq($center_freq)</make>
<callback>set_samp_rate($samp_rate)</callback>
+ <callback>set_center_freq($center_freq)</callback>
<param>
<name>Input Type</name>
<key>type</key>
@@ -41,6 +43,11 @@ self.$(id).set_samp_rate($samp_rate)</make>
<value>samp_rate</value>
<type>real</type>
</param>
+ <param>
+ <name>Center Freq (Hz)</name>
+ <key>center_freq</key>
+ <type>real</type>
+ </param>
<sink>
<name>out</name>
<type>$type</type>
diff --git a/gr-uhd/grc/uhd_simple_source.xml b/gr-uhd/grc/uhd_simple_source.xml
index 45496b098..519b7ad6c 100644
--- a/gr-uhd/grc/uhd_simple_source.xml
+++ b/gr-uhd/grc/uhd_simple_source.xml
@@ -10,8 +10,10 @@
<category>UHD</category>
<import>from gnuradio import uhd</import>
<make>uhd.simple_source($args, "$type.type")
-self.$(id).set_samp_rate($samp_rate)</make>
+self.$(id).set_samp_rate($samp_rate)
+self.$(id).set_center_freq($center_freq)</make>
<callback>set_samp_rate($samp_rate)</callback>
+ <callback>set_center_freq($center_freq)</callback>
<param>
<name>Output Type</name>
<key>type</key>
@@ -41,6 +43,11 @@ self.$(id).set_samp_rate($samp_rate)</make>
<value>samp_rate</value>
<type>real</type>
</param>
+ <param>
+ <name>Center Freq (Hz)</name>
+ <key>center_freq</key>
+ <type>real</type>
+ </param>
<source>
<name>out</name>
<type>$type</type>
diff --git a/gr-uhd/lib/uhd_simple_sink.cc b/gr-uhd/lib/uhd_simple_sink.cc
index c1edf29bb..f208bd294 100644
--- a/gr-uhd/lib/uhd_simple_sink.cc
+++ b/gr-uhd/lib/uhd_simple_sink.cc
@@ -66,6 +66,10 @@ double uhd_simple_sink::get_samp_rate(void){
return _dev->get_tx_rate();
}
+void uhd_simple_sink::set_center_freq(double freq){
+ _dev->set_tx_freq(freq);
+}
+
/***********************************************************************
* Work
**********************************************************************/
diff --git a/gr-uhd/lib/uhd_simple_sink.h b/gr-uhd/lib/uhd_simple_sink.h
index 301cdd24f..28965d870 100644
--- a/gr-uhd/lib/uhd_simple_sink.h
+++ b/gr-uhd/lib/uhd_simple_sink.h
@@ -39,6 +39,8 @@ public:
void set_samp_rate(double rate);
double get_samp_rate(void);
+ void set_center_freq(double freq);
+
int work(
int noutput_items,
gr_vector_const_void_star &input_items,
diff --git a/gr-uhd/lib/uhd_simple_source.cc b/gr-uhd/lib/uhd_simple_source.cc
index 827cad458..1a0bb2b61 100644
--- a/gr-uhd/lib/uhd_simple_source.cc
+++ b/gr-uhd/lib/uhd_simple_source.cc
@@ -68,6 +68,10 @@ double uhd_simple_source::get_samp_rate(void){
return _dev->get_rx_rate();
}
+void uhd_simple_source::set_center_freq(double freq){
+ _dev->set_rx_freq(freq);
+}
+
/***********************************************************************
* Work
**********************************************************************/
diff --git a/gr-uhd/lib/uhd_simple_source.h b/gr-uhd/lib/uhd_simple_source.h
index 0ddf9d563..cfab8b7a4 100644
--- a/gr-uhd/lib/uhd_simple_source.h
+++ b/gr-uhd/lib/uhd_simple_source.h
@@ -39,6 +39,8 @@ public:
void set_samp_rate(double rate);
double get_samp_rate(void);
+ void set_center_freq(double freq);
+
int work(
int noutput_items,
gr_vector_const_void_star &input_items,