commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10003 - gnuradio/trunk/gnuradio-examples/python/digit


From: trondeau
Subject: [Commit-gnuradio] r10003 - gnuradio/trunk/gnuradio-examples/python/digital
Date: Sun, 16 Nov 2008 19:38:41 -0700 (MST)

Author: trondeau
Date: 2008-11-16 19:38:41 -0700 (Sun, 16 Nov 2008)
New Revision: 10003

Modified:
   gnuradio/trunk/gnuradio-examples/python/digital/receive_path.py
   gnuradio/trunk/gnuradio-examples/python/digital/transmit_path.py
Log:
Added ability to select USRP board to digital examples

Modified: gnuradio/trunk/gnuradio-examples/python/digital/receive_path.py
===================================================================
--- gnuradio/trunk/gnuradio-examples/python/digital/receive_path.py     
2008-11-16 21:57:10 UTC (rev 10002)
+++ gnuradio/trunk/gnuradio-examples/python/digital/receive_path.py     
2008-11-17 02:38:41 UTC (rev 10003)
@@ -42,6 +42,7 @@
 
         options = copy.copy(options)    # make a copy so we can destructively 
modify
 
+        self._which              = options.which           # the USRP board 
attached
         self._verbose            = options.verbose
         self._rx_freq            = options.rx_freq         # receiver's center 
frequency
         self._rx_gain            = options.rx_gain         # receiver's gain
@@ -124,7 +125,8 @@
         self.connect(self.u, self.chan_filt, self.packet_receiver)
 
     def _setup_usrp_source(self):
-        self.u = usrp.source_c (fusb_block_size=self._fusb_block_size,
+        self.u = usrp.source_c (self._which,
+                                fusb_block_size=self._fusb_block_size,
                                 fusb_nblocks=self._fusb_nblocks)
         adc_rate = self.u.adc_rate()
 
@@ -213,6 +215,8 @@
         if not normal.has_option("--bitrate"):
             normal.add_option("-r", "--bitrate", type="eng_float", 
default=None,
                               help="specify bitrate.  samples-per-symbol and 
interp/decim will be derived.")
+        normal.add_option("-w", "--which", type="int", default=0,
+                          help="select USRP board [default=%default]")
         normal.add_option("-R", "--rx-subdev-spec", type="subdev", 
default=None,
                           help="select USRP Rx side A or B")
         normal.add_option("", "--rx-gain", type="eng_float", default=None, 
metavar="GAIN",

Modified: gnuradio/trunk/gnuradio-examples/python/digital/transmit_path.py
===================================================================
--- gnuradio/trunk/gnuradio-examples/python/digital/transmit_path.py    
2008-11-16 21:57:10 UTC (rev 10002)
+++ gnuradio/trunk/gnuradio-examples/python/digital/transmit_path.py    
2008-11-17 02:38:41 UTC (rev 10003)
@@ -44,6 +44,7 @@
 
         options = copy.copy(options)    # make a copy so we can destructively 
modify
 
+        self._which              = options.which           # the USRP board 
attached
         self._verbose            = options.verbose
         self._tx_freq            = options.tx_freq         # tranmitter's 
center frequency
         self._tx_amplitude       = options.tx_amplitude    # digital amplitude 
sent to USRP
@@ -109,7 +110,8 @@
         Creates a USRP sink, determines the settings for best bitrate,
         and attaches to the transmitter's subdevice.
         """
-        self.u = usrp.sink_c(fusb_block_size=self._fusb_block_size,
+        self.u = usrp.sink_c(self._which,
+                             fusb_block_size=self._fusb_block_size,
                              fusb_nblocks=self._fusb_nblocks)
         dac_rate = self.u.dac_rate();
 
@@ -189,6 +191,8 @@
         if not normal.has_option('--bitrate'):
             normal.add_option("-r", "--bitrate", type="eng_float", 
default=None,
                               help="specify bitrate.  samples-per-symbol and 
interp/decim will be derived.")
+        normal.add_option("-w", "--which", type="int", default=0,
+                          help="select USRP board [default=%default]")
         normal.add_option("-T", "--tx-subdev-spec", type="subdev", 
default=None,
                           help="select USRP Tx side A or B")
         normal.add_option("", "--tx-amplitude", type="eng_float", 
default=12000, metavar="AMPL",





reply via email to

[Prev in Thread] Current Thread [Next in Thread]