diff options
author | n4hy | 2008-03-25 22:59:46 +0000 |
---|---|---|
committer | n4hy | 2008-03-25 22:59:46 +0000 |
commit | 52234f95fc81481d1e92328b25e90a3e26731dea (patch) | |
tree | f3403762870c55d920fc7c133303ceeba1e86389 /gr-msdd6000/src | |
parent | c529a47357597ba1cea805b7e4f5fce3564404e1 (diff) | |
download | gnuradio-52234f95fc81481d1e92328b25e90a3e26731dea.tar.gz gnuradio-52234f95fc81481d1e92328b25e90a3e26731dea.tar.bz2 gnuradio-52234f95fc81481d1e92328b25e90a3e26731dea.zip |
modifications to firmware requires test code changes for udp
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8114 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-msdd6000/src')
-rwxr-xr-x | gr-msdd6000/src/python_test/test_udp.py | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/gr-msdd6000/src/python_test/test_udp.py b/gr-msdd6000/src/python_test/test_udp.py index da5c39de3..abb0cbf1b 100755 --- a/gr-msdd6000/src/python_test/test_udp.py +++ b/gr-msdd6000/src/python_test/test_udp.py @@ -4,37 +4,55 @@ from socket import * import string import time import struct; +import random; +msdd_port = 10001 +msdd_host = "10.45.4.43" -port = 10001 -host = "10.45.4.43" - -myaddr = ("10.45.1.229",10000); +my_udp_addr = ("10.45.1.229",10001); buf = 1024; +#myport = random.randint(1025,65535); +#my_tcp_addr = ("10.45.1.229",myport); +#TCPSock = socket(AF_INET,SOCK_STREAM); +#TCPSock.bind(my_tcp_addr); +#TCPSock.connect((msdd_host,msdd_port)); + UDPSock = socket(AF_INET,SOCK_DGRAM); -UDPSock.bind(myaddr); +UDPSock.bind(my_udp_addr); + +SETS_STREAM = 0xffffffff; f_mhz = 2400; f_hz = 1; gain = 3; samples = 512; -decim = 2; -sets = 16; +decim = 4; +#sets = 16; +sets = SETS_STREAM; +window = 3; +mode = 1; -req_data = struct.pack("<IIIIIIIIII", 0x0001, 0x0002, f_mhz, f_hz, gain, samples, decim, sets); -data = struct.pack("<II", 0x0000, 0x0000); +# construct the 3 different request type packets +fft_data = struct.pack("<IIIIIIIIII", 0x02, 0x20, f_mhz, f_hz, gain,window, samples, decim, mode,sets); +raw_data = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain,samples, decim,sets); +stat_data = struct.pack("!II", 0x0000, 0x0000) +# send appropriate udp request packet +UDPSock.sendto(raw_data, (msdd_host,msdd_port)) +#TCPSock.send(raw_data); -UDPSock.sendto(stat_data, (host,port)) +print "sent request" -print "sent" +print "waiting for response" data,addr = UDPSock.recvfrom(buf); + print "got response" +print data,addr |