Add first draft of new D-Bus API
[connman] / test / list-devices
diff --git a/test/list-devices b/test/list-devices
new file mode 100755 (executable)
index 0000000..9b9615b
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+
+import dbus
+
+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)
+
+       element = dbus.Interface(bus.get_object("org.moblin.connman", path),
+                                               "org.moblin.connman.Element")
+
+       properties = element.GetProperties()
+       for key in properties.keys():
+               print "    %s = %s" % (key, properties[key])
+
+       print