Set the devices offline mode to FALSE when setting the Powered property
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 8 Sep 2010 17:23:51 +0000 (19:23 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 8 Sep 2010 18:06:22 +0000 (20:06 +0200)
src/device.c

index db24f95..8976236 100644 (file)
@@ -218,13 +218,20 @@ int __connman_device_enable(struct connman_device *device)
 
        err = device->driver->enable(device);
        if (err < 0) {
-               if (err == -EINPROGRESS)
+               if (err == -EINPROGRESS) {
                        device->powered_pending = TRUE;
+                       device->offlinemode = FALSE;
+                       if (__connman_profile_get_offlinemode() == TRUE)
+                               __connman_profile_set_offlinemode(FALSE, FALSE);
+               }
                return err;
        }
 
        device->powered_pending = TRUE;
        device->powered = TRUE;
+       device->offlinemode = FALSE;
+       if (__connman_profile_get_offlinemode() == TRUE)
+               __connman_profile_set_offlinemode(FALSE, FALSE);
 
        __connman_technology_enable_device(device);