Created
August 17, 2018 15:31
-
-
Save vo/15af10ca61479a8949b0ae0588f28b85 to your computer and use it in GitHub Desktop.
basic replacement for telem_ctrl
This file contains 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
#!/usr/bin/python | |
import socket | |
import sys | |
TELEM_DEST_HOST = '0.0.0.0' | |
TELEM_DEST_PORT = 14550 | |
STM32_HOST = '127.0.0.1' | |
STM32_PORT = 5015 | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.bind((TELEM_DEST_HOST, TELEM_DEST_PORT)) | |
while True: | |
num_bytes = sock.recv_into(buf) | |
if num_bytes > 0: | |
sock.sendto(data, (STM32_HOST, STM32_PORT)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment