From 32d267c1a6083f3f5183e5f3f15161b097f37419 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 25 Jan 2010 07:14:11 +0100 Subject: Add support for technology interface --- test/list-devices | 34 ++++++++++++++++++++-------------- test/monitor-manager | 2 +- test/monitor-services | 2 +- test/test-manager | 14 ++++++++++++-- 4 files changed, 34 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/list-devices b/test/list-devices index 61d8bbcf..78c319b3 100755 --- a/test/list-devices +++ b/test/list-devices @@ -9,21 +9,27 @@ manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), properties = manager.GetProperties() -for path in properties["Devices"]: - device = dbus.Interface(bus.get_object("org.moblin.connman", path), - "org.moblin.connman.Device") +for path in properties["Technologies"]: + technology = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Technology") - properties = device.GetProperties() + properties = technology.GetProperties() - print "[ %s ]" % (path) + for path in properties["Devices"]: + device = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Device") - 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) + properties = device.GetProperties() - print + 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 diff --git a/test/monitor-manager b/test/monitor-manager index a6192421..82ca805b 100755 --- a/test/monitor-manager +++ b/test/monitor-manager @@ -6,7 +6,7 @@ import dbus import dbus.mainloop.glib def property_changed(name, value): - if name in ["Profiles", "Services", "Providers", + if name in ["Profiles", "Services", "Providers", "Technologies", "Devices", "Networks"]: val = "[" for i in value: diff --git a/test/monitor-services b/test/monitor-services index c435a34a..7d654471 100755 --- a/test/monitor-services +++ b/test/monitor-services @@ -10,7 +10,7 @@ def property_changed(name, value, path, interface): ipath = path[path.rfind("/") + 1:] if iface not in ["Service"]: return - if name in ["Profiles", "Services", "Providers", + if name in ["Profiles", "Services", "Providers", "Technologies", "Devices", "Networks"]: val = "[" for i in value: diff --git a/test/test-manager b/test/test-manager index a41d6570..6f9c2004 100755 --- a/test/test-manager +++ b/test/test-manager @@ -18,6 +18,8 @@ def print_properties(key, value): interface = "org.moblin.connman.Service" elif key == "Providers": interface = "org.moblin.connman.Provider" + elif key == "Technologies": + interface = "org.moblin.connman.Technology" else: return @@ -30,7 +32,8 @@ def print_properties(key, value): properties = obj.GetProperties() for key in properties.keys(): - if key in ["Networks", "Services", "Providers"]: + if key in ["Devices", "Networks", "Services", + "Providers", "Technologies"]: continue if key in ["Powered", "Scanning", "Connected", @@ -46,6 +49,12 @@ def print_properties(key, value): print " %s = %s" % (key, val) + if "Devices" in properties.keys(): + list = "" + for path in properties["Devices"]: + val = str(path) + list = list + val[val.rfind("/") + 1:] + " " + print " Devices = [ %s]" % (list) if "Networks" in properties.keys(): list = "" for path in properties["Networks"]: @@ -67,7 +76,8 @@ def print_properties(key, value): for key in properties.keys(): - if key in ["Profiles", "Devices", "Services", "Providers"]: + if key in ["Profiles", "Devices", "Services", "Providers", + "Technologies"]: print_properties(key, properties[key]) elif key in ["AvailableTechnologies", "EnabledTechnologies", "ConnectedTechnologies", -- cgit v1.2.3