summaryrefslogtreecommitdiff
path: root/gr-uhd/apps/uhd_fft.py
diff options
context:
space:
mode:
authorTom Rondeau2011-10-21 18:51:07 -0400
committerTom Rondeau2011-10-21 18:51:07 -0400
commit3e7ca8bfb95658dd9204e1d859e572b82e3b80d4 (patch)
tree4249d8b9db44a51c8976b39531aec5c916938a33 /gr-uhd/apps/uhd_fft.py
parentfef8376c0be52cf065b59925abe69209bdcfc1ee (diff)
downloadgnuradio-3e7ca8bfb95658dd9204e1d859e572b82e3b80d4.tar.gz
gnuradio-3e7ca8bfb95658dd9204e1d859e572b82e3b80d4.tar.bz2
gnuradio-3e7ca8bfb95658dd9204e1d859e572b82e3b80d4.zip
uhd: fixing uhd apps to take a subdev spec; also changing to more general uhd parameter of 'args' instead of 'address' which defaults to the first uhd dev found.
Diffstat (limited to 'gr-uhd/apps/uhd_fft.py')
-rwxr-xr-xgr-uhd/apps/uhd_fft.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py
index 0f0c274e8..7f529a528 100755
--- a/gr-uhd/apps/uhd_fft.py
+++ b/gr-uhd/apps/uhd_fft.py
@@ -45,9 +45,10 @@ class app_top_block(stdgui2.std_top_block):
self.panel = panel
parser = OptionParser(option_class=eng_option)
- parser.add_option("-a", "--address", type="string",
- default="addr=192.168.10.2",
- help="Address of UHD device, [default=%default]")
+ parser.add_option("-a", "--args", type="string", default="",
+ help="UHD device address args , [default=%default]")
+ parser.add_option("", "--spec", type="string", default=None,
+ help="Subdevice of UHD device where appropriate")
parser.add_option("-A", "--antenna", type="string", default=None,
help="select Rx Antenna where appropriate")
parser.add_option("-s", "--samp-rate", type="eng_float", default=1e6,
@@ -73,7 +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.address,
+ self.u = uhd.usrp_source(device_addr=options.args,
io_type=uhd.io_type.COMPLEX_FLOAT32,
num_channels=1)
@@ -118,6 +119,11 @@ class app_top_block(stdgui2.std_top_block):
self.set_gain(options.gain)
+ # 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)