Use the element listing and filter by device type
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 11 Aug 2008 04:43:56 +0000 (06:43 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 11 Aug 2008 04:43:56 +0000 (06:43 +0200)
test/list-devices

index 9b9615b..3c1b82e 100755 (executable)
@@ -7,15 +7,18 @@ bus = dbus.SystemBus()
 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
                                        "org.moblin.connman.Manager")
 
-devices = manager.ListDevices()
-
-for path in devices:
-       print "[ %s ]" % (path)
+elements = manager.ListElements()
 
+for path in elements:
        element = dbus.Interface(bus.get_object("org.moblin.connman", path),
                                                "org.moblin.connman.Element")
 
        properties = element.GetProperties()
+       if (properties["Type"] != "device"):
+               continue
+
+       print "[ %s ]" % (path)
+
        for key in properties.keys():
                print "    %s = %s" % (key, properties[key])