summaryrefslogtreecommitdiff
path: root/gr-uhd/examples/usrp_tv_rcv_nogui.py
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2011-12-14 22:23:50 -0500
committerTom Rondeau <trondeau@vt.edu>2011-12-14 22:23:50 -0500
commite4cf0d1b51b7bc9843e76e8d6e35097664b6f2b3 (patch)
treef9a6452c60bd030b8f9b1d198abf304d78b67d0e /gr-uhd/examples/usrp_tv_rcv_nogui.py
parentaa0cca173047fc268eb3acfcb7cc8cbb2d8c7581 (diff)
uhd: fixes to instantiating UHD devices to set the antenna and subdevice properly (patch from Sam Bretheim).
Diffstat (limited to 'gr-uhd/examples/usrp_tv_rcv_nogui.py')
-rwxr-xr-xgr-uhd/examples/usrp_tv_rcv_nogui.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/gr-uhd/examples/usrp_tv_rcv_nogui.py b/gr-uhd/examples/usrp_tv_rcv_nogui.py
index f6a40d675c..870e65b271 100755
--- a/gr-uhd/examples/usrp_tv_rcv_nogui.py
+++ b/gr-uhd/examples/usrp_tv_rcv_nogui.py
@@ -133,6 +133,14 @@ class my_top_block(gr.top_block):
# build the graph
self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
+ # Set the subdevice spec
+ if(options.spec):
+ self.u.set_subdev_spec(options.spec, 0)
+
+ # Set the antenna
+ if(options.antenna):
+ self.u.set_antenna(options.antenna, 0)
+
self.u.set_samp_rate(input_rate)
dev_rate = self.u.get_samp_rate()
@@ -149,14 +157,6 @@ class my_top_block(gr.top_block):
sys.stderr.write('Failed to set frequency\n')
raise SystemExit, 1
- # Set the subdevice spec
- if(options.spec):
- self.u.set_subdev_spec(options.spec, 0)
-
- # Set the antenna
- if(options.antenna):
- self.u.set_antenna(options.antenna, 0)
-
self.agc = gr.agc_cc(1e-7,1.0,1.0) #1e-7
self.am_demod = gr.complex_to_mag ()