[ITC][wifi][Non-ACR][Do not WifiPreConnectCondition() if AP is connected]
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 16 Oct 2017 05:28:22 +0000 (14:28 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 16 Oct 2017 05:28:48 +0000 (14:28 +0900)
Change-Id: Ib68b62243a9fc3c34ef56534eb70508bbfc37c99
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
src/itc/wifi/ITs-wifi-common.c
src/itc/wifi/ITs-wifi-manager.c

index ead5a440788979668a55b8e3f89380a89e6d0d62..68fa599deabc86e4b2980111cad8cf7237eca254 100755 (executable)
@@ -494,8 +494,22 @@ bool WifiPreConnectCondition()
 
        int nWifiTimeoutId = -1;
        bool bIsActive = false;
+       wifi_ap_h connectedAPHandle;
 
-       int nRet = wifi_is_activated(&bIsActive);
+       int nRet = wifi_get_connected_ap(&connectedAPHandle);
+       if (nRet == WIFI_ERROR_NONE) {
+               FPRINTF("[Line : %d][%s] AP is already connected.\\n", __LINE__, API_NAMESPACE);
+               nRet = wifi_ap_clone(&g_pWifiAPHandle, connectedAPHandle);
+               if ( (nRet == WIFI_ERROR_NONE) && (g_pWifiAPHandle != NULL) )
+               {
+                       wifi_ap_destroy(connectedAPHandle);
+                       return true;
+               }
+               wifi_ap_destroy(connectedAPHandle);
+               return false;
+       }
+
+       nRet = wifi_is_activated(&bIsActive);
        if ( bIsActive != true )
        {
                g_bWifiCb = false;
index 78a6672187c393435e8c2dcf55656d04b3044425..b1d152b40c59f2ada1fb250286ae43a18c9d37a3 100755 (executable)
@@ -583,10 +583,6 @@ int ITc_wifi_connect_disconnect_p(void)
                wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
                return 1;
        }
-// Done as per suggestion from connectivity team,
-// as calling wifi_forget_ap(), before wifi_disconnect() is not logical.
-       nRet = wifi_forget_ap(g_pWifiAPHandle);
-       PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
 
 //Done to avoid disconnect after complete execution
        g_bCheckCb = false;