WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface"
WPAS_DBUS_WPS_INTERFACE = "fi.w1.wpa_supplicant1.Interface.WPS"
-def stateChanged(newState, oldState):
- print "StateChanged(%s -> %s)" % (oldState, newState)
+def propertiesChanged(properties):
+ if properties.has_key("State"):
+ print "PropertiesChanged: State: %s" % (properties["State"])
def scanDone(success):
print "Scan done: success=%s" % success
bus.add_signal_receiver(bssRemoved,
dbus_interface=WPAS_DBUS_INTERFACES_INTERFACE,
signal_name="BSSRemoved")
- bus.add_signal_receiver(stateChanged,
+ bus.add_signal_receiver(propertiesChanged,
dbus_interface=WPAS_DBUS_INTERFACES_INTERFACE,
- signal_name="StateChanged")
+ signal_name="PropertiesChanged")
bus.add_signal_receiver(wpsEvent,
dbus_interface=WPAS_DBUS_WPS_INTERFACE,
signal_name="Event")
ifname = sys.argv[1]
path = wpas.GetInterface(ifname)
- global if_obj
if_obj = bus.get_object(WPAS_DBUS_SERVICE, path)
- global iface
+ if_obj.Set(WPAS_DBUS_WPS_INTERFACE, 'ProcessCredentials',
+ dbus.Boolean(1),
+ dbus_interface=dbus.PROPERTIES_IFACE)
wps = dbus.Interface(if_obj, WPAS_DBUS_WPS_INTERFACE)
wps.Start({'Role': 'enrollee', 'Type': 'pbc'})