From: Chengyi Zhao Date: Mon, 20 Oct 2014 07:08:45 +0000 (+0800) Subject: Test to get proxy, security and EAP X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14a015d7f7d1a4503dcb088fba26e613f3ac9b9c;p=platform%2Fcore%2Fapi%2Fwifi.git Test to get proxy, security and EAP Change-Id: I7b5ff62528fe61598cfe548f0c9bc1941d47acd2 Signed-off-by: Chengyi Zhao --- diff --git a/test/wifi_test.c b/test/wifi_test.c index 853b700..ac80b6b 100644 --- a/test/wifi_test.c +++ b/test/wifi_test.c @@ -511,6 +511,11 @@ static bool __test_found_print_ap_info_callback(wifi_ap_h ap, void *user_data) int int_value; wifi_connection_state_e conn_state; wifi_ip_config_type_e ip_type; + wifi_proxy_type_e proxy_type; + wifi_security_type_e sec_type; + wifi_encryption_type_e enc_type; + wifi_eap_type_e eap_type; + wifi_eap_auth_type_e eap_auth_type; bool bool_value; char *ap_bssid_part = (char*)user_data; @@ -582,6 +587,91 @@ static bool __test_found_print_ap_info_callback(wifi_ap_h ap, void *user_data) } else printf("Fail to get Gateway\n"); + if (wifi_ap_get_proxy_type(ap, &proxy_type) == WIFI_ERROR_NONE) + printf("Proxy type : %d\n", proxy_type); + else + printf("Fail to get Proxy type\n"); + + if (wifi_ap_get_proxy_address(ap, WIFI_ADDRESS_FAMILY_IPV4, &str_value) == WIFI_ERROR_NONE) { + printf("Proxy : %s\n", str_value); + g_free(str_value); + } else + printf("Fail to get Proxy\n"); + + if (wifi_ap_get_dns_address(ap, 1, WIFI_ADDRESS_FAMILY_IPV4, &str_value) == WIFI_ERROR_NONE) { + printf("DNS1 : %s\n", str_value); + g_free(str_value); + } else + printf("Fail to get DNS1\n"); + + if (wifi_ap_get_dns_address(ap, 2, WIFI_ADDRESS_FAMILY_IPV4, &str_value) == WIFI_ERROR_NONE) { + printf("DNS2 : %s\n", str_value); + g_free(str_value); + } else + printf("Fail to get DNS2\n"); + + /* Security info */ + if (wifi_ap_get_security_type(ap, &sec_type) == WIFI_ERROR_NONE) + printf("Security type : %d\n", sec_type); + else + printf("Fail to get Security type\n"); + + if (wifi_ap_get_encryption_type(ap, &enc_type) == WIFI_ERROR_NONE) + printf("Encryption type : %d\n", enc_type); + else + printf("Fail to get Encryption type\n"); + + if (wifi_ap_is_passphrase_required(ap, &bool_value) == WIFI_ERROR_NONE) + printf("Passphrase required : %s\n", bool_value ? "TRUE" : "FALSE"); + else + printf("Fail to get Passphrase required\n"); + + if (wifi_ap_is_wps_supported(ap, &bool_value) == WIFI_ERROR_NONE) + printf("WPS supported : %s\n", bool_value ? "TRUE" : "FALSE"); + else + printf("Fail to get WPS supported\n"); + + if (sec_type != WIFI_SECURITY_TYPE_EAP) { + g_free(ap_bssid); + return false; + } + + /* EAP info */ + if (wifi_ap_get_eap_type(ap, &eap_type) == WIFI_ERROR_NONE) + printf("EAP type : %d\n", eap_type); + else + printf("Fail to get EAP type\n"); + + if (wifi_ap_get_eap_auth_type(ap, &eap_auth_type) == WIFI_ERROR_NONE) + printf("EAP auth type : %d\n", eap_auth_type); + else + printf("Fail to get EAP auth type\n"); + + if (wifi_ap_get_eap_passphrase(ap, &str_value, &bool_value) == WIFI_ERROR_NONE) { + printf("EAP user name : %s\n", str_value); + printf("EAP is password setted : %s\n", bool_value ? "TRUE" : "FALSE"); + g_free(str_value); + } else + printf("Fail to get EAP passphrase(user name/password)\n"); + + if (wifi_ap_get_eap_ca_cert_file(ap, &str_value) == WIFI_ERROR_NONE) { + printf("EAP ca cert file : %s\n", str_value); + g_free(str_value); + } else + printf("Fail to get EAP ca cert file\n"); + + if (wifi_ap_get_eap_client_cert_file(ap, &str_value) == WIFI_ERROR_NONE) { + printf("EAP client cert file : %s\n", str_value); + g_free(str_value); + } else + printf("Fail to get EAP client cert file\n"); + + if (wifi_ap_get_eap_private_key_file(ap, &str_value) == WIFI_ERROR_NONE) { + printf("EAP private key file : %s\n", str_value); + g_free(str_value); + } else + printf("Fail to get EAP private key file\n"); + g_free(ap_bssid); return false; } @@ -607,7 +697,7 @@ int test_wifi_init(void) printf("Wifi init succeeded\n"); return 1; } - + int test_wifi_deinit(void) { int rv = 0;