Use device interface to trigger scanning
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 3 Dec 2008 22:02:07 +0000 (23:02 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 3 Dec 2008 22:02:07 +0000 (23:02 +0100)
test/start-scanning

index ff0dd07..9d3f4db 100755 (executable)
@@ -7,25 +7,22 @@ bus = dbus.SystemBus()
 manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"),
                                        'org.moblin.connman.Manager')
 
-elements = manager.ListElements()
+properties = manager.GetProperties()
 
-for path in elements:
-       element = dbus.Interface(bus.get_object('org.moblin.connman', path),
-                                               'org.moblin.connman.Element')
+for path in properties["Devices"]:
+       device = dbus.Interface(bus.get_object('org.moblin.connman', path),
+                                               'org.moblin.connman.Device')
 
-       properties = element.GetProperties()
-
-       if (properties["Type"] != "device"):
-               continue
+       properties = device.GetProperties()
 
        print "[ %s ]" % (path)
 
-       if (properties["Subtype"] == "wifi"):
+       if (properties["Type"] == "wifi"):
                print "   Started WiFi scanning"
-               element.Update()
-       elif (properties["Subtype"] == "wimax"):
+               device.Scan()
+       elif (properties["Type"] == "wimax"):
                print "   Started WiMAX scanning"
-               element.Update()
+               device.Scan()
        else:
                print "   No scanning"