From 2ed6103a52be08d9c1fe80b15bd9a193fe63fdfd Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Wed, 23 Apr 2025 16:31:02 +0900 Subject: [PATCH] Add supported security list to AP info in test app Change-Id: Ie6bf8fd62c1147a20023d044c124a5639fed4ceb Signed-off-by: Jaehyun Kim --- tools/manager-test/wman_test_ap.c | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tools/manager-test/wman_test_ap.c b/tools/manager-test/wman_test_ap.c index 69b5c94..038c8e2 100644 --- a/tools/manager-test/wman_test_ap.c +++ b/tools/manager-test/wman_test_ap.c @@ -1011,6 +1011,42 @@ static inline int __test_found_print_ap_network_info_cb(wifi_manager_ap_h ap) return 0; } +typedef struct { + int sec_type; + char *sec_type_str; +} security_list_str_s; + +static security_list_str_s security_list_str_table[] = { + { WIFI_MANAGER_SECURITY_TYPE_NONE, "None" }, + { WIFI_MANAGER_SECURITY_TYPE_WEP, "WEP" }, + { WIFI_MANAGER_SECURITY_TYPE_WPA_PSK, "PSK" }, + { WIFI_MANAGER_SECURITY_TYPE_WPA2_PSK, "RSN" }, + { WIFI_MANAGER_SECURITY_TYPE_EAP, "EAP" }, + { WIFI_MANAGER_SECURITY_TYPE_WPA_FT_PSK, "FT_PSK" }, + { WIFI_MANAGER_SECURITY_TYPE_SAE, "SAE" }, + { WIFI_MANAGER_SECURITY_TYPE_OWE, "OWE" }, + { WIFI_MANAGER_SECURITY_TYPE_DPP, "DPP" }, + { -1, "" }, +}; + +static inline void __test_found_print_ap_security_list(wifi_manager_ap_h ap) +{ + bool supported = false; + int count = 0; + + printf("Supported security types: "); + + while (security_list_str_table[count].sec_type >= 0) { + if (WIFI_MANAGER_ERROR_NONE == wifi_manager_ap_is_security_type_supported( + ap, security_list_str_table[count].sec_type, &supported) && + supported) + printf("%s ", security_list_str_table[count].sec_type_str); + count++; + } + + printf("\n"); +} + static inline int __test_found_print_ap_security_info_cb(wifi_manager_ap_h ap) { bool bool_value; @@ -1023,6 +1059,8 @@ static inline int __test_found_print_ap_security_info_cb(wifi_manager_ap_h ap) else printf("Fail to get Security type\n"); + __test_found_print_ap_security_list(ap); + if (wifi_manager_ap_get_encryption_type(ap, &enc_type) == WIFI_MANAGER_ERROR_NONE) printf("Encryption type : %d\n", enc_type); else -- 2.34.1