From b530bfa969ba35511a206dd2aca3e6bd0d4d0aea Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 26 Feb 2008 07:17:53 +0100 Subject: [PATCH] Add example for starting scanning --- test/Makefile.am | 2 +- test/start-scanning | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 test/start-scanning diff --git a/test/Makefile.am b/test/Makefile.am index 0649dab..ca88b98 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST = list-interfaces +EXTRA_DIST = list-interfaces start-scanning MAINTAINERCLEANFILES = Makefile.in diff --git a/test/start-scanning b/test/start-scanning new file mode 100755 index 0000000..712b3e9 --- /dev/null +++ b/test/start-scanning @@ -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 " Started scanning" + interface.Scan() + else: + print " No scanning" + + print -- 2.7.4