def register(ssid, key):
"""
the entrance function of SmartConfig(tmd)
:type ssid: str
:type key: str
"""
port = 8514
data = {'key':encode(key), 'ssid':encode(ssid)}
s = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
for i in xrange(10):
send(s, port, data, ssid, key)
sleep(100)
评论列表
文章目录