summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/hier/networking/vector_sink.py
diff options
context:
space:
mode:
authortrondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5>2007-02-09 22:49:09 +0000
committertrondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5>2007-02-09 22:49:09 +0000
commit3e7f3d33cfbd4f64a90aa43c8e8505213362faee (patch)
tree4a6805309e517619bcee88e755ec03efca6e48e0 /gnuradio-examples/python/hier/networking/vector_sink.py
parentad798c9a53e0c4cbee7ba3b47966c0882e22e8e1 (diff)
merging r4318:4437 to fix ticket:131 from branche trondeau/udp udp source/sink pairs working
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4438 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/hier/networking/vector_sink.py')
-rwxr-xr-xgnuradio-examples/python/hier/networking/vector_sink.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/gnuradio-examples/python/hier/networking/vector_sink.py b/gnuradio-examples/python/hier/networking/vector_sink.py
index d1aa9def3c..54578078fd 100755
--- a/gnuradio-examples/python/hier/networking/vector_sink.py
+++ b/gnuradio-examples/python/hier/networking/vector_sink.py
@@ -25,35 +25,34 @@ from gnuradio.eng_option import eng_option
from optparse import OptionParser
class vector_sink(gr.hier_block2):
- def __init__(self, local_ipaddress, port, mtu):
+ def __init__(self, src, port, pkt_size):
gr.hier_block2.__init__(self,
"vector_sink", # Block type
gr.io_signature(0,0,0), # Input signature
gr.io_signature(0,0,0)) # Output signature
- udp = gr.udp_source(gr.sizeof_char, local_ipaddress, port, mtu)
+ udp = gr.udp_source(gr.sizeof_float, src, port, pkt_size)
self.define_component("src", udp)
- self.define_component("dst", gr.file_sink(gr.sizeof_char, "received.dat"))
+ self.define_component("dst", gr.file_sink(gr.sizeof_float, "received.dat"))
self.connect("src", 0, "dst", 0)
if __name__ == "__main__":
parser = OptionParser(option_class=eng_option)
- parser.add_option("", "--local-ipaddr", type="string", default="127.0.0.1",
- help="local IP address")
- parser.add_option("", "--local-port", type="int", default=65500,
+ parser.add_option("", "--src-name", type="string", default="localhost",
+ help="local host name (domain name or IP address)")
+ parser.add_option("", "--src-port", type="int", default=65500,
help="port value to listen to for connection")
- parser.add_option("", "--mtu", type="int", default=540,
- help="packet size.")
+ parser.add_option("", "--packet-size", type="int", default=1471,
+ help="packet size.")
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
raise SystemExit, 1
# Create an instance of a hierarchical block
- top_block = vector_sink(options.local_ipaddr, options.local_port,
- options.mtu)
+ top_block = vector_sink(options.src_name, options.src_port, options.packet_size)
# Create an instance of a runtime, passing it the top block
runtime = gr.runtime(top_block)