From: Marcel Holtmann Date: Mon, 15 Dec 2008 07:50:11 +0000 (+0100) Subject: Add script for selecting connections X-Git-Tag: 0.4~5 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=f457515a077ff1946ec5ab00635c47a2a40bab8a;p=connman Add script for selecting connections --- 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))