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);
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)
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)
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);
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);
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)
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);
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";
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);
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;
}
}
- 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)
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);
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);
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);
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:
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;
}
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, },
};
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);
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;
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);
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);
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);
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;
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));
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);
}
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);
}
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);
}
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);
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);
}
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);
}
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);
}
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);
}
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));