Fixed the defect TPLDPCLER-380
authorhwajeong.son <hwajeong.son@samsung.com>
Mon, 1 Oct 2018 10:47:54 +0000 (19:47 +0900)
committerhwajeong.son <hwajeong.son@samsung.com>
Mon, 1 Oct 2018 10:47:54 +0000 (19:47 +0900)
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

src/setup_network.c

index 15161ee9a82774a94a1ae9a9fcd9ffca5bb53d61..37d1d71c160bc7c9978414d1cef6a96f063da6d5 100755 (executable)
@@ -326,7 +326,10 @@ static int __wifi_connect_main(sa_wifi_s * info)
 
                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;
                }