Ask for DEVICE_TYPE_WIFI when looking for a WiFi device
authorSamuel Ortiz <sameo@linux.intel.com>
Sat, 19 Dec 2009 00:42:29 +0000 (01:42 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 19 Dec 2009 01:04:37 +0000 (17:04 -0800)
The __connman_element_find_device(CONNMAN_SERVICE_TYPE_WIFI) was working
fine while SERVICE_TYPE_WIFI and DEVICE_TYPE_WIFI were equal. With the
introduction of CONNMAN_SERVICE_TYPE_SYSTEM, this last assertion is no
longer true, breaking the service API for connection.

src/service.c

index 2adeb86..e359cf4 100644 (file)
@@ -1855,7 +1855,7 @@ int __connman_service_create_and_connect(DBusMessage *msg)
                                g_strcmp0(security, "rsn") != 0)
                return -EINVAL;
 
-       device = __connman_element_find_device(CONNMAN_SERVICE_TYPE_WIFI);
+       device = __connman_element_find_device(CONNMAN_DEVICE_TYPE_WIFI);
        if (device == NULL)
                return -EOPNOTSUPP;