You've already forked beagleconnect-freedom
mirror of
https://github.com/beagleboard/beagleconnect-freedom.git
synced 2026-07-28 19:52:43 +00:00
24 lines
497 B
Python
Executable File
24 lines
497 B
Python
Executable File
#!/usr/bin/env python
|
|
import socket
|
|
import sys
|
|
import struct
|
|
import time
|
|
import os
|
|
|
|
#if os.geteuid()==0:
|
|
# print "Running as root."
|
|
#else:
|
|
# print "User is not root."
|
|
|
|
addrinfo = socket.getaddrinfo("ff02::1", None)[0]
|
|
s = socket.socket(addrinfo[0], socket.SOCK_DGRAM)
|
|
s.setsockopt(socket.SOL_SOCKET, 25, 'lowpan0')
|
|
s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_LOOP, True)
|
|
|
|
|
|
while True:
|
|
data = repr(time.time())
|
|
s.sendto(data + '\0', (addrinfo[4][0], 9999))
|
|
time.sleep(1)
|
|
|