X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gr-msdd6000%2Fsrc%2Fpython_test%2Fudp_stream_test.py;fp=gr-msdd6000%2Fsrc%2Fpython_test%2Fudp_stream_test.py;h=6136d16c599152ce8956a166bb7b94ed484b8dc9;hb=8a9ddbb0675f9bfcc6e03b457fba6c79474a3693;hp=0000000000000000000000000000000000000000;hpb=82d471b9b4a8b389b5da44b19c69c36420828382;p=debian%2Fgnuradio diff --git a/gr-msdd6000/src/python_test/udp_stream_test.py b/gr-msdd6000/src/python_test/udp_stream_test.py new file mode 100644 index 00000000..6136d16c --- /dev/null +++ b/gr-msdd6000/src/python_test/udp_stream_test.py @@ -0,0 +1,127 @@ +#!/usr/bin/python + +from socket import * +import string +import time +import struct; +import random; +import array; +import cmath; +from numpy import *; +from numpy.fft import *; +from pylab import *; + +myport = random.randint(1025,65535); +filename = "output.dat"; + +msdd_port = 10001 +msdd_host = "10.45.4.46" + +buf = 100000; + +my_udp_addr = ('',10001); +my_udp_addr = ('10.45.1.229 ',10001); + +UDPSock = socket(AF_INET,SOCK_DGRAM); +UDPSock.bind(my_udp_addr); + +#f_mhz = 3500; +#f_mhz = 3500; +f_mhz = 2500; +f_hz = 0; +gain = 0; +window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman + +samples = 65535; +samples = samples*4; #bytes of data we are requesting + +decim = 2; #0-8 (3 => 2^3 = 8) +decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats +mode = 0; #0=IQ, 1=MAG, 2=MAGDB +#sets = 0; +sets = 0xffffffff; + +size_int = 4; +request_len = 6*size_int; # 6 int items not including the 8 bytes for opcode and length fields +print "request len = %d"%(request_len); + +raw_data = struct.pack("