#!/usr/bin/python
import dbus
+import string
bus = dbus.SystemBus()
properties = manager.GetProperties()
+def convert_ssid(ssid_list):
+ ssid = ""
+ for byte in ssid_list:
+ if (str(byte) in string.printable):
+ ssid = ssid + str(byte)
+ else:
+ ssid = ssid + "."
+ return ssid
+
for path in properties["Devices"]:
device = dbus.Interface(bus.get_object("org.moblin.connman", path),
"org.moblin.connman.Device")
properties = device.GetProperties()
- if (properties["Type"] != "wifi" and properties["Type"] != "wimax"):
+ if properties["Type"] not in ["wifi", "wimax",
+ "bluetooth", "cellular"]:
continue;
print "[ %s ]" % (path)
print " [ %s ]" % (path)
for key in properties.keys():
- print " %s = %s" % (key, properties[key])
+ if (key == "WiFi.SSID"):
+ ssid = convert_ssid(properties[key])
+ print " %s = [ %s ]" % (key, ssid)
+ elif (key == "Strength"):
+ print " %s = %d" % (key, properties[key])
+ else:
+ print " %s = %s" % (key, properties[key])
print