wps-pin (492B)
1 #!/usr/bin/python3 2 3 import sys 4 import dbus 5 6 if (len(sys.argv) != 2 and len(sys.argv) != 3): 7 print("Usage: %s <device> [pin]" % (sys.argv[0])) 8 sys.exit(1) 9 10 bus = dbus.SystemBus() 11 wsc = dbus.Interface(bus.get_object("net.connman.iwd", sys.argv[1]), 12 "net.connman.iwd.SimpleConfiguration") 13 14 if (len(sys.argv) == 3): 15 pin = sys.argv[2] 16 else: 17 pin = wsc.GeneratePin() 18 print("Please use '%s' as the PIN" % (pin)) 19 20 wsc.StartPin(pin, timeout=125)