Created
June 4, 2018 00:59
-
-
Save amicuscertus/ed1cf22dfd41c79e82a66eff80d43926 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
UDP_IP = "127.0.0.1" | |
UDP_PORT = 7355 # 4379 for WSJT-X, 7355 for Gqrx | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.bind((UDP_IP, UDP_PORT)) | |
while True: | |
data, addr = sock.recvfrom(512) | |
ldata = len(data) | |
print("data length = ", ldata) | |
for i in range(ldata//2): | |
d0 = data[0+2*i] | |
d1 = data[1+2*i] | |
d2 = d1*256 + d0 | |
if d1 > 127: | |
d2 -= 65536 | |
print (d2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment