Add support for newlink and dellink callbacks
[connman] / test / start-scanning
index 712b3e9..ff0dd07 100755 (executable)
@@ -4,22 +4,28 @@ import dbus
 
 bus = dbus.SystemBus()
 
-manager = dbus.Interface(bus.get_object('org.freedesktop.connman', "/"),
-                                       'org.freedesktop.connman.Manager')
+manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"),
+                                       'org.moblin.connman.Manager')
 
-interfaces = manager.ListInterfaces()
+elements = manager.ListElements()
 
-for path in interfaces:
-       print "[ %s ]" % (path)
+for path in elements:
+       element = dbus.Interface(bus.get_object('org.moblin.connman', path),
+                                               'org.moblin.connman.Element')
+
+       properties = element.GetProperties()
 
-       interface = dbus.Interface(bus.get_object('org.freedesktop.connman', path),
-                                       'org.freedesktop.connman.Interface')
+       if (properties["Type"] != "device"):
+               continue
 
-       properties = interface.GetProperties()
+       print "[ %s ]" % (path)
 
-       if (properties["Type"] == "80211"):
-               print "   Started scanning"
-               interface.Scan()
+       if (properties["Subtype"] == "wifi"):
+               print "   Started WiFi scanning"
+               element.Update()
+       elif (properties["Subtype"] == "wimax"):
+               print "   Started WiMAX scanning"
+               element.Update()
        else:
                print "   No scanning"