Add EAP type to test tool 36/244836/2
authorhyunuk.tak <hyunuk.tak@samsung.com>
Thu, 24 Sep 2020 23:57:06 +0000 (08:57 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Fri, 25 Sep 2020 05:20:05 +0000 (05:20 +0000)
Clean up some log

Change-Id: I5a3e1aa4aaaca8847c4af974847b6d062103a8ff
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
tool/wifi_mgr_extension_autoconnect.c
tool/wifi_mgr_extension_netlinkscan.c
tool/wifi_mgr_public.c
tool/wifi_mgr_public_connect.c
tool/wifi_mgr_public_dpp.c [changed mode: 0644->0755]
tool/wifi_mgr_public_dpp.h [changed mode: 0644->0755]
tool/wifi_mgr_public_scan.c
tool/wifi_mgr_public_set.c
tool/wifi_mgr_tool.c

index a70c6a73c28bdb153071d7422b9d2eba9c474ce0..bd43ff6d9ec0dcc69ab2ef8fb813c25ee0786e00 100755 (executable)
@@ -40,6 +40,7 @@ static bool __test_extension_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
        int ret = WIFI_MANAGER_ERROR_NONE;
        char *essid = NULL;
        wifi_manager_connection_state_e state;
+       wifi_manager_security_type_e type;
        int rssi = 0;
        bool autoconnect = FALSE;
        int autoconn_state = (int)strtol((char *)g_autoconnect_state, NULL, 10);
@@ -68,11 +69,21 @@ static bool __test_extension_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
                return FALSE;
        }
 
+       ret = wifi_manager_ap_get_security_type(ap, &type);
+       if (ret != WIFI_MANAGER_ERROR_NONE) {
+               msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
+                       test_wifi_mgr_convert_error_to_string(ret));
+               FREE(essid);
+               return FALSE;
+       }
+
        switch (cb_type) {
        case 0: /* get */
                if (test_wifi_mgr_compare_string(essid, g_ssid)) {
-                       msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                               test_wifi_mgr_conn_state_to_string(state), rssi);
+                       msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                               test_wifi_mgr_sec_type_to_string(type),
+                               test_wifi_mgr_conn_state_to_string(state),
+                               rssi);
 
                        ret = wifi_manager_ap_get_auto_connect(ap, &autoconnect);
                        if (ret == WIFI_MANAGER_ERROR_NONE)
@@ -85,8 +96,10 @@ static bool __test_extension_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
                break;
        case 1: /* set */
                if (test_wifi_mgr_compare_string(essid, g_ssid)) {
-                       msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                               test_wifi_mgr_conn_state_to_string(state), rssi);
+                       msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                               test_wifi_mgr_sec_type_to_string(type),
+                               test_wifi_mgr_conn_state_to_string(state),
+                               rssi);
 
                        ret = wifi_manager_ap_set_auto_connect(ap, autoconn_state);
                        if (ret == WIFI_MANAGER_ERROR_NONE)
index a3ac61d5072a5eefb3d4152cd5d2c0ede72b507d..6c8737f28cc8a6191a60a0ee5f035a1ccbf5085d 100755 (executable)
@@ -64,7 +64,7 @@ static bool __test_extension_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
                return FALSE;
        }
 
-       msg("Bssid [%s], Essid " LOG_CYAN "[%s]" LOG_END ", Rssi [%d]", bssid, essid, rssi);
+       msg("[%s]" LOG_CYAN "[%-35s]" LOG_END "[%d]", bssid, essid, rssi);
 
        FREE(bssid);
        FREE(essid);
index a7fb4f8d8f25c3e64b5db797e589ad2dfdf6b584..e51c335ace38d15bc5da31541aaf48a57db4935e 100755 (executable)
@@ -87,6 +87,7 @@ static bool __test_public_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
        int ret = WIFI_MANAGER_ERROR_NONE;
        char *essid = NULL;
        wifi_manager_connection_state_e state;
