summaryrefslogtreecommitdiff
path: root/gr-uhd
diff options
context:
space:
mode:
authorJosh Blum2011-11-07 18:33:05 -0800
committerJosh Blum2011-11-07 18:56:29 -0800
commit24da5f495ca629113ea17f14e764af26a2285e73 (patch)
treedf56fe437eaf43de82e5859e97df6dabf02bf8ff /gr-uhd
parentd04404e1dd647b2de0f711a6ccba92e9dc21b823 (diff)
downloadgnuradio-24da5f495ca629113ea17f14e764af26a2285e73.tar.gz
gnuradio-24da5f495ca629113ea17f14e764af26a2285e73.tar.bz2
gnuradio-24da5f495ca629113ea17f14e764af26a2285e73.zip
uhd: change examples to use new stream api
Diffstat (limited to 'gr-uhd')
-rwxr-xr-xgr-uhd/apps/uhd_fft.py4
-rwxr-xr-xgr-uhd/apps/uhd_rx_cfile.py8
-rwxr-xr-xgr-uhd/apps/uhd_rx_nogui.py4
-rwxr-xr-xgr-uhd/apps/uhd_siggen.py4
-rwxr-xr-xgr-uhd/examples/fm_tx4.py4
-rwxr-xr-xgr-uhd/examples/fm_tx_2_daughterboards.py5
-rwxr-xr-xgr-uhd/examples/max_power.py5
-rw-r--r--gr-uhd/examples/tags_demo.cc4
-rwxr-xr-xgr-uhd/examples/usrp_am_mw_rcv.py4
-rwxr-xr-xgr-uhd/examples/usrp_nbfm_ptt.py4
-rwxr-xr-xgr-uhd/examples/usrp_nbfm_rcv.py4
-rwxr-xr-xgr-uhd/examples/usrp_spectrum_sense.py4
-rwxr-xr-xgr-uhd/examples/usrp_tv_rcv.py4
-rwxr-xr-xgr-uhd/examples/usrp_tv_rcv_nogui.py4
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv.py4
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv2_nogui.py5
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_fmdet.py4
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_nogui.py4
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_pll.py4
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_sca.py4
-rwxr-xr-xgr-uhd/examples/usrp_wxapt_rcv.py4
21 files changed, 26 insertions, 65 deletions
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py
index eec709c14..c06a23036 100755
--- a/gr-uhd/apps/uhd_fft.py
+++ b/gr-uhd/apps/uhd_fft.py
@@ -74,9 +74,7 @@ class app_top_block(stdgui2.std_top_block):
self.options = options
self.show_debug_info = True
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
# Set the subdevice spec
if(options.spec):
diff --git a/gr-uhd/apps/uhd_rx_cfile.py b/gr-uhd/apps/uhd_rx_cfile.py
index 625de36d3..61d5342c5 100755
--- a/gr-uhd/apps/uhd_rx_cfile.py
+++ b/gr-uhd/apps/uhd_rx_cfile.py
@@ -41,14 +41,10 @@ class rx_cfile_block(gr.top_block):
# Create a UHD device source
if options.output_shorts:
- self._u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_INT16,
- num_channels=1)
+ self._u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('sc16'))
self._sink = gr.file_sink(gr.sizeof_short*2, filename)
else:
- self._u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self._u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
self._sink = gr.file_sink(gr.sizeof_gr_complex, filename)
# Set receiver sample rate
diff --git a/gr-uhd/apps/uhd_rx_nogui.py b/gr-uhd/apps/uhd_rx_nogui.py
index 25068b3ac..7a2e0a07a 100755
--- a/gr-uhd/apps/uhd_rx_nogui.py
+++ b/gr-uhd/apps/uhd_rx_nogui.py
@@ -88,9 +88,7 @@ class uhd_src(gr.hier_block2):
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
- self._src = uhd.usrp_source(device_addr=args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self._src = uhd.usrp_source(device_addr=args, stream_args=uhd.stream_args('fc32'))
self._src.set_samp_rate(samp_rate)
dev_rate = self._src.get_samp_rate()
diff --git a/gr-uhd/apps/uhd_siggen.py b/gr-uhd/apps/uhd_siggen.py
index 08efc908f..27e9e8e01 100755
--- a/gr-uhd/apps/uhd_siggen.py
+++ b/gr-uhd/apps/uhd_siggen.py
@@ -92,9 +92,7 @@ class top_block(gr.top_block, pubsub):
self[TYPE_KEY] = options.type #set type last
def _setup_usrpx(self, options):
- self._u = uhd.usrp_sink(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self._u = uhd.usrp_sink(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
self._u.set_samp_rate(options.samp_rate)
# Set the subdevice spec
diff --git a/gr-uhd/examples/fm_tx4.py b/gr-uhd/examples/fm_tx4.py
index 11148ea63..714eed3cf 100755
--- a/gr-uhd/examples/fm_tx4.py
+++ b/gr-uhd/examples/fm_tx4.py
@@ -117,9 +117,7 @@ class fm_tx_block(stdgui2.std_top_block):
# ----------------------------------------------------------------
# Set up constants and parameters
- self.u = uhd.usrp_sink(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_sink(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
self.usrp_rate = options.samp_rate
self.u.set_samp_rate(self.usrp_rate)
diff --git a/gr-uhd/examples/fm_tx_2_daughterboards.py b/gr-uhd/examples/fm_tx_2_daughterboards.py
index 61c437a98..c0a7112de 100755
--- a/gr-uhd/examples/fm_tx_2_daughterboards.py
+++ b/gr-uhd/examples/fm_tx_2_daughterboards.py
@@ -113,9 +113,8 @@ class my_top_block(gr.top_block):
d = uhd.find_devices(uhd.device_addr(options.args))
uhd_type = d[0].get('type')
- self.u = uhd.usrp_sink(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=2)
+ stream_args = uhd.stream_args('fc32', channels=range(2))
+ self.u = uhd.usrp_sink(device_addr=options.args, stream_args=stream_args)
# Set up USRP system based on type
if(uhd_type == "usrp"):
diff --git a/gr-uhd/examples/max_power.py b/gr-uhd/examples/max_power.py
index 53e1b413c..a849432ee 100755
--- a/gr-uhd/examples/max_power.py
+++ b/gr-uhd/examples/max_power.py
@@ -59,9 +59,8 @@ class build_block(gr.top_block):
if tx_enable:
print "\nTRANSMIT CHAIN"
- self.u_tx = uhd.usrp_sink(device_addr=args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=tx_nchan)
+ stream_args = uhd.stream_args('fc32', channels=range(tx_nchan))
+ self.u_tx = uhd.usrp_sink(device_addr=args, stream_args=stream_args)
self.u_tx.set_samp_rate(MAX_RATE)
self.tx_src0 = gr.sig_source_c(self.u_tx.get_samp_rate(),
diff --git a/gr-uhd/examples/tags_demo.cc b/gr-uhd/examples/tags_demo.cc
index b40518f34..f7442f098 100644
--- a/gr-uhd/examples/tags_demo.cc
+++ b/gr-uhd/examples/tags_demo.cc
@@ -80,7 +80,7 @@ int main(int argc, char *argv[]){
//-- make the usrp source test blocks
//------------------------------------------------------------------
boost::shared_ptr<uhd_usrp_source> usrp_source = uhd_make_usrp_source(
- device_addr, uhd::io_type_t::COMPLEX_FLOAT32, 1
+ device_addr, uhd::stream_args_t("fc32")
);
usrp_source->set_samp_rate(samp_rate);
usrp_source->set_center_freq(center_freq);
@@ -96,7 +96,7 @@ int main(int argc, char *argv[]){
//-- make the usrp sink test blocks
//------------------------------------------------------------------
boost::shared_ptr<uhd_usrp_sink> usrp_sink = uhd_make_usrp_sink(
- device_addr, uhd::io_type_t::COMPLEX_FLOAT32, 1
+ device_addr, uhd::stream_args_t("fc32")
);
usrp_sink->set_samp_rate(samp_rate);
usrp_sink->set_center_freq(center_freq);
diff --git a/gr-uhd/examples/usrp_am_mw_rcv.py b/gr-uhd/examples/usrp_am_mw_rcv.py
index db3b35760..31fe9af70 100755
--- a/gr-uhd/examples/usrp_am_mw_rcv.py
+++ b/gr-uhd/examples/usrp_am_mw_rcv.py
@@ -75,9 +75,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.freq = 0
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
usrp_rate = 256e3
demod_rate = 64e3
diff --git a/gr-uhd/examples/usrp_nbfm_ptt.py b/gr-uhd/examples/usrp_nbfm_ptt.py
index 8f7ddee7d..3b28bc2ea 100755
--- a/gr-uhd/examples/usrp_nbfm_ptt.py
+++ b/gr-uhd/examples/usrp_nbfm_ptt.py
@@ -281,9 +281,7 @@ class transmit_path(gr.hier_block2):
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
- self.u = uhd.usrp_sink(device_addr=args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_sink(device_addr=args, stream_args=uhd.stream_args('fc32'))
self.if_rate = 320e3
self.audio_rate = 32e3
diff --git a/gr-uhd/examples/usrp_nbfm_rcv.py b/gr-uhd/examples/usrp_nbfm_rcv.py
index a558b9347..7e15abbcf 100755
--- a/gr-uhd/examples/usrp_nbfm_rcv.py
+++ b/gr-uhd/examples/usrp_nbfm_rcv.py
@@ -266,9 +266,7 @@ class receive_path(gr.hier_block2):
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
- self.u = uhd.usrp_source(device_addr=args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=args, stream_args=uhd.stream_args('fc32'))
self.if_rate = 256e3
self.quad_rate = 64e3
diff --git a/gr-uhd/examples/usrp_spectrum_sense.py b/gr-uhd/examples/usrp_spectrum_sense.py
index 01ca60396..ceb95ea2a 100755
--- a/gr-uhd/examples/usrp_spectrum_sense.py
+++ b/gr-uhd/examples/usrp_spectrum_sense.py
@@ -131,9 +131,7 @@ class my_top_block(gr.top_block):
print "Note: failed to enable realtime scheduling"
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
usrp_rate = options.samp_rate
self.u.set_samp_rate(usrp_rate)
diff --git a/gr-uhd/examples/usrp_tv_rcv.py b/gr-uhd/examples/usrp_tv_rcv.py
index 22493dd00..6e61eceec 100755
--- a/gr-uhd/examples/usrp_tv_rcv.py
+++ b/gr-uhd/examples/usrp_tv_rcv.py
@@ -131,9 +131,7 @@ class tv_rx_block (stdgui2.std_top_block):
self.gain=0.0
else: # use a UHD device
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
self.u.set_samp_rate(usrp_rate)
dev_rate = self.u.get_samp_rate()
diff --git a/gr-uhd/examples/usrp_tv_rcv_nogui.py b/gr-uhd/examples/usrp_tv_rcv_nogui.py
index 2324eb29e..f6a40d675 100755
--- a/gr-uhd/examples/usrp_tv_rcv_nogui.py
+++ b/gr-uhd/examples/usrp_tv_rcv_nogui.py
@@ -131,9 +131,7 @@ class my_top_block(gr.top_block):
raise SystemExit, 1
# build the graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
self.u.set_samp_rate(input_rate)
dev_rate = self.u.get_samp_rate()
diff --git a/gr-uhd/examples/usrp_wfm_rcv.py b/gr-uhd/examples/usrp_wfm_rcv.py
index cfdaa6d6f..a4abdd2a7 100755
--- a/gr-uhd/examples/usrp_wfm_rcv.py
+++ b/gr-uhd/examples/usrp_wfm_rcv.py
@@ -69,9 +69,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.fm_freq_max = options.freq_max
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
usrp_rate = 320e3
demod_rate = 320e3
diff --git a/gr-uhd/examples/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/usrp_wfm_rcv2_nogui.py
index 8cbd18475..4173468ef 100755
--- a/gr-uhd/examples/usrp_wfm_rcv2_nogui.py
+++ b/gr-uhd/examples/usrp_wfm_rcv2_nogui.py
@@ -70,9 +70,8 @@ class wfm_rx_block (gr.top_block):
self.fm_freq_max = options.freq_max
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=2)
+ stream_args = uhd.stream_args('fc32', channels=range(2))
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=stream_args)
# Set front end channel mapping
self.u.set_subdev_spec(options.spec)
diff --git a/gr-uhd/examples/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/usrp_wfm_rcv_fmdet.py
index 39c711a6d..225c9607b 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_fmdet.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_fmdet.py
@@ -71,9 +71,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.fm_freq_max = options.freq_max
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
usrp_rate = 320e3
demod_rate = 320e3
diff --git a/gr-uhd/examples/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
index 90caf7d08..498d2dec6 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_nogui.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
@@ -63,9 +63,7 @@ class wfm_rx_block (gr.top_block):
self.fm_freq_max = options.freq_max
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
usrp_rate = 320e3
demod_rate = 320e3
diff --git a/gr-uhd/examples/usrp_wfm_rcv_pll.py b/gr-uhd/examples/usrp_wfm_rcv_pll.py
index 2901bf735..383670c75 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_pll.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_pll.py
@@ -71,9 +71,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.fm_freq_max = options.freq_max
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
usrp_rate = 320e3
demod_rate = 320e3
diff --git a/gr-uhd/examples/usrp_wfm_rcv_sca.py b/gr-uhd/examples/usrp_wfm_rcv_sca.py
index 9caef7499..9b233a7fb 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_sca.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_sca.py
@@ -100,9 +100,7 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
usrp_rate = 320e3
demod_rate = 320e3
diff --git a/gr-uhd/examples/usrp_wxapt_rcv.py b/gr-uhd/examples/usrp_wxapt_rcv.py
index 1da51d363..78cc7bd08 100755
--- a/gr-uhd/examples/usrp_wxapt_rcv.py
+++ b/gr-uhd/examples/usrp_wxapt_rcv.py
@@ -69,9 +69,7 @@ class wxapt_rx_block (stdgui2.std_top_block):
self.freq_max = options.freq_max
# build graph
- self.u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
usrp_rate = 320e3
demod_rate = 320e3