diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-12-15 08:50:11 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-12-15 08:50:11 +0100 |
commit | f457515a077ff1946ec5ab00635c47a2a40bab8a (patch) | |
tree | b3954215047e5d70892e41dac5380efe7ea74aae /test | |
parent | 93ee679d1e82bbc875130e077f8558230b8d4b29 (diff) | |
download | connman-f457515a077ff1946ec5ab00635c47a2a40bab8a.tar.gz connman-f457515a077ff1946ec5ab00635c47a2a40bab8a.tar.bz2 connman-f457515a077ff1946ec5ab00635c47a2a40bab8a.zip |
Add script for selecting connections
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rwxr-xr-x | test/select-connection | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index e4ea64f7..2087e881 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 00000000..34d1f93c --- /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)) |