+       wifi_manager_security_type_e type;
        int rssi = 0;
        int cb_type = (int)strtol((char *)user_data, NULL, 10);
 
@@ -113,15 +114,27 @@ static bool __test_public_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
                return FALSE;
        }
 
+       ret = wifi_manager_ap_get_security_type(ap, &type);
+       if (ret != WIFI_MANAGER_ERROR_NONE) {
+               msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
+                       test_wifi_mgr_convert_error_to_string(ret));
+               FREE(essid);
+               return FALSE;
+       }
+
        switch (cb_type) {
        case 0: /* scan */
-               msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                       test_wifi_mgr_conn_state_to_string(state), rssi);
+               msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                       test_wifi_mgr_sec_type_to_string(type),
+                       test_wifi_mgr_conn_state_to_string(state),
+                       rssi);
                break;
        case 1: /* disconnect */
                if (test_wifi_mgr_compare_string(essid, g_ssid)) {
-                       msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                               test_wifi_mgr_conn_state_to_string(state), rssi);
+                       msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                               test_wifi_mgr_sec_type_to_string(type),
+                               test_wifi_mgr_conn_state_to_string(state),
+                               rssi);
 
                        ret = wifi_manager_disconnect(g_wifi_h, ap, __test_public_disconnected_cb, NULL);
                        if (ret == WIFI_MANAGER_ERROR_NONE)
@@ -133,8 +146,10 @@ static bool __test_public_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
                break;
        case 2: /* forget */
                if (test_wifi_mgr_compare_string(essid, g_ssid)) {
-                       msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                               test_wifi_mgr_conn_state_to_string(state), rssi);
+                       msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                               test_wifi_mgr_sec_type_to_string(type),
+                               test_wifi_mgr_conn_state_to_string(state),
+                               rssi);
 
                        ret = wifi_manager_forget_ap(g_wifi_h, ap);
 
index 78e4d06967aac30e1532f7143fdaafcbbe8b691f..c702b84aeb02a2b4985eb90ab914017a2c1da2eb 100755 (executable)
@@ -34,7 +34,7 @@ extern wifi_manager_device_state_e g_device_state;
 static char g_ssid[MENU_DATA_SIZE] = "dnet2";
 static char g_passphrase[MENU_DATA_SIZE] = "passphrase";
 static char g_security[MENU_DATA_SIZE] = "0";
-static char g_username[MENU_DATA_SIZE] = "username";
+static char g_username[MENU_DATA_SIZE] = "wifi-user";
 static char g_eap_type[MENU_DATA_SIZE] = "0";
 static char g_certificate[MENU_DATA_SIZE] = "certificate";
 static char g_auth_type[MENU_DATA_SIZE] = "0";
@@ -58,6 +58,7 @@ static bool __test_public_connect_found_ap_cb(wifi_manager_ap_h ap, void *user_d
        int ret = WIFI_MANAGER_ERROR_NONE;
        char *essid = NULL;
        wifi_manager_connection_state_e state = WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED;
+       wifi_manager_security_type_e type = WIFI_MANAGER_SECURITY_TYPE_NONE;
        int rssi = 0;
 
        ret = wifi_manager_ap_get_essid(ap, &essid);
@@ -83,6 +84,14 @@ static bool __test_public_connect_found_ap_cb(wifi_manager_ap_h ap, void *user_d
                return FALSE;
        }
 
+       ret = wifi_manager_ap_get_security_type(ap, &type);
+       if (ret != WIFI_MANAGER_ERROR_NONE) {
+               msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
+                       test_wifi_mgr_convert_error_to_string(ret));
+               FREE(essid);
+               return FALSE;
+       }
+
        if (test_wifi_mgr_compare_string(essid, g_ssid)) {
                bool required = FALSE;
 
@@ -108,8 +117,10 @@ static bool __test_public_connect_found_ap_cb(wifi_manager_ap_h ap, void *user_d
                        }
                }
 
