From f457515a077ff1946ec5ab00635c47a2a40bab8a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 15 Dec 2008 08:50:11 +0100 Subject: [PATCH] Add script for selecting connections --- test/Makefile.am | 2 +- test/select-connection | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 test/select-connection diff --git a/test/Makefile.am b/test/Makefile.am index e4ea64f..2087e88 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,5 +1,5 @@ -EXTRA_DIST = get-state list-profiles list-connections \ +EXTRA_DIST = get-state list-profiles list-connections select-connection \ list-devices enable-device disable-device start-scanning \ list-networks select-network disable-network create-network \ set-passphrase simple-agent show-introspection \ diff --git a/test/select-connection b/test/select-connection new file mode 100755 index 0000000..34d1f93 --- /dev/null +++ b/test/select-connection @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + +properties = manager.GetProperties() + +for path in properties["Connections"]: + connection = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Connection") + + properties = connection.GetProperties() + + if (properties["Default"] == dbus.Boolean(1)): + continue + + print "[ %s ]" % (path) + + connection.SetProperty("Default", dbus.Boolean(1)) -- 2.7.4