Add test script for changing device policy
[connman] / test / start-scanning
index b593323..cf36477 100755 (executable)
@@ -7,19 +7,19 @@ bus = dbus.SystemBus()
 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.moblin.connman', path),
-                                       'org.moblin.connman.Interface')
+       properties = device.GetProperties()
 
-       properties = interface.GetProperties()
+       print "[ %s ]" % (path)
 
-       if (properties["Type"] == "80211"):
+       if properties["Type"] in ["wifi", "wimax"]:
                print "   Started scanning"
-               interface.Scan()
+               device.ProposeScan()
        else:
                print "   No scanning"