Add test program to list current networks
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 30 Jul 2008 06:00:41 +0000 (08:00 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 30 Jul 2008 06:00:41 +0000 (08:00 +0200)
test/list-networks [new file with mode: 0755]

diff --git a/test/list-networks b/test/list-networks
new file mode 100755 (executable)
index 0000000..72a9ad1
--- /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")
+
+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"):
+               print "[ %s ]" % (path)
+
+       if (properties["Type"] == "network"):
+               print "    %s" % (properties["SSID"])