Include test-manager and leave test-supplicant out
[connman] / test / list-networks
1 #!/usr/bin/python
2
3 import dbus
4
5 bus = dbus.SystemBus()
6
7 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
8                                         "org.moblin.connman.Manager")
9
10 properties = manager.GetProperties()
11
12 for path in properties["Devices"]:
13         device = dbus.Interface(bus.get_object("org.moblin.connman", path),
14                                                 "org.moblin.connman.Device")
15
16         properties = device.GetProperties()
17
18         if (properties["Type"] != "wifi" and properties["Type"] != "wimax"):
19                 continue;
20
21         print "[ %s ]" % (path)
22
23         for path in properties["Networks"]:
24                 network = dbus.Interface(bus.get_object("org.moblin.connman", path),
25                                                 "org.moblin.connman.Network")
26
27                 properties = network.GetProperties()
28
29                 print "    [ %s ]" % (path)
30
31                 for key in properties.keys():
32                         print "        %s = %s" % (key, properties[key])
33
34         print