/***********************************************************************
* I.MX6 wpa_applicant 开启 debug 输出
* 说明:
* 当我们在使用一些工具的时候,为了有助于调试,打开调试功能很多时候
* 是一种需求。
*
* 2016-6-28 深圳 南山平山村 曾剑锋
**********************************************************************/ 一、修改:
external/wpa_supplicant_8/src/utils/wpa_debug.c
......
// int wpa_debug_level = MSG_INFO;
int wpa_debug_level = MSG_DEBUG;
......
void wpa_printf(int level, const char *fmt, ...) {
va_list ap; va_start(ap, fmt);
if (level >= wpa_debug_level) {
#ifdef CONFIG_ANDROID_LOG
__android_log_vprint(wpa_to_android_level(level),
ANDROID_LOG_NAME, fmt, ap);
#else /* CONFIG_ANDROID_LOG */
......
} 二、logcat查看运行效果:
D/wpa_supplicant( ): wpa_supplicant v2.-devel-4.2.2_rtw_r8680.
D/wpa_supplicant( ): random: Trying to read entropy from /dev/random
I/wpa_supplicant( ): Successfully initialized wpa_supplicant
D/wpa_supplicant( ): Initializing interface 'wlan0' conf '/etc/wifi/wpa_supplicant.conf' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'
D/wpa_supplicant( ): Configuration file '/etc/wifi/wpa_supplicant.conf' -> '/etc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( ): Reading configuration file '/etc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( ): update_config=
D/wpa_supplicant( ): ctrl_interface='/data/misc/wifi/sockets'
D/wpa_supplicant( ): eapol_version=
D/wpa_supplicant( ): ap_scan=
D/wpa_supplicant( ): fast_reauth=
E/wpa_supplicant( ): wlan0: Unsupported driver 'nl80211'
D/wpa_supplicant( ): Failed to add interface wlan0
D/wpa_supplicant( ): wlan0: Cancelling scan request
D/wpa_supplicant( ): wlan0: Cancelling authentication timeout