Don't attempt scanning if device is switched off
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 4 Jan 2009 19:52:07 +0000 (20:52 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 4 Jan 2009 19:52:07 +0000 (20:52 +0100)
src/device.c

index e63b8d2..f481175 100644 (file)
@@ -393,6 +393,9 @@ static DBusMessage *propose_scan(DBusConnection *conn,
        if (!device->driver || !device->driver->scan)
                return __connman_error_not_supported(msg);
 
+       if (device->powered == FALSE)
+               return __connman_error_failed(msg);
+
        err = device->driver->scan(device);
        if (err < 0)
                return __connman_error_failed(msg);