manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
"org.moblin.connman.Manager")
-devices = manager.ListDevices()
+properties = manager.GetProperties()
-for path in devices:
- print "[ %s ]" % (path)
+for path in properties["Technologies"]:
+ technology = dbus.Interface(bus.get_object("org.moblin.connman", path),
+ "org.moblin.connman.Technology")
- element = dbus.Interface(bus.get_object("org.moblin.connman", path),
- "org.moblin.connman.Element")
+ properties = technology.GetProperties()
- properties = element.GetProperties()
- for key in properties.keys():
- print " %s = %s" % (key, properties[key])
+ for path in properties["Devices"]:
+ device = dbus.Interface(bus.get_object("org.moblin.connman", path),
+ "org.moblin.connman.Device")
- print
+ properties = device.GetProperties()
+
+ print "[ %s ]" % (path)
+
+ for key in properties.keys():
+ if key in ["Networks"]:
+ val = ""
+ for i in properties[key]:
+ val += i + " "
+ else:
+ val = str(properties[key])
+ print " %s = %s" % (key, val)
+
+ print