}
}
-/**
-* @function WifiFoundEapAPCallback
-* @description Called when access point is found repeatedly
-* @parameter pHandle : wifi AP handle, user_data : user data sent to callback
-* @return bool
-*/
-bool WifiFoundEapAPCallback(wifi_ap_h pHandle, void* user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s]called callback WifiFoundEapAPCallback\\n", __LINE__, API_NAMESPACE);
-#endif
- g_bForEachCb = true;
- if ( pHandle != NULL )
- {
- FREE_MEMORY(g_pszESSID);
- char szValueEAP[CONFIG_VALUE_LEN_MAX] = {0,};
- int nRet = wifi_ap_get_essid(pHandle, &g_pszESSID);
- if ( nRet == WIFI_ERROR_NONE )
- {
- if ( g_pszESSID != NULL )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] Access Point name in scanned list = %s\\n", __LINE__, API_NAMESPACE, g_pszESSID);
-#endif
- if ( true == GetValueFromConfigFile("WIFI_EAPACCESSPOINTNAME", szValueEAP, NULL) )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, szValueEAP);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE);
- return false;
- }
- int nAPLength = strlen(szValueEAP);
- if ( strncmp(g_pszESSID, szValueEAP, nAPLength) == 0 )
- {
- nRet = wifi_ap_clone(&g_pEapWifiAPHandle, pHandle);
- if ((nRet == WIFI_ERROR_NONE) && (g_pEapWifiAPHandle != NULL))
- {
- g_bCheckCb = true;
- if ( g_pMainLoop )
- {
- g_main_loop_quit(g_pMainLoop);
- g_main_loop_unref(g_pMainLoop);
- g_pMainLoop = NULL;
- }
- return false;
- }
- }
- }
- }
- }
- return true;
-}
-
-/**
-* @function WifiPreConnectConditionForEAP
-* @description to scan and find the AP
-* @parameter NA
-* @return true for success or false for failure
-*/
-bool WifiPreConnectConditionForEAP()
-{
- /** If device is already connected to an access point, next time the AP name does not appear in the scanned list
- so we will have to disconnect it first and then scan
- But as we are not sure if it will be connected/disconnected at this point we will call disconnect here
- and ignore the return type */
-
- int nWifiTimeoutId = -1;
- 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));
- return false;
- }
- RUN_POLLING_LOOP;
- if ( !g_bCheckCb )
- {
- FPRINTF("[Line : %d][%s] WifiActivatedCallback = callback function not invoked\\n", __LINE__, API_NAMESPACE);
- return false;
- }
- }
- g_bCheckCb = 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));
- return false;
- }
- if ( !g_bCheckCb )
- {
- FPRINTF("[Line : %d][%s] wifi_scan failed inside WifiPreConnectConditionForEAP, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
- return false;
- }
- g_bForEachCb = false;
- g_bCheckCb = false;
- nRet = wifi_foreach_found_aps(WifiFoundEapAPCallback, NULL);
- RUN_POLLING_LOOP;
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_foreach_found_aps failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- return false;
- }
- if ( !g_bForEachCb )
- {
- FPRINTF("[Line : %d][%s] wifi_foreach_found_aps failed inside WifiPreConnectConditionForEAP, error returned = callback function not invoked\\n", __LINE__, API_NAMESPACE);
- return false;
- }
- if ( !g_bCheckCb )
- {
- FPRINTF("[Line : %d][%s] WiFi EAP given as input not found in the scanned list\\n", __LINE__, API_NAMESPACE);
- return false;
- }
- g_bCheckCb = false;
- nRet = wifi_connect(g_pEapWifiAPHandle, WifiConnectedCallback, NULL);
- if ( nRet != WIFI_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] wifi_connect failed, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
- return false;
- }
- RUN_POLLING_LOOP;
- if ( !g_bCheckCb )
- {
- FPRINTF("[Line : %d][%s] WifiConnectedCallback = callback function not invoked\\n", __LINE__, API_NAMESPACE);
- return false;
- }
- return true;
-}
-
/** @}*/
}\
}
+#define START_TEST_EAP {\
+ FPRINTF("[Line : %d] [wifi_ITC] Starting test : %s\\n", __LINE__,__FUNCTION__);\
+ if ( g_bWifiMismatch == true )\
+{\
+ FPRINTF("[Line : %d][wifi_ITC] Feature support as returned by TCTCheckSystemInfoFeatureSupported() and error code as returned by wifi_initialize() mismatched, Leaving test\\n", __LINE__);\
+ return 1;\
+}\
+ else if ( g_bWifiNotSupported == true)\
+{\
+ FPRINTF("[Line : %d] [wifi_ITC] wifi feature not supported, Leaving test\\n", __LINE__);\
+ return 0;\
+}\
+else if ( g_bWifiInitialization == false )\
+{\
+ FPRINTF("[Line : %d] [wifi_ITC] wifi fail in startup, Leaving test\\n", __LINE__);\
+ return 1;\
+}\
+}
+
/*
if ( !g_bWifiInit )\
{\
bool WifiPreConnectCondition();
void WifiScanApCallback(wifi_error_e result, void *user_data);
bool WifiFoundSpecificAPCallback(wifi_ap_h pHandle, void* user_data);
-bool WifiFoundEapAPCallback(wifi_ap_h pHandle, void* user_data);
-bool WifiPreConnectConditionForEAP();
/** @}*/
return 1;
}
- if ( !WifiPreConnectCondition() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectCondition failed\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pszPassphrase);
- return 1;
- }
-
- CHECK_ACCESS_POINT_CLEANUP(g_pWifiAPHandle, FREE_MEMORY(pszPassphrase));
-
int nEnumSecuritySize = sizeof(eSecurityType) / sizeof(eSecurityType[0]);
int nEnumSecurityCounter = 0;
return 1;
}
- if ( !WifiPreConnectCondition() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectCondition failed\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pszPassphrase);
- return 1;
- }
-
- CHECK_ACCESS_POINT_CLEANUP(g_pWifiAPHandle, FREE_MEMORY(pszPassphrase));
-
int nRet = wifi_config_create(szValue, pszPassphrase, WIFI_SECURITY_TYPE_NONE, &origin);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( origin == NULL )
return 1;
}
- if ( !WifiPreConnectCondition() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectCondition failed\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pszPassphrase);
- return 1;
- }
-
- CHECK_ACCESS_POINT_CLEANUP(g_pWifiAPHandle, FREE_MEMORY(pszPassphrase));
-
int nRet = wifi_config_create(szValue, pszPassphrase, WIFI_SECURITY_TYPE_NONE, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectCondition() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectCondition failed\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pszPassphrase);
- return 1;
- }
-
- CHECK_ACCESS_POINT_CLEANUP(g_pWifiAPHandle, FREE_MEMORY(pszPassphrase));
-
int nRet = wifi_config_create(szValue, pszPassphrase, WIFI_SECURITY_TYPE_NONE, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectCondition() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectCondition failed\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pszPassphrase);
- return 1;
- }
-
- CHECK_ACCESS_POINT_CLEANUP(g_pWifiAPHandle, FREE_MEMORY(pszPassphrase));
-
int nRet = wifi_config_create(szValue, pszPassphrase, WIFI_SECURITY_TYPE_NONE, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectCondition() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectCondition failed\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pszPassphrase);
- return 1;
- }
-
- CHECK_ACCESS_POINT_CLEANUP(g_pWifiAPHandle, FREE_MEMORY(pszPassphrase));
-
int nRet = wifi_config_create(szValue, pszPassphrase, WIFI_SECURITY_TYPE_NONE, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectCondition() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectCondition failed\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pszPassphrase);
- return 1;
- }
-
- CHECK_ACCESS_POINT_CLEANUP(g_pWifiAPHandle, FREE_MEMORY(pszPassphrase));
-
int nRet = wifi_config_create(szValue, pszPassphrase, WIFI_SECURITY_TYPE_NONE, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
-
int nRet = wifi_config_create(szValue, EAPACCESSPOINTPIN, WIFI_SECURITY_TYPE_EAP, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
-
if ( false == WifiAppendToAppDataPath(CERTIFICATION_PATH, pszCertPath) )
{
FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
-
if ( false == WifiAppendToAppDataPath(CERTIFICATION_PATH, pszCertPath) )
{
FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
-
int nRet = wifi_config_create(szValue, EAPACCESSPOINTPIN, WIFI_SECURITY_TYPE_EAP, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
-
int nRet = wifi_config_create(szValue, EAPACCESSPOINTPIN, WIFI_SECURITY_TYPE_EAP, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
-
int nRet = wifi_config_create(szValue, EAPACCESSPOINTPIN, WIFI_SECURITY_TYPE_EAP, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
-
int nRet = wifi_config_create(szValue, EAPACCESSPOINTPIN, WIFI_SECURITY_TYPE_EAP, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
if ( config == NULL )
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
-
int nRet = wifi_config_create(szValue, EAPACCESSPOINTPIN, WIFI_SECURITY_TYPE_EAP, &config);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_config_create", WifiGetError(nRet));
CHECK_HANDLE(config,wifi_config_create);
}
return;
}
-
if ( nRet == WIFI_ERROR_NONE )
{
#if DEBUG
FPRINTF("[Line : %d][%s] wifi_initialize passed\\n", __LINE__, API_NAMESPACE);
#endif
-
- g_bWifiInitialization = true;
+ g_bWifiInitialization = true;
}
else
{
FPRINTF("[Line : %d][%s] wifi_initialize failed on startup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
}
+ nRet = wifi_ap_create("dongtan", &g_pEapWifiAPHandle);
+ if ( nRet == WIFI_ERROR_NONE )
+ {
+ FPRINTF("[Line : %d][%s] wifi_ap_create passed\\n", __LINE__, API_NAMESPACE);
+ }
+ else
+ {
+ g_bWifiInitialization = false;
+ FPRINTF("[Line : %d][%s] wifi_ap_create failed on startup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+ }
}
/**
if(g_bWifiInitialization)
{
+ if(g_pEapWifiAPHandle)
+ {
+ nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
+ if ( nRet == WIFI_ERROR_NONE )
+ {
+ FPRINTF("[Line : %d][%s] wifi_ap_destroy passed\\n", __LINE__, API_NAMESPACE);
+ }
+ else
+ {
+ FPRINTF("[Line : %d][%s] wifi_ap_destroy failed on cleanup, error returned = %s\\n", __LINE__, API_NAMESPACE, WifiGetError(nRet));
+ }
+ }
+
nRet = wifi_deinitialize();
if ( nRet == WIFI_ERROR_NONE )
{
*/
int ITc_wifi_ap_set_get_eap_auth_type_p(void)
{
- START_TEST;
+ START_TEST_EAP;
wifi_eap_auth_type_e eSetEAPAuthType = WIFI_EAP_AUTH_TYPE_NONE;
wifi_eap_auth_type_e eFindEAPAuthType;
+ wifi_eap_type_e eSetEAPType = WIFI_EAP_TYPE_TLS;
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
- int nRet = wifi_ap_set_eap_auth_type(g_pEapWifiAPHandle, eSetEAPAuthType);
+ int nRet = wifi_ap_set_security_type(g_pEapWifiAPHandle, WIFI_SECURITY_TYPE_EAP);
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_security_type", WifiGetError(nRet));
+
+ nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_type", WifiGetError(nRet));
+
+ nRet = wifi_ap_set_eap_auth_type(g_pEapWifiAPHandle, eSetEAPAuthType);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_auth_type", WifiGetError(nRet));
nRet = wifi_ap_get_eap_auth_type(g_pEapWifiAPHandle, &eFindEAPAuthType);
*/
int ITc_wifi_ap_set_get_eap_type_p(void)
{
- START_TEST;
+ START_TEST_EAP;
wifi_eap_type_e eSetEAPType = WIFI_EAP_TYPE_TLS;
wifi_eap_type_e eFindEAPType = -1;
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
- int nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
+ int nRet = wifi_ap_set_security_type(g_pEapWifiAPHandle, WIFI_SECURITY_TYPE_EAP);
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_security_type", WifiGetError(nRet));
+
+ nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_type", WifiGetError(nRet));
+
nRet = wifi_ap_get_eap_type(g_pEapWifiAPHandle, &eFindEAPType);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_get_eap_type", WifiGetError(nRet));
*/
int ITc_wifi_ap_set_get_eap_ca_cert_file_p(void)
{
- START_TEST;
+ START_TEST_EAP;
char *pszFindCertPath = NULL;
wifi_eap_type_e eSetEAPType = WIFI_EAP_TYPE_TLS;
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
- int nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
+ int nRet = wifi_ap_set_security_type(g_pEapWifiAPHandle, WIFI_SECURITY_TYPE_EAP);
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_security_type", WifiGetError(nRet));
+
+ nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_type", WifiGetError(nRet));
nRet = wifi_ap_set_eap_ca_cert_file(g_pEapWifiAPHandle, pszCertPath);
*/
int ITc_wifi_ap_set_get_eap_client_cert_file_p(void)
{
- START_TEST;
+ START_TEST_EAP;
char *pszFindCertPath = NULL;
wifi_eap_type_e eSetEAPType = WIFI_EAP_TYPE_TLS;
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
- int nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
+ int nRet = wifi_ap_set_security_type(g_pEapWifiAPHandle, WIFI_SECURITY_TYPE_EAP);
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_security_type", WifiGetError(nRet));
+
+ nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_type", WifiGetError(nRet));
nRet = wifi_ap_set_eap_client_cert_file(g_pEapWifiAPHandle, pszCertPath);
* get path of private key information of EAP\n
* compare find key path and set key path of certificate\n
* destroys the handle of access point
-* @apicovered wifi_ap_set_eap_private_key_info, wifi_ap_get_eap_private_key_file, wifi_ap_set_eap_type, wifi_ap_destroy
+* @apicovered wifi_ap_set_eap_private_key_info, wifi_ap_get_eap_private_key_file, wifi_ap_set_eap_type
* @passcase When wifi_ap_set_eap_private_key_info, wifi_ap_get_eap_private_key_file and supporting apis returns success
* @failcase When wifi_ap_set_eap_private_key_info or wifi_ap_get_eap_private_key_file or supporting apis returns failure
* @precondition Wi-Fi should be initialised and activated
*/
int ITc_wifi_ap_set_get_eap_private_key_info_file_p(void)
{
- START_TEST;
+ START_TEST_EAP;
char *pszPassword = "1234";
char *pszFindKeyPath = NULL;
return 1;
}
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
- int nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
+ int nRet = wifi_ap_set_security_type(g_pEapWifiAPHandle, WIFI_SECURITY_TYPE_EAP);
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_security_type", WifiGetError(nRet));
+
+ nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_type", WifiGetError(nRet));
nRet = wifi_ap_get_eap_private_key_file(g_pEapWifiAPHandle, &pstrGetDefaultPath);
FREE_MEMORY(pszFindKeyPath);
nRet = wifi_ap_set_eap_private_key_info(g_pEapWifiAPHandle, pstrGetDefaultPath, NULL);
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_private_key_info", WifiGetError(nRet), FREE_MEMORY(pstrGetDefaultPath);wifi_ap_destroy(g_pEapWifiAPHandle));
+ PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_private_key_info", WifiGetError(nRet), FREE_MEMORY(pstrGetDefaultPath));
FREE_MEMORY(pstrGetDefaultPath);
-
- nRet = wifi_ap_destroy(g_pEapWifiAPHandle);
- PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_destroy", WifiGetError(nRet));
+
return 0;
}
*/
int ITc_wifi_ap_set_get_eap_passphrase_p(void)
{
- START_TEST;
+ START_TEST_EAP;
char *pszUser = "user";
char *pszPassword = "1234";
wifi_eap_type_e eSetEAPType = WIFI_EAP_TYPE_TTLS;
- if ( !WifiPreConnectConditionForEAP() )
- {
- FPRINTF("[Line : %d][%s] WifiPreConnectConditionForEAP failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
CHECK_ACCESS_POINT(g_pEapWifiAPHandle);
- int nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
+ int nRet = wifi_ap_set_security_type(g_pEapWifiAPHandle, WIFI_SECURITY_TYPE_EAP);
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_security_type", WifiGetError(nRet));
+
+ nRet = wifi_ap_set_eap_type(g_pEapWifiAPHandle, eSetEAPType);
PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_ap_set_eap_type", WifiGetError(nRet));
nRet = wifi_ap_set_eap_passphrase(g_pEapWifiAPHandle, pszUser, pszPassword);
/** @} */
/** @} */
-
-
-
-
-
-
START_TEST;
int nWifiTimeoutId = -1;
- char* pstrPassphrase = NULL;
- pstrPassphrase = calloc(1024, sizeof(char));
//precondition
//Creates the access point handle
- //target api(wifi_connect) is exist in below condition
if ( !WifiPreConnectCondition() )
{
FPRINTF("[Line : %d][%s] WifiPreConnectCondition failed\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pstrPassphrase);
return 1;
}
if ( g_pWifiAPHandle == NULL )
{
FPRINTF("[Line : %d][%s] Access Point is not found in scanned list\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pstrPassphrase);
- return 1;
- }
-
- if ( true == GetValueFromConfigFile("WIFI_ACCESSPOINTPIN", pstrPassphrase, NULL) )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] WIFI_ACCESSPOINTPIN Values Received = %s\\n", __LINE__, API_NAMESPACE, pstrPassphrase);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE);
- FREE_MEMORY(pstrPassphrase);
return 1;
}
int nRet = wifi_forget_ap(g_pWifiAPHandle);
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet), FREE_MEMORY(pstrPassphrase));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_forget_ap", WifiGetError(nRet));
g_bCheckCb = false;
nRet = wifi_disconnect(g_pWifiAPHandle, WiFiDisconnectCallabck, NULL);
RUN_POLLING_LOOP;
- PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_disconnect", WifiGetError(nRet),wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL); FREE_MEMORY(pstrPassphrase));
+ PRINT_RESULT_CLEANUP(WIFI_ERROR_NONE, nRet, "wifi_disconnect", WifiGetError(nRet),wifi_connect(g_pWifiAPHandle, WifiConnectedCallback, NULL));
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;
}
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));
+ PRINT_RESULT(WIFI_ERROR_NONE, nRet, "wifi_connect", WifiGetError(nRet));
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;
}