Update object variable to match its type
[connman] / test / list-devices
index 9b9615b..691a6fb 100755 (executable)
@@ -7,15 +7,16 @@ bus = dbus.SystemBus()
 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
                                        "org.moblin.connman.Manager")
 
-devices = manager.ListDevices()
+properties = manager.GetProperties()
 
-for path in devices:
-       print "[ %s ]" % (path)
+for path in properties["Devices"]:
+       device = dbus.Interface(bus.get_object("org.moblin.connman", path),
+                                               "org.moblin.connman.Device")
+
+       properties = device.GetProperties()
 
-       element = dbus.Interface(bus.get_object("org.moblin.connman", path),
-                                               "org.moblin.connman.Element")
+       print "[ %s ]" % (path)
 
-       properties = element.GetProperties()
        for key in properties.keys():
                print "    %s = %s" % (key, properties[key])