-               msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                       test_wifi_mgr_conn_state_to_string(state), rssi);
+               msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                       test_wifi_mgr_sec_type_to_string(type),
+                       test_wifi_mgr_conn_state_to_string(state),
+                       rssi);
 
                ret = wifi_manager_connect(g_wifi_h, ap, __test_public_connected_cb, NULL);
                if (ret == WIFI_MANAGER_ERROR_NONE)
@@ -214,9 +225,10 @@ static bool __test_public_connect_found_specific_ap_cb(wifi_manager_ap_h ap,
                break;
        }
 
-       msg("AP name " LOG_CYAN "[%s]" LOG_END ", Security [%s], State [%s], Rssi [%d]", essid,
-                       test_wifi_mgr_sec_type_to_string(security),
-                       test_wifi_mgr_conn_state_to_string(state), rssi);
+       msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+               test_wifi_mgr_sec_type_to_string(security),
+               test_wifi_mgr_conn_state_to_string(state),
+               rssi);
 
        if (security != type) {
                FREE(essid);
@@ -270,18 +282,19 @@ static bool __test_public_connect_found_eap_ap_cb(wifi_manager_ap_h ap,
                return FALSE;
        }
 
-       if (test_wifi_mgr_compare_string(essid, g_ssid)) {
-               ret = wifi_manager_ap_get_security_type(ap, &security);
-               if (ret != WIFI_MANAGER_ERROR_NONE) {
-                       msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
-                               test_wifi_mgr_convert_error_to_string(ret));
-                       FREE(essid);
-                       return FALSE;
-               }
+       ret = wifi_manager_ap_get_security_type(ap, &security);
+       if (ret != WIFI_MANAGER_ERROR_NONE) {
+               msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
+                       test_wifi_mgr_convert_error_to_string(ret));
+               FREE(essid);
+               return FALSE;
+       }
 
-               msg("AP name " LOG_CYAN "[%s]" LOG_END ", Security [%s], State [%s], Rssi [%d]", essid,
+       if (test_wifi_mgr_compare_string(essid, g_ssid)) {
+               msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
                        test_wifi_mgr_sec_type_to_string(security),
-                       test_wifi_mgr_conn_state_to_string(state), rssi);
+                       test_wifi_mgr_conn_state_to_string(state),
+                       rssi);
 
                if (security != WIFI_MANAGER_SECURITY_TYPE_EAP) {
                        FREE(essid);
@@ -356,6 +369,7 @@ static bool __test_public_connect_found_wps_cb(wifi_manager_ap_h ap,
        int ret = WIFI_MANAGER_ERROR_NONE;
        char *essid = NULL;
        wifi_manager_connection_state_e state = WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED;
+       wifi_manager_security_type_e type = WIFI_MANAGER_SECURITY_TYPE_NONE;
        int rssi = 0;
        int wps_type = (int)strtol((char *)user_data, NULL, 10);
 
@@ -382,9 +396,19 @@ static bool __test_public_connect_found_wps_cb(wifi_manager_ap_h ap,
                return FALSE;
        }
 
+       ret = wifi_manager_ap_get_security_type(ap, &type);
+       if (ret != WIFI_MANAGER_ERROR_NONE) {
+               msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
+                       test_wifi_mgr_convert_error_to_string(ret));
+               FREE(essid);
+               return FALSE;
+       }
+
        if (test_wifi_mgr_compare_string(essid, g_ssid)) {
-               msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                       test_wifi_mgr_conn_state_to_string(state), rssi);
+               msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                       test_wifi_mgr_sec_type_to_string(type),
+                       test_wifi_mgr_conn_state_to_string(state),
+                       rssi);
 
                switch (wps_type) {
                case 1:
@@ -543,7 +567,7 @@ static int _test_public_connect_eap_ap(MManager *mm, struct menu_data *menu)
                return ret;
        }
 
