summaryrefslogtreecommitdiff
path: root/gr-uhd/examples/usrp_wfm_rcv_nogui.py
diff options
context:
space:
mode:
authorTom Rondeau2011-10-21 19:43:05 -0400
committerTom Rondeau2011-10-21 19:43:05 -0400
commitd053db2aec8fe9640f7a33b6804d68281c02f820 (patch)
treeb17f76dd1fbbbd25e5ac1ce9d3019ecfbc4c9f64 /gr-uhd/examples/usrp_wfm_rcv_nogui.py
parentf896ce03e8fbe6baf18ea7b6e5bbe74f7e67c25a (diff)
downloadgnuradio-d053db2aec8fe9640f7a33b6804d68281c02f820.tar.gz
gnuradio-d053db2aec8fe9640f7a33b6804d68281c02f820.tar.bz2
gnuradio-d053db2aec8fe9640f7a33b6804d68281c02f820.zip
uhd: added subdevspec option to UHD examples and sets antenna based on option.
Diffstat (limited to 'gr-uhd/examples/usrp_wfm_rcv_nogui.py')
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_nogui.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gr-uhd/examples/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
index 7c2c6050d..90caf7d08 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_nogui.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
@@ -34,6 +34,8 @@ class wfm_rx_block (gr.top_block):
parser=OptionParser(option_class=eng_option)
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("-f", "--freq", type="eng_float", default=100.1e6,
@@ -119,6 +121,14 @@ class wfm_rx_block (gr.top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
+ # 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)
+
def set_vol (self, vol):
g = self.volume_range()
self.vol = max(g[0], min(g[1], vol))