wifi connection is not established if wifi is already activated.
Wifi has steps to connect, before connection, it has to be activated.
If the device is activated and not connected, it would be return 'alreay
exists'. Therefore it must cover to deal with
rv = wifi_manager_set_device_state_changed_cb(wifi_h, __wifi_state_changed_cb, (void *)&wifi_data);
rv = wifi_manager_activate(wifi_h, __wifi_activate_cb, NULL);
- if (rv != WIFI_MANAGER_ERROR_NONE) {
+ if (rv == WIFI_MANAGER_ERROR_ALREADY_EXISTS) {
+ _D("wifi_manager_active alreay exists");
+ wifi_manager_scan(wifi_h, __wifi_scan_finished_cb, (void *)&wifi_data);
+ } else if (rv != WIFI_MANAGER_ERROR_NONE) {
_E("wifi_manager_activated failed.[%s]", __print_wifi_error(rv));
return SA_ERROR_UNKNOWN;
}