Adapter test script to new network interface
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 23 Nov 2008 14:16:21 +0000 (15:16 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 23 Nov 2008 14:16:21 +0000 (15:16 +0100)
test/list-networks

index 11726a82127b58b95d8518d102e83e97b6f29161..94e111c4b22d6d96c2190c368988727fb310fe5e 100755 (executable)
@@ -7,20 +7,25 @@ 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()
+       properties = device.GetProperties()
 
-       if (properties["Type"] == "device"):
-               print "[ %s ]" % (path)
+       print "[ %s ]" % (path)
 
-       if (properties["Type"] == "network"):
-               if (properties["Enabled"] == 1):
-                       state = "*"
-               else:
-                       state = " "
-               print "    %s %s" % (state, properties["WiFi.Name"])
+       for path in properties["Networks"]:
+               network = dbus.Interface(bus.get_object("org.moblin.connman", path),
+                                               "org.moblin.connman.Network")
+
+               properties = network.GetProperties()
+
+               print "    [ %s ]" % (path)
+
+               for key in properties.keys():
+                       print "        %s = %s" % (key, properties[key])
+
+       print