-       if (eap_type > WIFI_MANAGER_EAP_TYPE_AKA) {
+       if (eap_type > WIFI_MANAGER_EAP_TYPE_PWD) {
                msg("Invalid parameter " LOG_RED "[EAP type]" LOG_END);
                return WIFI_MANAGER_ERROR_INVALID_PARAMETER;
        }
@@ -712,11 +736,11 @@ struct menu_data menu_public_connect_hidden_ap[] = {
 
 struct menu_data menu_public_connect_eap_ap[] = {
        { "1", "[SSID]", NULL, NULL, g_ssid},
-       { "2", "[Passphrase]", NULL, NULL, g_passphrase},
-       { "3", "[User name]", NULL, NULL, g_username},
-       { "4", "[EAP type] (0.PEAP/1.TLS/2.TTLS/3.SIM/4.AKA)", NULL, NULL, g_eap_type},
-       { "5", "[Certificate file]", NULL, NULL, g_certificate},
-       { "6", "[Auth type] (0.NONE/1.PAP/2.MSCHAP/3.MSCHAPv2/4.GTC/5.MD5)", NULL, NULL, g_auth_type},
+       { "2", "[User name]", NULL, NULL, g_username},
+       { "3", "[Passphrase]", NULL, NULL, g_passphrase},
+       { "4", "[EAP type] (0.PEAP/1.TLS/2.TTLS/3.SIM/4.AKA/5.AKA'/6.FAST/7.PWD)", NULL, NULL, g_eap_type},
+       { "5", "[Auth type] (0.NONE/1.PAP/2.MSCHAP/3.MSCHAPv2/4.GTC/5.MD5)", NULL, NULL, g_auth_type},
+       { "6", "[Certificate file]", NULL, NULL, g_certificate},
        { "c", LOG_LIGHTBLUE "[Connect]" LOG_END, NULL, _test_public_connect_eap_ap, NULL},
        { NULL, NULL, },
 };
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index b2eb882c4347be23add6d12a1a68a98d5ef9dcb3..e21b466f6405d21596671f6d6231fdf485a70971 100755 (executable)
@@ -41,6 +41,7 @@ static bool __test_public_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
        int ret = WIFI_MANAGER_ERROR_NONE;
        char *essid = NULL;
        wifi_manager_connection_state_e state;
+       wifi_manager_security_type_e type;
        int rssi = 0;
 
        ret = wifi_manager_ap_get_essid(ap, &essid);
@@ -66,8 +67,18 @@ static bool __test_public_found_ap_cb(wifi_manager_ap_h ap, void *user_data)
                return FALSE;
        }
 
-       msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-               test_wifi_mgr_conn_state_to_string(state), rssi);
+       ret = wifi_manager_ap_get_security_type(ap, &type);
+       if (ret != WIFI_MANAGER_ERROR_NONE) {
+               msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
+                       test_wifi_mgr_convert_error_to_string(ret));
+               FREE(essid);
+               return FALSE;
+       }
+
+       msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+               test_wifi_mgr_sec_type_to_string(type),
+               test_wifi_mgr_conn_state_to_string(state),
+               rssi);
 
        FREE(essid);
        return TRUE;
@@ -138,7 +149,7 @@ static bool __test_public_found_bssid_ap_cb(wifi_manager_ap_h ap, void *user_dat
                return FALSE;
        }
 
-       msg("Bssid [%s], Essid " LOG_CYAN "[%s]" LOG_END ", Rssi [%d]", bssid, essid, rssi);
+       msg("[%s]" LOG_CYAN "[%-35s]" LOG_END "[%d]", bssid, essid, rssi);
 
        FREE(bssid);
        FREE(essid);
