Add test script for retrieving proxy auto-configuration
[framework/connectivity/connman.git] / 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.moblin.connman', "/"),
8                                         'org.moblin.connman.Manager')
9
10 properties = manager.GetProperties()
11
12 for path in properties["Technologies"]:
13         technology = dbus.Interface(bus.get_object('org.moblin.connman', path),
14                                                 'org.moblin.connman.Technology')
15         properties = technology.GetProperties()
16
17         print "[ %s ]" % (path)
18
19         if properties["Type"] in ["wifi", "wimax"]:
20
21                 print "   Started scanning"
22
23                 for path in properties["Devices"]:
24                         device = dbus.Interface(bus.get_object('org.moblin.connman', path),
25                                                                 'org.moblin.connman.Device')
26                         try:
27                                 device.ProposeScan()
28                         except dbus.DBusException, error:
29                                 print "   %s: %s" % (error._dbus_error_name, error.message)
30         else:
31                 print "   No scanning"
32
33         print