if ( nRet == WIFI_ERROR_NONE )
{
-#if DEBUG
+ #if DEBUG
FPRINTF("[Line : %d][%s] wifi_initialize passed\\n", __LINE__, API_NAMESPACE);
-#endif
-
- g_bWifiInitialization = true;
- nRet = wifi_is_activated(&bIsActive);
- if ( bIsActive == true )
- {
- FPRINTF("[Line : %d][%s] wifi already activated, no need to activate again\\n", __LINE__, API_NAMESPACE);
- g_bWifiInit = true;
- return;
- }
-
- g_bCheckCb = false;
- nRet = wifi_activate(WifiActivatedCallback, NULL);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- g_bWifiInit = false;
- return;
- }
- RUN_POLLING_LOOP;
-
- // wifi_activate is an asynchronous api, activation will happen in other thread so waiting
- if ( g_bCheckCb )
- {// NO checking for return value as activate can return busy state
- g_bWifiInit = true;
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_activate passed on startup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed on startup, error returned = callback not invoked, Returned value = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- wifi_deinitialize();
- }
+ #endif
+ g_bWifiInitialization = true;
}
else
{
#endif
int nRet = 0;
- if ( g_bWifiInit )
- {
- int nWifiTimeoutId = -1;
- if ( g_pWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWifiAPHandle = NULL;
- }
-
- if ( g_pEapWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pEapWifiAPHandle = NULL;
- }
-
- if ( g_pWpsPublicWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWpsPublicWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWpsPublicWifiAPHandle = NULL;
- }
-
- bool bIsActivate = false;
- nRet = wifi_is_activated(&bIsActivate);
- if (bIsActivate == true)
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_is_activated passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback,NULL);
- RUN_POLLING_LOOP;
-
- if ( nRet == WIFI_ERROR_NONE )
- {
- if ( g_bCheckCb )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deactivate passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
- }
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- }
-
- nRet = wifi_deinitialize();
- if ( nRet == WIFI_ERROR_NONE )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deinitialize passed\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deinitialize failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- FREE_MEMORY(g_pszESSID);
- return;
- }
if(g_bWifiInitialization)
{
FPRINTF("[Line : %d][%s] wifi_deinitialize failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
}
}
+
}
and ignore the return type */
int nWifiTimeoutId = -1;
+
+ wifi_forget_ap(g_pWifiAPHandle);
wifi_disconnect(g_pWifiAPHandle, WiFiDisconnectCallabck, NULL);
g_bCheckCb = false;
int nRet = wifi_scan(WifiScanRequestCallback, NULL);
RUN_POLLING_LOOP;
+
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+
if ( nRet != WIFI_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] wifi_scan failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
return true;
}
-
-
-
-
-
-
//& purpose: To check initialization/de-initialization of wifi
//& type : auto
/**
and ignore the return type */
int nWifiTimeoutId = -1;
+
+ wifi_forget_ap(g_pWifiAPHandle);
wifi_disconnect(g_pWifiAPHandle, WiFiDisconnectCallabck, NULL);
+
g_bCheckCb = false;
- int nRet = wifi_scan(WifiScanRequestCallback, NULL);
+ bool bIsActive = false;
+
+ int nRet = wifi_is_activated(&bIsActive);
+ if ( bIsActive != true )
+ {
+ g_bCheckCb = false;
+ nRet = wifi_activate(WifiActivatedCallback, NULL);
+ if ( nRet != WIFI_ERROR_NONE )
+ {
+ FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+ return false;
+ }
+ RUN_POLLING_LOOP;
+ if ( !g_bCheckCb )
+ {
+ FPRINTF("[Line : %d][%s] WifiActivatedCallback = callback function not invoked\\n", __LINE__, API_NAMESPACE);
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+
+ return false;
+ }
+ }
+
+ nWifiTimeoutId = -1;
+
+ nRet = wifi_scan(WifiScanRequestCallback, NULL);
RUN_POLLING_LOOP;
if ( nRet != WIFI_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] wifi_scan failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
return false;
}
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
if ( !g_bCheckCb )
{
FPRINTF("[Line : %d][%s] wifi_scan failed inside WifiPreConnectCondition, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
return false;
}
+
+ nWifiTimeoutId = -1;
g_bForEachCb = false;
nRet = wifi_foreach_found_aps(WifiFoundAPCallback, NULL);
RUN_POLLING_LOOP;
and ignore the return type */
int nWifiTimeoutId = -1;
+
+ wifi_forget_ap(g_pWifiAPHandle);
wifi_disconnect(g_pWifiAPHandle, WiFiDisconnectCallabck, NULL);
+
g_bCheckCb = false;
- int nRet = wifi_scan(WifiScanRequestCallback, NULL);
+ bool bIsActive = false;
+
+ int nRet = wifi_is_activated(&bIsActive);
+ if ( bIsActive != true )
+ {
+ g_bCheckCb = false;
+ nRet = wifi_activate(WifiActivatedCallback, NULL);
+ if ( nRet != WIFI_ERROR_NONE )
+ {
+ FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+
+ return false;
+ }
+ }
+
+ nRet = wifi_scan(WifiScanRequestCallback, NULL);
RUN_POLLING_LOOP;
if ( nRet != WIFI_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] wifi_scan failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+
return false;
}
+
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+
if ( !g_bCheckCb )
{
FPRINTF("[Line : %d][%s] wifi_scan failed inside WifiPreConnectCondition, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
and ignore the return type */
int nWifiTimeoutId = -1;
+
+ wifi_forget_ap(g_pWifiAPHandle);
wifi_disconnect(g_pWifiAPHandle, WiFiDisconnectCallabck, NULL);
+
g_bCheckCb = false;
- int nRet = wifi_scan(WifiScanRequestCallback, NULL);
+ bool bIsActive = false;
+
+ int nRet = wifi_is_activated(&bIsActive);
+ if ( bIsActive != true )
+ {
+ g_bCheckCb = false;
+ nRet = wifi_activate(WifiActivatedCallback, NULL);
+ if ( nRet != WIFI_ERROR_NONE )
+ {
+ FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+
+ return false;
+ }
+ }
+
+ nRet = wifi_scan(WifiScanRequestCallback, NULL);
RUN_POLLING_LOOP;
if ( nRet != WIFI_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] wifi_scan failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+
return false;
}
+ //Done to avoid disconnect after complete execution
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+
if ( !g_bCheckCb )
{
FPRINTF("[Line : %d][%s] wifi_scan failed inside WifiPreConnectConditionForEAP, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
FPRINTF("[Line : %d] [wifi_ITC] wifi feature not supported, Leaving test\\n", __LINE__);\
return 0;\
}\
- if ( !g_bWifiInit )\
+}
+
+/*
+if ( !g_bWifiInit )\
{\
FPRINTF("[Line : %d] [wifi_ITC] Precondition of wifi failed\\n", __LINE__);\
return 1;\
}\
-}
+*/
#define CHECK_ACCESS_POINT(Handle) {\
if ( Handle == NULL )\
FPRINTF("[Line : %d][%s] wifi_initialize passed\\n", __LINE__, API_NAMESPACE);
#endif
- g_bWifiInitialization = true;
- nRet = wifi_is_activated(&bIsActive);
- if ( bIsActive == true )
- {
- FPRINTF("[Line : %d][%s] wifi already activated, no need to activate again\\n", __LINE__, API_NAMESPACE);
- g_bWifiInit = true;
- return;
- }
-
- g_bCheckCb = false;
- nRet = wifi_activate(WifiActivatedCallback, NULL);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- g_bWifiInit = false;
- return;
- }
- RUN_POLLING_LOOP;
-
- // wifi_activate is an asynchronous api, activation will happen in other thread so waiting
- if ( g_bCheckCb )
- {// NO checking for return value as activate can return busy state
- g_bWifiInit = true;
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_activate passed on startup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed on startup, error returned = callback not invoked, Returned value = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- wifi_deinitialize();
- }
+ g_bWifiInitialization = true;
}
else
{
#endif
int nRet = 0;
- if ( g_bWifiInit )
- {
- int nWifiTimeoutId = -1;
- if ( g_pWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWifiAPHandle = NULL;
- }
-
- if ( g_pEapWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pEapWifiAPHandle = NULL;
- }
-
- bool bIsActivate = false;
- nRet = wifi_is_activated(&bIsActivate);
- if (bIsActivate == true)
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_is_activated passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback,NULL);
- RUN_POLLING_LOOP;
-
- if ( nRet == WIFI_ERROR_NONE )
- {
- if ( g_bCheckCb )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deactivate passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
- }
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- }
-
- nRet = wifi_deinitialize();
- if ( nRet == WIFI_ERROR_NONE )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deinitialize passed\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deinitialize failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- FREE_MEMORY(g_pszESSID);
- return;
- }
-
+
if(g_bWifiInitialization)
{
nRet = wifi_deinitialize();
FPRINTF("[Line : %d][%s] wifi_initialize passed\\n", __LINE__, API_NAMESPACE);
#endif
- g_bWifiInitialization = true;
- nRet = wifi_is_activated(&bIsActive);
- if ( bIsActive == true )
- {
- FPRINTF("[Line : %d][%s] wifi already activated, no need to activate again\\n", __LINE__, API_NAMESPACE);
- g_bWifiInit = true;
- return;
- }
-
- g_bCheckCb = false;
- nRet = wifi_activate(WifiActivatedCallback, NULL);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- g_bWifiInit = false;
- return;
- }
- RUN_POLLING_LOOP;
-
- // wifi_activate is an asynchronous api, activation will happen in other thread so waiting
- if ( g_bCheckCb )
- {// NO checking for return value as activate can return busy state
- g_bWifiInit = true;
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_activate passed on startup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed on startup, error returned = callback not invoked, Returned value = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- wifi_deinitialize();
- }
+ g_bWifiInitialization = true;
}
else
{
#endif
int nRet = 0;
- if ( g_bWifiInit )
- {
- int nWifiTimeoutId = -1;
- if ( g_pWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWifiAPHandle = NULL;
- }
-
- if ( g_pEapWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pEapWifiAPHandle = NULL;
- }
-
- if ( g_pWpsPublicWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWpsPublicWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWpsPublicWifiAPHandle = NULL;
- }
-
- bool bIsActivate = false;
- nRet = wifi_is_activated(&bIsActivate);
- if (bIsActivate == true)
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_is_activated passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback,NULL);
- RUN_POLLING_LOOP;
-
- if ( nRet == WIFI_ERROR_NONE )
- {
- if ( g_bCheckCb )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deactivate passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
- }
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- }
-
- nRet = wifi_deinitialize();
- if ( nRet == WIFI_ERROR_NONE )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deinitialize passed\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deinitialize failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- FREE_MEMORY(g_pszESSID);
- return;
- }
-
+
if(g_bWifiInitialization)
{
nRet = wifi_deinitialize();
FPRINTF("[Line : %d][%s] wifi_initialize passed\\n", __LINE__, API_NAMESPACE);
#endif
- g_bWifiInitialization = true;
- nRet = wifi_is_activated(&bIsActive);
- if ( bIsActive == true )
- {
- FPRINTF("[Line : %d][%s] wifi already activated, no need to activate again\\n", __LINE__, API_NAMESPACE);
- g_bWifiInit = true;
- return;
- }
-
- g_bCheckCb = false;
- nRet = wifi_activate(WifiActivatedCallback, NULL);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- g_bWifiInit = false;
- return;
- }
- RUN_POLLING_LOOP;
-
- // wifi_activate is an asynchronous api, activation will happen in other thread so waiting
- if ( g_bCheckCb )
- {// NO checking for return value as activate can return busy state
- g_bWifiInit = true;
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_activate passed on startup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed on startup, error returned = callback not invoked, Returned value = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- wifi_deinitialize();
- }
+ g_bWifiInitialization = true;
}
else
{
#endif
int nRet = 0;
- if ( g_bWifiInit )
- {
- int nWifiTimeoutId = -1;
- if ( g_pWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWifiAPHandle = NULL;
- }
-
- if ( g_pEapWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pEapWifiAPHandle = NULL;
- }
-
- if ( g_pWpsPublicWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWpsPublicWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWpsPublicWifiAPHandle = NULL;
- }
-
- bool bIsActivate = false;
- nRet = wifi_is_activated(&bIsActivate);
- if (bIsActivate == true)
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_is_activated passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback,NULL);
- RUN_POLLING_LOOP;
-
- if ( nRet == WIFI_ERROR_NONE )
- {
- if ( g_bCheckCb )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deactivate passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
- }
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- }
-
- nRet = wifi_deinitialize();
- if ( nRet == WIFI_ERROR_NONE )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deinitialize passed\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deinitialize failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- FREE_MEMORY(g_pszESSID);
- return;
- }
if(g_bWifiInitialization)
{
}
-
-
-
-
-
-
-
//& purpose: To check activation/deactivation of wifi
//& type : auto
/**
// As we have already activated in startup and here target is activated, so deactivating first
int nRet = wifi_is_activated(&bIsActive);
- PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_is_activated", WifiGetError(nRet));
- if ( bIsActive == true )
+ if ( bIsActive != true )
{
g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback, NULL);
- RUN_POLLING_LOOP;
- PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_deactivate", WifiGetError(nRet));
- if ( g_bCheckCb )
+ nRet = wifi_activate(WifiActivatedCallback, NULL);
+ if ( nRet != WIFI_ERROR_NONE )
{
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deactivate passed\\n", __LINE__, API_NAMESPACE);
-#endif
+ FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+ return 1;
}
- else
+ RUN_POLLING_LOOP;
+ if ( !g_bCheckCb )
{
- FPRINTF("[Line : %d][%s] wifi_deactivate failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
+ FPRINTF("[Line : %d][%s] WifiActivatedCallback = callback function not invoked\\n", __LINE__, API_NAMESPACE);
return 1;
}
}
- else
- {
- FPRINTF("[Line : %d][%s] wifi is already deactivated\\n", __LINE__, API_NAMESPACE);
- }
-
- nRet = wifi_activate(WifiActivatedCallback, NULL);
- RUN_POLLING_LOOP;
- PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_activate", WifiGetError(nRet));
- if ( !g_bCheckCb )
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
- wifi_deactivate(WifiDeActivatedCallback, NULL);
- return 1;
- }
g_bCheckCb = false;
nRet = wifi_deactivate(WifiDeActivatedCallback, NULL);
RUN_POLLING_LOOP;
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_deactivate", WifiGetError(nRet));
- if ( !g_bCheckCb )
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
- wifi_deactivate(WifiDeActivatedCallback, NULL);
- return 1;
- }
-
+
/* As deactivation takes place in cleanup, which is common for all test cases activate wifi again
but will not consider its result to determine pass or failure */
nRet = wifi_is_activated(&bIsActive);
FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
}
}
+
+ //temp
+ if ( !g_bCheckCb )
+ {
+ FPRINTF("[Line : %d][%s] wifi_deactivate failed, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
+ wifi_deactivate(WifiDeActivatedCallback, NULL);
+ return 1;
+ }
return 0;
}
//& purpose: Gets the handle of the connected access point
//& type : auto
/**
-* @testcase ITc_wifi_get_connected_ap_p
+* @testcase ITc_wifi_get_connected_forget_ap_p
* @type auto
* @author SRID(saurabh.s9)
* @reviewer SRID(gupta.sanjay)
* @precondition wifi should be initialised and activated, access point name of AP should be updated in the header file with macro ACCESSPOINTNAME
* @postcondition none
*/
-int ITc_wifi_get_connected_ap_p(void)
+int ITc_wifi_get_connected_forget_ap_p(void)
{
START_TEST;
if ( !g_bCheckCb )
{
FPRINTF("[Line : %d][%s] wifi_connect failed, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
- wifi_forget_ap(g_pWifiAPHandle);
return 1;
}
nRet = wifi_get_connected_ap(&pApHandle);//target api
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_get_connected_ap", WifiGetError(nRet), wifi_forget_ap(g_pWifiAPHandle));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_get_connected_ap", WifiGetError(nRet));
if ( NULL == pApHandle )
{
- FPRINTF("[Line : %d][%s] wifi_get_connected_ap failed, for handle creation\\n", __LINE__, API_NAMESPACE);
- wifi_forget_ap(g_pWifiAPHandle);
+ FPRINTF("[Line : %d][%s] wifi_get_connected_ap failed, for handle creation\\n", __LINE__, API_NAMESPACE);
return 1;
}
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet),wifi_ap_destroy(g_pWifiAPHandle));
+ //Target API
+ nRet = wifi_forget_ap(pApHandle);
+ PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet),wifi_ap_destroy(pApHandle));
- nRet = wifi_ap_destroy(g_pWifiAPHandle);
+ nRet = wifi_ap_destroy(pApHandle);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_destroy", WifiGetError(nRet));
- g_pWifiAPHandle = NULL;
+ pApHandle = NULL;
return 0;
}
}
nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet), wifi_disconnect(g_pWifiAPHandle, WiFiDisconnectCallabck, NULL); FREE_MEMORY(pstrPassphrase));
+ PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet), FREE_MEMORY(pstrPassphrase));
g_bCheckCb = false;
nRet = wifi_disconnect(g_pWifiAPHandle, WiFiDisconnectCallabck, NULL);
RUN_POLLING_LOOP;
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_disconnect", WifiGetError(nRet), FREE_MEMORY(pstrPassphrase));
+ PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_disconnect", WifiGetError(nRet),wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL); FREE_MEMORY(pstrPassphrase));
if ( !g_bCheckCb )
{
FPRINTF("[Line : %d][%s] wifi_disconnect failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
+ wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
FREE_MEMORY(pstrPassphrase);
return 1;
}
-
+
+//Done to avoid disconnect after complete execution
+ g_bCheckCb = false;
+ nRet = wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
+ RUN_POLLING_LOOP;
+ PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_connect", WifiGetError(nRet), FREE_MEMORY(pstrPassphrase));
+ if ( !g_bCheckCb )
+ {
+ FPRINTF("[Line : %d][%s] wifi_connect returned no error but connected callback not invoked\\n", __LINE__, API_NAMESPACE);
+ }
+
FREE_MEMORY(pstrPassphrase);
return 0;
}
-
+#if 0
//& purpose: Deletes the information of stored access point and disconnects it when it connected
//& type : auto
return 0;
}
-
-
-
-
-#if 0
// WPS TCs moved to manual testing
//& purpose: connect the access point with WPS PBS asynchronously
//& type : auto
FPRINTF("[Line : %d][%s] wifi_initialize passed\\n", __LINE__, API_NAMESPACE);
#endif
- g_bWifiInitialization = true;
- nRet = wifi_is_activated(&bIsActive);
- if ( bIsActive == true )
- {
- FPRINTF("[Line : %d][%s] wifi already activated, no need to activate again\\n", __LINE__, API_NAMESPACE);
- g_bWifiInit = true;
- return;
- }
-
- g_bCheckCb = false;
- nRet = wifi_activate(WifiActivatedCallback, NULL);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- g_bWifiInit = false;
- return;
- }
- RUN_POLLING_LOOP;
-
- // wifi_activate is an asynchronous api, activation will happen in other thread so waiting
- if ( g_bCheckCb )
- {// NO checking for return value as activate can return busy state
- g_bWifiInit = true;
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_activate passed on startup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed on startup, error returned = callback not invoked, Returned value = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- wifi_deinitialize();
- }
+ g_bWifiInitialization = true;
}
else
{
#endif
int nRet = 0;
- if ( g_bWifiInit )
- {
- int nWifiTimeoutId = -1;
- if ( g_pWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWifiAPHandle = NULL;
- }
-
- if ( g_pEapWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pEapWifiAPHandle = NULL;
- }
-
- if ( g_pWpsPublicWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWpsPublicWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWpsPublicWifiAPHandle = NULL;
- }
-
- bool bIsActivate = false;
- nRet = wifi_is_activated(&bIsActivate);
- if (bIsActivate == true)
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_is_activated passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback,NULL);
- RUN_POLLING_LOOP;
-
- if ( nRet == WIFI_ERROR_NONE )
- {
- if ( g_bCheckCb )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deactivate passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
- }
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- }
-
- nRet = wifi_deinitialize();
- if ( nRet == WIFI_ERROR_NONE )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deinitialize passed\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deinitialize failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- FREE_MEMORY(g_pszESSID);
- return;
- }
if(g_bWifiInitialization)
{
int nRet = wifi_set_device_state_changed_cb(WifiDeviceStateChangeCallback, NULL);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_set_device_state_changed_cb", WifiGetError(nRet));
- g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback, NULL);
- RUN_POLLING_LOOP;
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_deactivate", WifiGetError(nRet), wifi_unset_device_state_changed_cb());
- if ( !g_bCheckCb )
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
- wifi_unset_device_state_changed_cb();
- return 1;
- }
+ // g_bCheckCb = false;
+ // nRet = wifi_deactivate(WifiDeActivatedCallback, NULL);
+ // RUN_POLLING_LOOP;
+ // PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_deactivate", WifiGetError(nRet), wifi_unset_device_state_changed_cb());
+ // if ( !g_bCheckCb )
+ // {
+ // FPRINTF("[Line : %d][%s] wifi_deactivate failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
+ // wifi_unset_device_state_changed_cb();
+ // return 1;
+ // }
nRet = wifi_unset_device_state_changed_cb();
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_unset_device_state_changed_cb", WifiGetError(nRet));
+
+ // wifi_activate(WifiActivatedCallback, NULL);
+
return 0;
}
//& purpose: To check register and unregister the callback called for background scan
nRet = wifi_unset_background_scan_cb();
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_unset_background_scan_cb", WifiGetError(nRet));
+
return 0;
}
}
nRet = wifi_unset_connection_state_changed_cb();
+
+
+ bool bIsActive = false;
+ int result = wifi_is_activated(&bIsActive);
+ if ( bIsActive != true )
+ {
+ g_bCheckCb = false;
+ result = wifi_activate(WifiActivatedCallback, NULL);
+ if ( result != WIFI_ERROR_NONE )
+ {
+ FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(result));
+ }
+ }
+
+ /*
+ * wifi_unset_device_state_changed_cb checked later to activate wifi if not activated.
+ */
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_unset_connection_state_changed_cb", WifiGetError(nRet));
+
return 0;
}
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_connect", WifiGetError(nRet));
RUN_POLLING_LOOP;
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_set_rssi_level_changed_cb", WifiGetError(nRet), wifi_forget_ap(g_pWifiAPHandle););
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_set_rssi_level_changed_cb", WifiGetError(nRet));
if ( !g_bCheckCb )
{
FPRINTF("[Line : %d][%s] wifi_set_rssi_level_changed_cb failed, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
- wifi_forget_ap(g_pWifiAPHandle);
+ // wifi_forget_ap(g_pWifiAPHandle);
wifi_unset_rssi_level_changed_cb();
return 1;
}
nRet = wifi_unset_rssi_level_changed_cb();
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_unset_rssi_level_changed_cb", WifiGetError(nRet));
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
+ //nRet = wifi_forget_ap(g_pWifiAPHandle);
+ //PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
return 0;
}
FPRINTF("[Line : %d][%s] wifi_initialize passed\\n", __LINE__, API_NAMESPACE);
#endif
- g_bWifiInitialization = true;
- nRet = wifi_is_activated(&bIsActive);
- if ( bIsActive == true )
- {
- FPRINTF("[Line : %d][%s] wifi already activated, no need to activate again\\n", __LINE__, API_NAMESPACE);
- g_bWifiInit = true;
- return;
- }
-
- g_bCheckCb = false;
- nRet = wifi_activate(WifiActivatedCallback, NULL);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- g_bWifiInit = false;
- return;
- }
- RUN_POLLING_LOOP;
-
- // wifi_activate is an asynchronous api, activation will happen in other thread so waiting
- if ( g_bCheckCb )
- {// NO checking for return value as activate can return busy state
- g_bWifiInit = true;
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_activate passed on startup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed on startup, error returned = callback not invoked, Returned value = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- wifi_deinitialize();
- }
+ g_bWifiInitialization = true;
}
else
{
#endif
int nRet = 0;
- if ( g_bWifiInit )
- {
- int nWifiTimeoutId = -1;
- if ( g_pWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWifiAPHandle = NULL;
- }
-
- if ( g_pEapWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pEapWifiAPHandle = NULL;
- }
-
- if ( g_pWpsPublicWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWpsPublicWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWpsPublicWifiAPHandle = NULL;
- }
-
- bool bIsActivate = false;
- nRet = wifi_is_activated(&bIsActivate);
- if (bIsActivate == true)
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_is_activated passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback,NULL);
- RUN_POLLING_LOOP;
-
- if ( nRet == WIFI_ERROR_NONE )
- {
- if ( g_bCheckCb )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deactivate passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
- }
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- }
-
- nRet = wifi_deinitialize();
- if ( nRet == WIFI_ERROR_NONE )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deinitialize passed\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deinitialize failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- FREE_MEMORY(g_pszESSID);
- return;
- }
if(g_bWifiInitialization)
{
}
nRet = wifi_ap_get_bssid(g_pWifiAPHandle, &pszBssid);//target api
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_get_bssid", WifiGetError(nRet),wifi_forget_ap(g_pWifiAPHandle));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_get_bssid", WifiGetError(nRet));
if ( pszBssid == NULL )
{
FPRINTF("[Line : %d][%s] wifi_ap_get_bssid failed, error returned = BSSID returned is NULL\\n", __LINE__, API_NAMESPACE);
- wifi_forget_ap(g_pWifiAPHandle);
+ //wifi_forget_ap(g_pWifiAPHandle);
return 1;
}
FREE_MEMORY(pszBssid);
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
+ //nRet = wifi_forget_ap(g_pWifiAPHandle);
+ //PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
return 0;
}
}
nRet = wifi_ap_get_rssi(g_pWifiAPHandle,&nRssi);//target api
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_get_rssi", WifiGetError(nRet), wifi_forget_ap(g_pWifiAPHandle));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_get_rssi", WifiGetError(nRet));
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
+ //nRet = wifi_forget_ap(g_pWifiAPHandle);
+ //PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
return 0;
}
}
nRet = wifi_ap_get_essid(g_pWifiAPHandle, &pszEssid);//target api
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_get_essid", WifiGetError(nRet), wifi_forget_ap(g_pWifiAPHandle));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_get_essid", WifiGetError(nRet));
if ( pszEssid == NULL )
{
FPRINTF("[Line : %d][%s] wifi_ap_get_essid failed, error returned = ESSID returned is NULL\\n", __LINE__, API_NAMESPACE);
- wifi_forget_ap(g_pWifiAPHandle);
+ //wifi_forget_ap(g_pWifiAPHandle);
return 1;
}
FREE_MEMORY(pszEssid);
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
+ //nRet = wifi_forget_ap(g_pWifiAPHandle);
+ //PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
return 0;
}
}
nRet = wifi_ap_get_frequency(g_pWifiAPHandle,&nFrequency);//target api
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_get_frequency", WifiGetError(nRet), wifi_forget_ap(g_pWifiAPHandle));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_get_frequency", WifiGetError(nRet));
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
+ //nRet = wifi_forget_ap(g_pWifiAPHandle);
+ //PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
return 0;
}
}
nRet = wifi_ap_get_max_speed(g_pWifiAPHandle,&nMaxSpeed);//target api
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_get_max_speed", WifiGetError(nRet), wifi_forget_ap(g_pWifiAPHandle));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_get_max_speed", WifiGetError(nRet));
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
+ //nRet = wifi_forget_ap(g_pWifiAPHandle);
+ //PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
return 0;
}
}
nRet = wifi_ap_is_passpoint(g_pWifiAPHandle, &bIsPasspoint);
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_is_passpoint", WifiGetError(nRet), wifi_forget_ap(g_pWifiAPHandle));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_is_passpoint", WifiGetError(nRet));
#if DEBUG
FPRINTF("[Line : %d][%s] wifi_ap_is_passpoint returned = %s\\n", __LINE__, API_NAMESPACE, bIsPasspoint == true ? "true" : "false");
#endif
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
+ //nRet = wifi_forget_ap(g_pWifiAPHandle);
+ //PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
return 0;
}
int nRet = wifi_ap_set_passphrase(g_pWifiAPHandle, pstrPassphrase);
PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_set_passphrase", WifiGetError(nRet), FREE_MEMORY(pstrPassphrase));
- FREE_MEMORY(pstrPassphrase);
+ FREE_MEMORY(pstrPassphrase);
nRet = wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL);
RUN_POLLING_LOOP;
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_connect", WifiGetError(nRet));
}
nRet = wifi_ap_get_connection_state(g_pWifiAPHandle, &state);//target api
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_get_connection_state", WifiGetError(nRet), wifi_forget_ap(g_pWifiAPHandle));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_get_connection_state", WifiGetError(nRet));
- nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
+ //nRet = wifi_forget_ap(g_pWifiAPHandle);
+ //PRINT_RESULT_NORETURN(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
return 0;
}
FPRINTF("[Line : %d][%s] wifi_initialize passed\\n", __LINE__, API_NAMESPACE);
#endif
- g_bWifiInitialization = true;
- nRet = wifi_is_activated(&bIsActive);
- if ( bIsActive == true )
- {
- FPRINTF("[Line : %d][%s] wifi already activated, no need to activate again\\n", __LINE__, API_NAMESPACE);
- g_bWifiInit = true;
- return;
- }
-
- g_bCheckCb = false;
- nRet = wifi_activate(WifiActivatedCallback, NULL);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- g_bWifiInit = false;
- return;
- }
- RUN_POLLING_LOOP;
-
- // wifi_activate is an asynchronous api, activation will happen in other thread so waiting
- if ( g_bCheckCb )
- {// NO checking for return value as activate can return busy state
- g_bWifiInit = true;
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_activate passed on startup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_activate failed on startup, error returned = callback not invoked, Returned value = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- wifi_deinitialize();
- }
+ g_bWifiInitialization = true;
}
else
{
#endif
int nRet = 0;
- if ( g_bWifiInit )
- {
- int nWifiTimeoutId = -1;
- if ( g_pWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWifiAPHandle = NULL;
- }
-
- if ( g_pEapWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pEapWifiAPHandle = NULL;
- }
-
- if ( g_pWpsPublicWifiAPHandle != NULL )
- {
- nRet = wifi_ap_destroy(g_pWpsPublicWifiAPHandle);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- g_pWpsPublicWifiAPHandle = NULL;
- }
-
- bool bIsActivate = false;
- nRet = wifi_is_activated(&bIsActivate);
- if (bIsActivate == true)
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_is_activated passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- g_bCheckCb = false;
- nRet = wifi_deactivate(WifiDeActivatedCallback,NULL);
- RUN_POLLING_LOOP;
-
- if ( nRet == WIFI_ERROR_NONE )
- {
- if ( g_bCheckCb )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deactivate passed on cleanup\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
- }
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deactivate failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- }
-
- nRet = wifi_deinitialize();
- if ( nRet == WIFI_ERROR_NONE )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] wifi_deinitialize passed\\n", __LINE__, API_NAMESPACE);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] wifi_deinitialize failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- }
- FREE_MEMORY(g_pszESSID);
- return;
- }
if(g_bWifiInitialization)
{
}
-
-
-
/** @addtogroup itc-wifi-testcases
* @brief Integration testcases for module wifi
* @ingroup itc-wifi
CHECK_ACCESS_POINT_CLEANUP(g_pWifiAPHandle, FREE_MEMORY(pszPassphrase));
wifi_ap_set_security_type(g_pWifiAPHandle, WIFI_SECURITY_TYPE_WPA2_PSK);
- bool b_isPassphraseRequired = false;
- int nRet = wifi_ap_is_passphrase_required(g_pWifiAPHandle, &b_isPassphraseRequired);
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_is_passphrase_required", WifiGetError(nRet), FREE_MEMORY(pszPassphrase));
- if ( !b_isPassphraseRequired )
- {
- FPRINTF("[Line : %d][%s] wifi_ap_is_passphrase_required returned false\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pszPassphrase);
- return 1;
- }
-
- nRet = wifi_ap_set_passphrase(g_pWifiAPHandle, pszPassphrase);//target api
+ int nRet = wifi_ap_set_passphrase(g_pWifiAPHandle, pszPassphrase);//target api
PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_set_passphrase", WifiGetError(nRet), FREE_MEMORY(pszPassphrase));
FREE_MEMORY(pszPassphrase);
return 0;
extern int ITc_wifi_get_mac_address_p(void);
extern int ITc_wifi_get_network_interface_name_p(void);
extern int ITc_wifi_scan_p(void);
-extern int ITc_wifi_get_connected_ap_p(void);
+extern int ITc_wifi_get_connected_forget_ap_p(void);
extern int ITc_wifi_foreach_found_aps_p(void);
extern int ITc_wifi_connect_disconnect_p(void);
-extern int ITc_wifi_forget_ap_p(void);
extern int ITc_wifi_get_connection_state_p(void);
extern int ITc_wifi_set_unset_device_state_changed_cb_p(void);
extern int ITc_wifi_set_unset_background_scan_cb_p(void);
{"ITc_wifi_get_mac_address_p", ITc_wifi_get_mac_address_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_get_network_interface_name_p", ITc_wifi_get_network_interface_name_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_scan_p", ITc_wifi_scan_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
- {"ITc_wifi_get_connected_ap_p", ITc_wifi_get_connected_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
+ {"ITc_wifi_get_connected_forget_ap_p", ITc_wifi_get_connected_forget_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_foreach_found_aps_p", ITc_wifi_foreach_found_aps_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_connect_disconnect_p", ITc_wifi_connect_disconnect_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
- {"ITc_wifi_forget_ap_p", ITc_wifi_forget_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_get_connection_state_p", ITc_wifi_get_connection_state_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
{"ITc_wifi_set_unset_device_state_changed_cb_p", ITc_wifi_set_unset_device_state_changed_cb_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
{"ITc_wifi_set_unset_background_scan_cb_p", ITc_wifi_set_unset_background_scan_cb_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
extern int ITc_wifi_get_mac_address_p(void);
extern int ITc_wifi_get_network_interface_name_p(void);
extern int ITc_wifi_scan_p(void);
-extern int ITc_wifi_get_connected_ap_p(void);
+extern int ITc_wifi_get_connected_forget_ap_p(void);
extern int ITc_wifi_foreach_found_aps_p(void);
extern int ITc_wifi_connect_disconnect_p(void);
-extern int ITc_wifi_forget_ap_p(void);
extern int ITc_wifi_get_connection_state_p(void);
extern int ITc_wifi_set_unset_device_state_changed_cb_p(void);
extern int ITc_wifi_set_unset_background_scan_cb_p(void);
{"ITc_wifi_get_mac_address_p", ITc_wifi_get_mac_address_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_get_network_interface_name_p", ITc_wifi_get_network_interface_name_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_scan_p", ITc_wifi_scan_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
- {"ITc_wifi_get_connected_ap_p", ITc_wifi_get_connected_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
+ {"ITc_wifi_get_connected_forget_ap_p", ITc_wifi_get_connected_forget_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_foreach_found_aps_p", ITc_wifi_foreach_found_aps_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_connect_disconnect_p", ITc_wifi_connect_disconnect_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
- {"ITc_wifi_forget_ap_p", ITc_wifi_forget_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_get_connection_state_p", ITc_wifi_get_connection_state_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
{"ITc_wifi_set_unset_device_state_changed_cb_p", ITc_wifi_set_unset_device_state_changed_cb_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
{"ITc_wifi_set_unset_background_scan_cb_p", ITc_wifi_set_unset_background_scan_cb_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
extern int ITc_wifi_get_mac_address_p(void);
extern int ITc_wifi_get_network_interface_name_p(void);
extern int ITc_wifi_scan_p(void);
-extern int ITc_wifi_get_connected_ap_p(void);
+extern int ITc_wifi_get_connected_forget_ap_p(void);
extern int ITc_wifi_foreach_found_aps_p(void);
extern int ITc_wifi_connect_disconnect_p(void);
-extern int ITc_wifi_forget_ap_p(void);
extern int ITc_wifi_get_connection_state_p(void);
extern int ITc_wifi_set_unset_device_state_changed_cb_p(void);
extern int ITc_wifi_set_unset_background_scan_cb_p(void);
{"ITc_wifi_get_mac_address_p", ITc_wifi_get_mac_address_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_get_network_interface_name_p", ITc_wifi_get_network_interface_name_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_scan_p", ITc_wifi_scan_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
- {"ITc_wifi_get_connected_ap_p", ITc_wifi_get_connected_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
+ {"ITc_wifi_get_connected_forget_ap_p", ITc_wifi_get_connected_forget_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_foreach_found_aps_p", ITc_wifi_foreach_found_aps_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_connect_disconnect_p", ITc_wifi_connect_disconnect_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
- {"ITc_wifi_forget_ap_p", ITc_wifi_forget_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_get_connection_state_p", ITc_wifi_get_connection_state_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
{"ITc_wifi_set_unset_device_state_changed_cb_p", ITc_wifi_set_unset_device_state_changed_cb_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
{"ITc_wifi_set_unset_background_scan_cb_p", ITc_wifi_set_unset_background_scan_cb_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
extern int ITc_wifi_get_mac_address_p(void);
extern int ITc_wifi_get_network_interface_name_p(void);
extern int ITc_wifi_scan_p(void);
-extern int ITc_wifi_get_connected_ap_p(void);
+extern int ITc_wifi_get_connected_forget_ap_p(void);
extern int ITc_wifi_foreach_found_aps_p(void);
extern int ITc_wifi_connect_disconnect_p(void);
-extern int ITc_wifi_forget_ap_p(void);
extern int ITc_wifi_get_connection_state_p(void);
extern int ITc_wifi_set_unset_device_state_changed_cb_p(void);
extern int ITc_wifi_set_unset_background_scan_cb_p(void);
{"ITc_wifi_get_mac_address_p", ITc_wifi_get_mac_address_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_get_network_interface_name_p", ITc_wifi_get_network_interface_name_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_scan_p", ITc_wifi_scan_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
- {"ITc_wifi_get_connected_ap_p", ITc_wifi_get_connected_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
+ {"ITc_wifi_get_connected_forget_ap_p", ITc_wifi_get_connected_forget_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_foreach_found_aps_p", ITc_wifi_foreach_found_aps_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_connect_disconnect_p", ITc_wifi_connect_disconnect_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
- {"ITc_wifi_forget_ap_p", ITc_wifi_forget_ap_p, ITs_wifi_manager_startup, ITs_wifi_manager_cleanup},
{"ITc_wifi_get_connection_state_p", ITc_wifi_get_connection_state_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
{"ITc_wifi_set_unset_device_state_changed_cb_p", ITc_wifi_set_unset_device_state_changed_cb_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},
{"ITc_wifi_set_unset_background_scan_cb_p", ITc_wifi_set_unset_background_scan_cb_p, ITs_wifi_monitor_startup, ITs_wifi_monitor_cleanup},