Skip to content

Instantly share code, notes, and snippets.

@amicuscertus
Created June 4, 2018 00:59
Show Gist options
  • Save amicuscertus/ed1cf22dfd41c79e82a66eff80d43926 to your computer and use it in GitHub Desktop.
Save amicuscertus/ed1cf22dfd41c79e82a66eff80d43926 to your computer and use it in GitHub Desktop.
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