index a3a0dd8a50f44398fded89d78f67443c44a37eff..574745ea1de881e39b579ccb61c46ae6dfcb4171 100755 (executable)
@@ -50,6 +50,7 @@ static bool __test_public_found_ip_method_cb(wifi_manager_ap_h ap, void *user_da
        int ret = WIFI_MANAGER_ERROR_NONE;
        char *essid = NULL;
        wifi_manager_connection_state_e state = WIFI_MANAGER_CONNECTION_STATE_FAILURE;
+       wifi_manager_security_type_e type = WIFI_MANAGER_SECURITY_TYPE_NONE;
        wifi_manager_ip_config_type_e config_type = (int)strtol(g_ip_config_type, NULL, 10);
        wifi_manager_address_family_e address_type = (int)strtol(g_ip_address_type, NULL, 10);
        wifi_manager_dns_config_type_e dns_type = (int)strtol(g_dns_type, NULL, 10);
@@ -78,9 +79,19 @@ static bool __test_public_found_ip_method_cb(wifi_manager_ap_h ap, void *user_da
                return FALSE;
        }
 
+       ret = wifi_manager_ap_get_security_type(ap, &type);
+       if (ret != WIFI_MANAGER_ERROR_NONE) {
+               msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
+                       test_wifi_mgr_convert_error_to_string(ret));
+               FREE(essid);
+               return FALSE;
+       }
+
        if (test_wifi_mgr_compare_string(essid, g_ssid)) {
-               msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                       test_wifi_mgr_conn_state_to_string(state), rssi);
+               msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                       test_wifi_mgr_sec_type_to_string(type),
+                       test_wifi_mgr_conn_state_to_string(state),
+                       rssi);
 
                msg(HR_SINGLE);
 
