mbed-os/workspace_tools/host_tests/example/BroadcastReceive.py

10 lines
167 B
Python

import socket
BROADCAST_PORT = 58083
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('0.0.0.0', BROADCAST_PORT))
while True:
print s.recvfrom(256)