bus = dbus.SystemBus()
-manager = dbus.Interface(bus.get_object('org.freedesktop.connman', "/"),
- 'org.freedesktop.connman.Manager')
+manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"),
+ 'org.moblin.connman.Manager')
-interfaces = manager.ListInterfaces()
+properties = manager.GetProperties()
-for path in interfaces:
- print "[ %s ]" % (path)
+for path in properties["Devices"]:
+ device = dbus.Interface(bus.get_object('org.moblin.connman', path),
+ 'org.moblin.connman.Device')
- interface = dbus.Interface(bus.get_object('org.freedesktop.connman', path),
- 'org.freedesktop.connman.Interface')
+ properties = device.GetProperties()
- properties = interface.GetProperties()
+ print "[ %s ]" % (path)
- if (properties["Type"] == "80211"):
- print " Started scanning"
- interface.Scan()
+ if (properties["Type"] == "wifi"):
+ print " Started WiFi scanning"
+ device.ProposeScan()
+ elif (properties["Type"] == "wimax"):
+ print " Started WiMAX scanning"
+ device.ProposeScan()
else:
print " No scanning"