@@ -276,7 +287,8 @@ static bool __test_public_found_proxy_method_cb(wifi_manager_ap_h ap, void *user
        int ret = WIFI_MANAGER_ERROR_NONE;
        char *essid = NULL;
        wifi_manager_connection_state_e state = WIFI_MANAGER_CONNECTION_STATE_FAILURE;
-       wifi_manager_proxy_type_e type = (int)strtol(g_proxy_type, NULL, 10);
+       wifi_manager_security_type_e type = WIFI_MANAGER_SECURITY_TYPE_NONE;
+       wifi_manager_proxy_type_e proxy_type = (int)strtol(g_proxy_type, NULL, 10);
        wifi_manager_address_family_e address_type = (int)strtol(g_proxy_address_type, NULL, 10);
        int rssi = 0;
 
@@ -303,17 +315,27 @@ static bool __test_public_found_proxy_method_cb(wifi_manager_ap_h ap, void *user
                return FALSE;
        }
 
+       ret = wifi_manager_ap_get_security_type(ap, &type);
+       if (ret != WIFI_MANAGER_ERROR_NONE) {
+               msg("Failed to get security type for AP " LOG_RED "[%s]" LOG_END,
+                       test_wifi_mgr_convert_error_to_string(ret));
+               FREE(essid);
+               return FALSE;
+       }
+
        if (test_wifi_mgr_compare_string(essid, g_ssid)) {
-               msg("AP name " LOG_CYAN "[%s]" LOG_END ", State [%s], Rssi [%d]", essid,
-                       test_wifi_mgr_conn_state_to_string(state), rssi);
+               msg(LOG_CYAN "[%-35s]" LOG_END "[%5s][%s][%d]", essid,
+                       test_wifi_mgr_sec_type_to_string(type),
+                       test_wifi_mgr_conn_state_to_string(state),
+                       rssi);
 
                msg(HR_SINGLE);
 
                /* Proxy type */
-               ret = wifi_manager_ap_set_proxy_type(ap, type);
+               ret = wifi_manager_ap_set_proxy_type(ap, proxy_type);
                if (ret == WIFI_MANAGER_ERROR_NONE)
                        msg("Succeeded to set proxy type " LOG_CYAN "[%s]" LOG_END,
-                               test_wifi_mgr_proxy_type_to_string(type));
+                               test_wifi_mgr_proxy_type_to_string(proxy_type));
                else
                        msg("Failed to set proxy type " LOG_RED "[%s]" LOG_END,
                                test_wifi_mgr_convert_error_to_string(ret));
index 4c9c439a424ec8f2a6ca372af35d69970b600bf4..1b538920f033a35ab916a9096161d57db28b1658 100755 (executable)
@@ -54,8 +54,9 @@ static void __test_device_state_cb(wifi_manager_device_state_e state, void *user
        wifi_h = GPOINTER_TO_INT(user_data) == 1 ? g_wifi_h : g_wifi2_h;
        wifi_manager_get_network_interface_name(wifi_h, &if_name);
 
-       msg("[%d:%s] Device state changed callback, State [%s]",
-               GPOINTER_TO_INT(user_data), if_name, test_wifi_mgr_device_state_to_string(g_device_state));
+       msg("[%d:%s] Device state changed callback [%s]",
+               GPOINTER_TO_INT(user_data), if_name,
+               test_wifi_mgr_device_state_to_string(g_device_state));
 
        FREE(if_name);
 }
@@ -68,8 +69,9 @@ static void __test_scan_changed_cb(wifi_manager_scan_state_e state, void* user_d
        wifi_h = GPOINTER_TO_INT(user_data) == 1 ? g_wifi_h : g_wifi2_h;
        wifi_manager_get_network_interface_name(wifi_h, &if_name);
 
-       msg("[%d:%s] Scan changed, Scan state [%s]", GPOINTER_TO_INT(user_data),
-               if_name, test_wifi_mgr_scan_state_to_string(state));
+       msg("[%d:%s] Scan changed callback [%s]",
+               GPOINTER_TO_INT(user_data), if_name,
+               test_wifi_mgr_scan_state_to_string(state));
 
        FREE(if_name);
 }
@@ -85,18 +87,19 @@ static void __test_connection_state_cb(wifi_manager_connection_state_e state,
        wifi_h = GPOINTER_TO_INT(user_data) == 1 ? g_wifi_h : g_wifi2_h;
        wifi_manager_get_network_interface_name(wifi_h, &if_name);
 
-       msgn("[%d:%s] Connection state changed callback, State [%s]",
-               GPOINTER_TO_INT(user_data), if_name, test_wifi_mgr_conn_state_to_string(state));
-
        ret = wifi_manager_ap_get_essid(ap, &ap_name);
        if (ret != WIFI_MANAGER_ERROR_NONE) {
-               msg(", " LOG_RED "Failed to get AP name [%s]" LOG_END,
+               msg(LOG_RED "Failed to get AP name [%s]" LOG_END,
                        test_wifi_mgr_convert_error_to_string(ret));
-       } else {
-               msg(", AP name " LOG_CYAN "[%s]" LOG_END, ap_name);
-               FREE(ap_name);
+               FREE(if_name);
+               return;
        }
 
+       msg("[%d:%s] Connection state changed callback " LOG_CYAN "[%s]" LOG_END "[%s]",
+               GPOINTER_TO_INT(user_data), if_name, ap_name,
+               test_wifi_mgr_conn_state_to_string(state));
+
+       FREE(ap_name);
        FREE(if_name);
 }
 
@@ -108,7 +111,7 @@ static void __test_rssi_level_cb(wifi_manager_rssi_level_e rssi_level, void* use
        wifi_h = GPOINTER_TO_INT(user_data) == 1 ? g_wifi_h : g_wifi2_h;
        wifi_manager_get_network_interface_name(wifi_h, &if_name);
 
-       msg("[%d:%s] RSSI level changed callback, level [%d]",
+       msg("[%d:%s] RSSI level changed callback [%d]",
                GPOINTER_TO_INT(user_data), if_name, rssi_level);
 
        FREE(if_name);
@@ -122,8 +125,9 @@ static void __test_bg_scan_completed_cb(wifi_manager_error_e error_code, void* u
        wifi_h = GPOINTER_TO_INT(user_data) == 1 ? g_wifi_h : g_wifi2_h;
        wifi_manager_get_network_interface_name(wifi_h, &if_name);
 
-       msg("[%d:%s] Background scan completed, error code [%s]",
-               GPOINTER_TO_INT(user_data), if_name, test_wifi_mgr_convert_error_to_string(error_code));
+       msg("[%d:%s] Background scan completed [%s]",
+               GPOINTER_TO_INT(user_data), if_name,
+               test_wifi_mgr_convert_error_to_string(error_code));
 
        FREE(if_name);
 }
@@ -156,8 +160,9 @@ static void __test_get_wifi_module_state_cb(wifi_manager_module_state_e state, v
        wifi_h = GPOINTER_TO_INT(user_data) == 1 ? g_wifi_h : g_wifi2_h;
        wifi_manager_get_network_interface_name(wifi_h, &if_name);
 
-       msgn("[%d%s] Wi-Fi module state changed callback", GPOINTER_TO_INT(user_data), if_name);
-       msg(", Wi-Fi module [%s]", test_wifi_mgr_module_state_to_string(state));
+       msgn("[%d%s] Wi-Fi module state changed callback [%s]",
+               GPOINTER_TO_INT(user_data), if_name,
+               test_wifi_mgr_module_state_to_string(state));
 
        FREE(if_name);
 }
@@ -173,9 +178,9 @@ static void __test_tdls_state_cb(wifi_manager_tdls_state_e state, char *peer_mac
        msgn("[%d:%s] TDLS state changed callback", GPOINTER_TO_INT(user_data), if_name);
 
        if (state == WIFI_MANAGER_TDLS_STATE_CONNECTED)
-               msg(", state : TDLS connected, Peer MAC address [%s]", peer_mac_add);
+               msg("TDLS [Connected] Peer MAC address [%s]", peer_mac_add);
        else
-               msg(", state : TDLS disconnected, Peer MAC address [%s]", peer_mac_add);
+               msg("TDLS [Disconnected] Peer MAC address [%s]", peer_mac_add);
 
        FREE(if_name);
 }
@@ -189,13 +194,13 @@ static void __test_tdls_discover_cb(wifi_manager_tdls_discovery_state_e state,
        wifi_h = GPOINTER_TO_INT(user_data) == 1 ? g_wifi_h : g_wifi2_h;
        wifi_manager_get_network_interface_name(wifi_h, &if_name);
 
-       msgn("[%d:%s] TDLS discover callback", GPOINTER_TO_INT(user_data), if_name);
+       msgn("[%d:%s] TDLS discover callback ", GPOINTER_TO_INT(user_data), if_name);
 
-       msgn(", Peer MAC address [%s], state [%d]", peer_mac_add, state);
+       msgn("Peer MAC address [%s] state [%d] ", peer_mac_add, state);
        if (state == WIFI_MANAGER_TDLS_DISCOVERY_STATE_ONGOING)
-               msg("Discovery is ongoing");
+               msg("Discovery is ongoing");
        else
-               msg("Discovery is finished");
+               msg("Discovery is finished");
 
        FREE(if_name);
 }
@@ -209,9 +214,9 @@ static void __test_dpp_event_cb(wifi_manager_dpp_event_e event,
        wifi_h = GPOINTER_TO_INT(user_data) == 1 ? g_wifi_h : g_wifi2_h;
        wifi_manager_get_network_interface_name(wifi_h, &if_name);
 
-       msgn("[%d:%s] DPP event callback", GPOINTER_TO_INT(user_data), if_name);
+       msgn("[%d:%s] DPP event callback ", GPOINTER_TO_INT(user_data), if_name);
 
-       msg(", event [%s]", test_wifi_mgr_dpp_event_to_string(event));
+       msg("event [%s] ", test_wifi_mgr_dpp_event_to_string(event));
        if (event == WIFI_MANAGER_DPP_EVENT_STATE_CHANGED)
                msg("state [%s]", test_wifi_mgr_dpp_state_to_string(state));