Add script for seleting networks
[connman] / test / start-scanning
1 #!/usr/bin/python
2
3 import dbus
4
5 bus = dbus.SystemBus()
6
7 manager = dbus.Interface(bus.get_object('org.freedesktop.connman', "/"),
8                                         'org.freedesktop.connman.Manager')
9
10 interfaces = manager.ListInterfaces()
11
12 for path in interfaces:
13         print "[ %s ]" % (path)
14
15         interface = dbus.Interface(bus.get_object('org.freedesktop.connman', path),
16                                         'org.freedesktop.connman.Interface')
17
18         properties = interface.GetProperties()
19
20         if (properties["Type"] == "80211"):
21                 print "   Started scanning"
22                 interface.Scan()
23         else:
24                 print "   No scanning"
25
26         print