From c3dacc667e7e71752479835ee308c66a17366d34 Mon Sep 17 00:00:00 2001 From: Zack Moratto Date: Sat, 2 Jul 2011 16:44:38 -0700 Subject: [PATCH] Allow the user to set which antenna to use on the sub device So .. from the terminal, "-A RX2", would set the device to use the RX2 antenna.The UHD manual will define your options. If the user puts in a bad selection, it will complain and list the options. --- src/python/uhd_modes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/uhd_modes.py b/src/python/uhd_modes.py index 244ad06..f56e7f9 100755 --- a/src/python/uhd_modes.py +++ b/src/python/uhd_modes.py @@ -63,6 +63,8 @@ class adsb_rx_block (gr.top_block): if(options.rx_subdev_spec is None): options.rx_subdev_spec = "" self.u.set_subdev_spec(options.rx_subdev_spec) + if not options.antenna is None: + self.u.set_antenna(options.antenna) self.u.set_samp_rate(rate) rate = int(self.u.get_samp_rate()) #retrieve actual @@ -114,6 +116,8 @@ if __name__ == '__main__': parser = OptionParser(option_class=eng_option, usage=usage) parser.add_option("-R", "--rx-subdev-spec", type="string", help="select USRP Rx side A or B", metavar="SUBDEV") + parser.add_option("-A", "--antenna", type="string", + help="select which antenna to use on daughterboard") parser.add_option("-f", "--freq", type="eng_float", default=1090e6, help="set receive frequency in Hz [default=%default]", metavar="FREQ") parser.add_option("-g", "--gain", type="int", default=None,