summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau2011-10-19 09:58:03 -0700
committerTom Rondeau2011-10-19 09:58:03 -0700
commit7e985e7f553a863df37cf39bfd2bd958d82ea46c (patch)
tree5bdc21a7c1ab3290b6bd283f699befd77f23bc0f
parent792e9780cd48177a13416e5926b77f30526ae3ec (diff)
downloadgnuradio-7e985e7f553a863df37cf39bfd2bd958d82ea46c.tar.gz
gnuradio-7e985e7f553a863df37cf39bfd2bd958d82ea46c.tar.bz2
gnuradio-7e985e7f553a863df37cf39bfd2bd958d82ea46c.zip
digital: fixed digital narrowband examples to use args instead of address and better default.
-rw-r--r--gr-digital/examples/narrowband/README (renamed from gr-digital/examples/README)0
-rwxr-xr-xgr-digital/examples/narrowband/benchmark_rx.py2
-rwxr-xr-xgr-digital/examples/narrowband/benchmark_tx.py2
-rwxr-xr-xgr-digital/examples/narrowband/digital_bert_rx.py2
-rwxr-xr-xgr-digital/examples/narrowband/digital_bert_tx.py2
-rwxr-xr-xgr-digital/examples/narrowband/rx_voice.py2
-rw-r--r--gr-digital/examples/narrowband/uhd_interface.py28
7 files changed, 19 insertions, 19 deletions
diff --git a/gr-digital/examples/README b/gr-digital/examples/narrowband/README
index 1c50ad69b..1c50ad69b 100644
--- a/gr-digital/examples/README
+++ b/gr-digital/examples/narrowband/README
diff --git a/gr-digital/examples/narrowband/benchmark_rx.py b/gr-digital/examples/narrowband/benchmark_rx.py
index 65aac3638..19c242ec5 100755
--- a/gr-digital/examples/narrowband/benchmark_rx.py
+++ b/gr-digital/examples/narrowband/benchmark_rx.py
@@ -44,7 +44,7 @@ class my_top_block(gr.top_block):
gr.top_block.__init__(self)
if(options.rx_freq is not None):
- self.source = uhd_receiver(options.address, options.bitrate,
+ self.source = uhd_receiver(options.args, options.bitrate,
options.samples_per_symbol,
options.rx_freq, options.rx_gain,
options.antenna, options.verbose)
diff --git a/gr-digital/examples/narrowband/benchmark_tx.py b/gr-digital/examples/narrowband/benchmark_tx.py
index 1fd881981..cc077bb28 100755
--- a/gr-digital/examples/narrowband/benchmark_tx.py
+++ b/gr-digital/examples/narrowband/benchmark_tx.py
@@ -43,7 +43,7 @@ class my_top_block(gr.top_block):
gr.top_block.__init__(self)
if(options.tx_freq is not None):
- self.sink = uhd_transmitter(options.address, options.bitrate,
+ self.sink = uhd_transmitter(options.args, options.bitrate,
options.samples_per_symbol,
options.tx_freq, options.tx_gain,
options.antenna, options.verbose)
diff --git a/gr-digital/examples/narrowband/digital_bert_rx.py b/gr-digital/examples/narrowband/digital_bert_rx.py
index 9878f55e1..28331310d 100755
--- a/gr-digital/examples/narrowband/digital_bert_rx.py
+++ b/gr-digital/examples/narrowband/digital_bert_rx.py
@@ -113,7 +113,7 @@ class rx_psk_block(gr.top_block):
self._demodulator = self._demodulator_class(**demod_kwargs)
if(options.rx_freq is not None):
- self._source = uhd_receiver(options.address, options.bitrate,
+ self._source = uhd_receiver(options.args, options.bitrate,
options.samples_per_symbol,
options.rx_freq, options.rx_gain,
options.antenna, options.verbose)
diff --git a/gr-digital/examples/narrowband/digital_bert_tx.py b/gr-digital/examples/narrowband/digital_bert_tx.py
index 96cb338fe..46f4f9097 100755
--- a/gr-digital/examples/narrowband/digital_bert_tx.py
+++ b/gr-digital/examples/narrowband/digital_bert_tx.py
@@ -67,7 +67,7 @@ class tx_psk_block(gr.top_block):
self._modulator = self._modulator_class(**mod_kwargs)
if(options.tx_freq is not None):
- self._sink = uhd_transmitter(options.address, options.bitrate,
+ self._sink = uhd_transmitter(options.args, options.bitrate,
options.samples_per_symbol,
options.tx_freq, options.tx_gain,
options.antenna, options.verbose)
diff --git a/gr-digital/examples/narrowband/rx_voice.py b/gr-digital/examples/narrowband/rx_voice.py
index 42d7b893b..100caff8e 100755
--- a/gr-digital/examples/narrowband/rx_voice.py
+++ b/gr-digital/examples/narrowband/rx_voice.py
@@ -66,7 +66,7 @@ class my_top_block(gr.top_block):
self.audio_tx = audio_tx(options.audio_output)
if(options.rx_freq is not None):
- self.source = uhd_receiver(options.address, options.bitrate,
+ self.source = uhd_receiver(options.args, options.bitrate,
options.samples_per_symbol,
options.rx_freq, options.rx_gain,
options.antenna, options.verbose)
diff --git a/gr-digital/examples/narrowband/uhd_interface.py b/gr-digital/examples/narrowband/uhd_interface.py
index 8420f3eec..5dffe46e0 100644
--- a/gr-digital/examples/narrowband/uhd_interface.py
+++ b/gr-digital/examples/narrowband/uhd_interface.py
@@ -42,19 +42,19 @@ def add_freq_option(parser):
metavar="FREQ")
class uhd_interface:
- def __init__(self, istx, address, bitrate, sps, freq=None,
+ def __init__(self, istx, args, bitrate, sps, freq=None,
gain=None, antenna=None):
if(istx):
- self.u = uhd.usrp_sink(device_addr=address,
+ self.u = uhd.usrp_sink(device_addr=args,
io_type=uhd.io_type.COMPLEX_FLOAT32,
num_channels=1)
else:
- self.u = uhd.usrp_source(device_addr=address,
+ self.u = uhd.usrp_source(device_addr=args,
io_type=uhd.io_type.COMPLEX_FLOAT32,
num_channels=1)
- self._addr = address
+ self._args = args
self._ant = antenna
self._gain = self.set_gain(gain)
self._freq = self.set_freq(freq)
@@ -124,14 +124,14 @@ class uhd_interface:
#-------------------------------------------------------------------#
class uhd_transmitter(uhd_interface, gr.hier_block2):
- def __init__(self, address, bitrate, sps, freq=None, gain=None,
+ def __init__(self, args, bitrate, sps, freq=None, gain=None,
antenna=None, verbose=False):
gr.hier_block2.__init__(self, "uhd_transmitter",
gr.io_signature(1,1,gr.sizeof_gr_complex),
gr.io_signature(0,0,0))
# Set up the UHD interface as a transmitter
- uhd_interface.__init__(self, True, address, bitrate, sps,
+ uhd_interface.__init__(self, True, args, bitrate, sps,
freq, gain, antenna)
self.connect(self, self.u)
@@ -141,8 +141,8 @@ class uhd_transmitter(uhd_interface, gr.hier_block2):
def add_options(parser):
add_freq_option(parser)
- 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("-A", "--antenna", type="string", default=None,
help="select Rx Antenna where appropriate")
parser.add_option("", "--tx-freq", type="eng_float", default=None,
@@ -160,7 +160,7 @@ class uhd_transmitter(uhd_interface, gr.hier_block2):
Prints information about the UHD transmitter
"""
print "\nUHD Transmitter:"
- print "Address: %s" % (self._addr)
+ print "Args: %s" % (self._args)
print "Freq: %sHz" % (eng_notation.num_to_str(self._freq))
print "Gain: %f dB" % (self._gain)
print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
@@ -174,14 +174,14 @@ class uhd_transmitter(uhd_interface, gr.hier_block2):
class uhd_receiver(uhd_interface, gr.hier_block2):
- def __init__(self, address, bitrate, sps, freq=None, gain=None,
+ def __init__(self, args, bitrate, sps, freq=None, gain=None,
antenna=None, verbose=False):
gr.hier_block2.__init__(self, "uhd_receiver",
gr.io_signature(0,0,0),
gr.io_signature(1,1,gr.sizeof_gr_complex))
# Set up the UHD interface as a receiver
- uhd_interface.__init__(self, False, address, bitrate, sps,
+ uhd_interface.__init__(self, False, args, bitrate, sps,
freq, gain, antenna)
self.connect(self.u, self)
@@ -191,8 +191,8 @@ class uhd_receiver(uhd_interface, gr.hier_block2):
def add_options(parser):
add_freq_option(parser)
- 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("-A", "--antenna", type="string", default=None,
help="select Rx Antenna where appropriate")
parser.add_option("", "--rx-freq", type="eng_float", default=None,
@@ -211,7 +211,7 @@ class uhd_receiver(uhd_interface, gr.hier_block2):
Prints information about the UHD transmitter
"""
print "\nUHD Receiver:"
- print "Address: %s" % (self._addr)
+ print "UHD Args: %s" % (self._args)
print "Freq: %sHz" % (eng_notation.num_to_str(self._freq))
print "Gain: %f dB" % (self._gain)
print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))