Take reference when network is connected and assigned to device
[connman] / test / select-network
index b5a0259..376d9d2 100755 (executable)
@@ -21,7 +21,7 @@ for path in properties["Devices"]:
        properties = device.GetProperties()
 
        if (properties["Type"] != "wifi" and properties["Type"] != "wimax"):
-               continue;
+               continue
 
        print "[ %s ]" % (path)
 
@@ -31,9 +31,12 @@ for path in properties["Devices"]:
 
                properties = network.GetProperties()
 
+               if "Name" not in properties.keys():
+                       continue
+
                if (properties["Connected"] == dbus.Boolean(1)):
                        continue
 
-               if (properties["WiFi.Name"] == sys.argv[1]):
+               if (properties["Name"] == sys.argv[1]):
                        print "Connecting %s" % (path)
                        network.Connect()