summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/examples
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-03-13 19:04:21 -0400
committerTom Rondeau <trondeau@vt.edu>2013-03-13 19:04:21 -0400
commit41c0eb43e2177f3e22f4f72ca8e99d6580944b21 (patch)
tree75936cbeb0aa8e43404a715f430fc537cb1fa005 /gnuradio-core/src/examples
parent3e33c4655ca02d831ecef17f30264afc962965af (diff)
blocks: removing udp_source/sink from gnuradio-core; now in gr-blocks.
Diffstat (limited to 'gnuradio-core/src/examples')
-rwxr-xr-xgnuradio-core/src/examples/network/audio_sink.py8
-rwxr-xr-xgnuradio-core/src/examples/network/audio_source.py3
-rwxr-xr-xgnuradio-core/src/examples/network/dial_tone_sink.py10
-rwxr-xr-xgnuradio-core/src/examples/network/dial_tone_source.py2
-rwxr-xr-xgnuradio-core/src/examples/network/vector_sink.py7
-rwxr-xr-xgnuradio-core/src/examples/network/vector_source.py3
6 files changed, 14 insertions, 19 deletions
diff --git a/gnuradio-core/src/examples/network/audio_sink.py b/gnuradio-core/src/examples/network/audio_sink.py
index 72a678816c..0e412de5ae 100755
--- a/gnuradio-core/src/examples/network/audio_sink.py
+++ b/gnuradio-core/src/examples/network/audio_sink.py
@@ -21,6 +21,7 @@
#
from gnuradio import gr
+from gnuradio import blocks
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import sys
@@ -34,8 +35,7 @@ except ImportError:
class audio_sink(gr.top_block):
def __init__(self, host, port, pkt_size, sample_rate, eof, wait):
gr.top_block.__init__(self, "audio_sink")
- src = gr.udp_source(gr.sizeof_float, host, port, pkt_size,
- eof=eof, wait=wait)
+ src = blocks.udp_source(gr.sizeof_float, host, port, pkt_size, eof=eof)
dst = audio.sink(sample_rate)
self.connect(src, dst)
@@ -51,8 +51,6 @@ if __name__ == '__main__':
help="audio signal sample rate [default=%default]")
parser.add_option("", "--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- parser.add_option("", "--no-wait", action="store_true", default=False,
- help="don't wait for source")
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
@@ -61,7 +59,7 @@ if __name__ == '__main__':
# Create an instance of a hierarchical block
top_block = audio_sink(options.host, options.port,
options.packet_size, options.sample_rate,
- not options.no_eof, not options.no_wait)
+ not options.no_eof)
try:
# Run forever
diff --git a/gnuradio-core/src/examples/network/audio_source.py b/gnuradio-core/src/examples/network/audio_source.py
index 0baf7d2e91..577beff84c 100755
--- a/gnuradio-core/src/examples/network/audio_source.py
+++ b/gnuradio-core/src/examples/network/audio_source.py
@@ -21,6 +21,7 @@
#
from gnuradio import gr
+from gnuradio import blocks
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import sys
@@ -35,7 +36,7 @@ class audio_source(gr.top_block):
def __init__(self, host, port, pkt_size, sample_rate, eof):
gr.top_block.__init__(self, "audio_source")
self.audio = audio.source(sample_rate)
- self.sink = gr.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
+ self.sink = blocks.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
self.connect(self.audio, self.sink)
if __name__ == '__main__':
diff --git a/gnuradio-core/src/examples/network/dial_tone_sink.py b/gnuradio-core/src/examples/network/dial_tone_sink.py
index 83ad376c0c..fee6ded846 100755
--- a/gnuradio-core/src/examples/network/dial_tone_sink.py
+++ b/gnuradio-core/src/examples/network/dial_tone_sink.py
@@ -21,14 +21,14 @@
#
from gnuradio import gr, audio
+from gnuradio import blocks
from gnuradio.eng_option import eng_option
from optparse import OptionParser
class dial_tone_sink(gr.top_block):
- def __init__(self, host, port, pkt_size, sample_rate, eof, wait):
+ def __init__(self, host, port, pkt_size, sample_rate, eof):
gr.top_block.__init__(self, "dial_tone_sink")
- udp = gr.udp_source(gr.sizeof_float, host, port, pkt_size,
- eof=eof, wait=wait)
+ udp = blokcs.udp_source(gr.sizeof_float, host, port, pkt_size, eof=eof)
sink = audio.sink(sample_rate)
self.connect(udp, sink)
@@ -44,8 +44,6 @@ if __name__ == '__main__':
help="audio signal sample rate [default=%default]")
parser.add_option("", "--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- parser.add_option("", "--no-wait", action="store_true", default=False,
- help="don't wait for source")
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
@@ -54,7 +52,7 @@ if __name__ == '__main__':
# Create an instance of a hierarchical block
top_block = dial_tone_sink(options.host, options.port,
options.packet_size, options.sample_rate,
- not options.no_eof, not options.no_wait)
+ not options.no_eof)
try:
# Run forever
diff --git a/gnuradio-core/src/examples/network/dial_tone_source.py b/gnuradio-core/src/examples/network/dial_tone_source.py
index d0d3cc7a8d..44f05dc83c 100755
--- a/gnuradio-core/src/examples/network/dial_tone_source.py
+++ b/gnuradio-core/src/examples/network/dial_tone_source.py
@@ -47,7 +47,7 @@ class dial_tone_source(gr.top_block):
# Throttle needed here to account for the other side's audio card sampling rate
thr = blocks.throttle(gr.sizeof_float, sample_rate)
- sink = gr.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
+ sink = blocks.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
self.connect(src0, (add, 0))
self.connect(src1, (add, 1))
self.connect(add, thr, sink)
diff --git a/gnuradio-core/src/examples/network/vector_sink.py b/gnuradio-core/src/examples/network/vector_sink.py
index c220278e11..c0397d1e43 100755
--- a/gnuradio-core/src/examples/network/vector_sink.py
+++ b/gnuradio-core/src/examples/network/vector_sink.py
@@ -29,8 +29,7 @@ class vector_sink(gr.top_block):
def __init__(self, host, port, pkt_size, eof, wait):
gr.top_block.__init__(self, "vector_sink")
- udp = gr.udp_source(gr.sizeof_float, host, port, pkt_size,
- eof=eof, wait=wait)
+ udp = blocks.udp_source(gr.sizeof_float, host, port, pkt_size, eof=eof)
sink = blocks.file_sink(gr.sizeof_float, "received.dat")
self.connect(udp, sink)
@@ -44,8 +43,6 @@ if __name__ == "__main__":
help="packet size.")
parser.add_option("", "--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- parser.add_option("", "--no-wait", action="store_true", default=False,
- help="don't wait for source")
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
@@ -54,7 +51,7 @@ if __name__ == "__main__":
# Create an instance of a hierarchical block
top_block = vector_sink(options.host, options.port,
options.packet_size,
- not options.no_eof, not options.no_wait)
+ not options.no_eof)
try:
# Run forever
diff --git a/gnuradio-core/src/examples/network/vector_source.py b/gnuradio-core/src/examples/network/vector_source.py
index d322dda3b8..b960a6d96a 100755
--- a/gnuradio-core/src/examples/network/vector_source.py
+++ b/gnuradio-core/src/examples/network/vector_source.py
@@ -21,6 +21,7 @@
#
from gnuradio import gr
+from gnuradio import blocks
from gnuradio.eng_option import eng_option
from optparse import OptionParser
@@ -29,7 +30,7 @@ class vector_source(gr.top_block):
gr.top_block.__init__(self, "vector_source")
data = [i*0.01 for i in range(1000)]
vec = gr.vector_source_f(data, True)
- udp = gr.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
+ udp = blocks.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
self.connect(vec, udp)
if __name__ == '__main__':