From 9d8ce77ab4d43c5fffb008e99c15b242b1c32153 Mon Sep 17 00:00:00 2001 From: "hwajeong.son" Date: Mon, 1 Oct 2018 19:47:54 +0900 Subject: [PATCH] Fixed the defect TPLDPCLER-380 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/setup_network.c b/src/setup_network.c index 15161ee..37d1d71 100755 --- a/src/setup_network.c +++ b/src/setup_network.c @@ -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; } -- 2.34.1