summaryrefslogtreecommitdiff
path: root/test/list-networks
diff options
context:
space:
mode:
Diffstat (limited to 'test/list-networks')
-rwxr-xr-xtest/list-networks60
1 files changed, 0 insertions, 60 deletions
diff --git a/test/list-networks b/test/list-networks
deleted file mode 100755
index 052d318e..00000000
--- a/test/list-networks
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/python
-
-import dbus
-import string
-
-bus = dbus.SystemBus()
-
-manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
- "org.moblin.connman.Manager")
-
-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["Technologies"]:
- technology = dbus.Interface(bus.get_object("org.moblin.connman", path),
- "org.moblin.connman.Technology")
-
- properties = technology.GetProperties()
-
- for path in properties["Devices"]:
- device = dbus.Interface(bus.get_object("org.moblin.connman", path),
- "org.moblin.connman.Device")
-
- properties = device.GetProperties()
-
- try:
- if properties["Type"] not in ["ethernet", "wifi", "wimax",
- "bluetooth", "cellular"]:
- continue
- except:
- continue
-
- print "[ %s ]" % (path)
-
- 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():
- if key == "WiFi.SSID":
- ssid = convert_ssid(properties[key])
- print " %s = [ %s ]" % (key, ssid)
- elif key in ["Strength", "Priority"]:
- print " %s = %d" % (key, properties[key])
- else:
- print " %s = %s" % (key, properties[key])
-
- print