From: eb Date: Wed, 30 May 2007 19:26:46 +0000 (+0000) Subject: Added error checking on call to set_freq X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=22988d507235d59cc168408e8dee8f0210153701;p=debian%2Fgnuradio Added error checking on call to set_freq git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5577 221aa14e-8319-0410-a670-987f0aec2ac5 --- diff --git a/gnuradio-examples/python/usrp/fm_tx4.py b/gnuradio-examples/python/usrp/fm_tx4.py index da887d8b..7e5023dd 100755 --- a/gnuradio-examples/python/usrp/fm_tx4.py +++ b/gnuradio-examples/python/usrp/fm_tx4.py @@ -104,7 +104,13 @@ class fm_tx_graph (stdgui.gui_flow_graph): print "Using TX d'board %s" % (self.subdev.side_and_name(),) self.subdev.set_gain(self.subdev.gain_range()[1]) # set max Tx gain - self.set_freq(options.freq) + if not self.set_freq(options.freq): + freq_range = self.subdev.freq_range() + print "Failed to set frequency to %s. Daughterboard supports %s to %s" % ( + eng_notation.num_to_str(options.freq), + eng_notation.num_to_str(freq_range[0]), + eng_notation.num_to_str(freq_range[1])) + raise SystemExit self.subdev.set_enable(True) # enable transmitter sum = gr.add_cc ()