Add example for starting scanning
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 26 Feb 2008 06:17:53 +0000 (07:17 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 26 Feb 2008 06:17:53 +0000 (07:17 +0100)
test/Makefile.am
test/start-scanning [new file with mode: 0755]

index 0649dab..ca88b98 100644 (file)
@@ -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 (executable)
index 0000000..712b3e9
--- /dev/null
@@ -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