} else {
msg("[1] Failed to initialize wifi handle " LOG_RED "[%s]" LOG_END,
test_wifi_mgr_convert_error_to_string(ret));
+ return ret;
}
ret = wifi_manager_initialize(&g_wifi2_h);
} else {
msg("[2] Failed to initialize wifi handle " LOG_RED "[%s]" LOG_END,
test_wifi_mgr_convert_error_to_string(ret));
+ return ret;
}
+ ret = wifi_manager_is_activated(g_wifi_h, &state);
+ wifi_manager_get_network_interface_name(g_wifi_h, &if_name);
if (ret == WIFI_MANAGER_ERROR_NONE) {
- ret = wifi_manager_is_activated(g_wifi_h, &state);
- wifi_manager_get_network_interface_name(g_wifi_h, &if_name);
- if (ret == WIFI_MANAGER_ERROR_NONE) {
- g_device_state = state;
- msg("[1:%s] Wi-Fi device state " LOG_CYAN "[%s]" LOG_END, if_name,
+ g_device_state = state;
+ msg("[1:%s] Wi-Fi device state " LOG_CYAN "[%s]" LOG_END, if_name,
test_wifi_mgr_device_state_to_string(g_device_state));
- } else {
- msg("[1] Failed to get Wi-Fi device state " LOG_RED "[%s]" LOG_END,
+ } else {
+ msg("[1] Failed to get Wi-Fi device state " LOG_RED "[%s]" LOG_END,
test_wifi_mgr_convert_error_to_string(ret));
- }
- FREE(if_name);
}
+ FREE(if_name);
return ret;
}
} else {
msg("[1] Failed to initialize wifi handle " LOG_RED "[%s]" LOG_END,
test_wifi_mgr_convert_error_to_string(ret));
+ return ret;
}
ret = wifi_manager_initialize_with_interface_name(&g_wifi2_h, g_ifname);
} else {
msg("[2] Failed to initialize wifi handle " LOG_RED "[%s]" LOG_END,
test_wifi_mgr_convert_error_to_string(ret));
+ return ret;
}
+ ret = wifi_manager_is_activated(g_wifi_h, &state);
+ wifi_manager_get_network_interface_name(g_wifi_h, &if_name);
if (ret == WIFI_MANAGER_ERROR_NONE) {
- ret = wifi_manager_is_activated(g_wifi_h, &state);
- wifi_manager_get_network_interface_name(g_wifi_h, &if_name);
- if (ret == WIFI_MANAGER_ERROR_NONE) {
- g_device_state = state;
- msg("[1:%s] Wi-Fi device state " LOG_CYAN "[%s]" LOG_END, if_name,
+ g_device_state = state;
+ msg("[1:%s] Wi-Fi device state " LOG_CYAN "[%s]" LOG_END, if_name,
test_wifi_mgr_device_state_to_string(g_device_state));
- } else {
- msg("[1] Failed to get Wi-Fi device state " LOG_RED "[%s]" LOG_END,
+ } else {
+ msg("[1] Failed to get Wi-Fi device state " LOG_RED "[%s]" LOG_END,
test_wifi_mgr_convert_error_to_string(ret));
- }
- FREE(if_name);
}
+ FREE(if_name);
return ret;
}