8
manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
9
"org.moblin.connman.Manager")
11
properties = manager.GetProperties()
13
def convert_ssid(ssid_list):
15
for byte in ssid_list:
16
if (str(byte) in string.printable):
17
ssid = ssid + str(byte)
22
for path in properties["Technologies"]:
23
technology = dbus.Interface(bus.get_object("org.moblin.connman", path),
24
"org.moblin.connman.Technology")
26
properties = technology.GetProperties()
28
for path in properties["Devices"]:
29
device = dbus.Interface(bus.get_object("org.moblin.connman", path),
30
"org.moblin.connman.Device")
32
properties = device.GetProperties()
35
if properties["Type"] not in ["ethernet", "wifi", "wimax",
36
"bluetooth", "cellular"]:
41
print "[ %s ]" % (path)
43
for path in properties["Networks"]:
44
network = dbus.Interface(bus.get_object("org.moblin.connman", path),
45
"org.moblin.connman.Network")
47
properties = network.GetProperties()
49
print " [ %s ]" % (path)
51
for key in properties.keys():
52
if key == "WiFi.SSID":
53
ssid = convert_ssid(properties[key])
54
print " %s = [ %s ]" % (key, ssid)
55
elif key in ["Strength", "Priority"]:
56
print " %s = %d" % (key, properties[key])
58
print " %s = %s" % (key, properties[key])