char *netpath;
gboolean created;
enum supplicant_state state;
+ gboolean doscan;
GSList *scan_results;
};
path = g_slist_nth_data(task->scan_results, 0);
if (path == NULL) {
- connman_device_set_scanning(task->device, FALSE);
+ if (task->doscan == FALSE)
+ connman_device_set_scanning(task->device, FALSE);
return 0;
}
reply = dbus_pending_call_steal_reply(call);
if (reply == NULL) {
- connman_device_set_scanning(task->device, FALSE);
+ if (task->doscan == FALSE)
+ connman_device_set_scanning(task->device, FALSE);
return;
}
dbus_error_free(&error);
} else
connman_error("Wrong arguments for scan result");
- connman_device_set_scanning(task->device, FALSE);
+ if (task->doscan == FALSE)
+ connman_device_set_scanning(task->device, FALSE);
goto done;
}
else if (g_str_equal(state, "DISCONNECTED") == TRUE)
task->state = STATE_DISCONNECTED;
- if (task->state == STATE_SCANNING)
+ if (task->state == STATE_SCANNING) {
+ task->doscan = TRUE;
connman_device_set_scanning(task->device, TRUE);
+ } else if (task->state == STATE_INACTIVE) {
+ task->doscan = FALSE;
+ connman_device_set_scanning(task->device, FALSE);
+ }
if (task->network == NULL)
return;