Update object variable to match its type
[connman] / test / list-devices
index 3c1b82e..691a6fb 100755 (executable)
@@ -7,15 +7,13 @@ 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)