From: Marcel Holtmann Date: Fri, 4 Apr 2008 06:12:26 +0000 (+0200) Subject: Add script for seleting networks X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~4863 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b7adf27379eb4652c650a8882333c77e9d1a07b;p=profile%2Fivi%2Fconnman.git Add script for seleting networks --- diff --git a/test/Makefile.am b/test/Makefile.am index 0276029..21ceba6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,5 +1,5 @@ -EXTRA_DIST = list-interfaces start-scanning simple-agent \ - show-introspection test-supplicant +EXTRA_DIST = list-interfaces start-scanning select-network simple-agent \ + show-introspection test-supplicant MAINTAINERCLEANFILES = Makefile.in diff --git a/test/select-network b/test/select-network new file mode 100755 index 0000000..0d48ad3 --- /dev/null +++ b/test/select-network @@ -0,0 +1,26 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object('org.freedesktop.connman', "/"), + 'org.freedesktop.connman.Manager') + +interfaces = manager.ListInterfaces() + +for path in interfaces: + print "[ %s ]" % (path) + + interface = dbus.Interface(bus.get_object('org.freedesktop.connman', path), + 'org.freedesktop.connman.Interface') + + properties = interface.GetProperties() + + if (properties["Type"] == "80211"): + print " Selecting network" + interface.SelectNetwork("ConnMan Testing") + else: + print " No networks" + + print