I.MX6 wpa_applicant 开启 debug 输出

/***********************************************************************
 *                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( 3980): wpa_supplicant v2.0-devel-4.2.2_rtw_r8680.20130821
    D/wpa_supplicant( 3980): random: Trying to read entropy from /dev/random
    I/wpa_supplicant( 3980): Successfully initialized wpa_supplicant
    D/wpa_supplicant( 3980): Initializing interface 'wlan0' conf '/etc/wifi/wpa_supplicant.conf' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'
    D/wpa_supplicant( 3980): Configuration file '/etc/wifi/wpa_supplicant.conf' -> '/etc/wifi/wpa_supplicant.conf'
    D/wpa_supplicant( 3980): Reading configuration file '/etc/wifi/wpa_supplicant.conf'
    D/wpa_supplicant( 3980): update_config=1
    D/wpa_supplicant( 3980): ctrl_interface='/data/misc/wifi/sockets'
    D/wpa_supplicant( 3980): eapol_version=1
    D/wpa_supplicant( 3980): ap_scan=1
    D/wpa_supplicant( 3980): fast_reauth=1
    E/wpa_supplicant( 3980): wlan0: Unsupported driver 'nl80211'
    D/wpa_supplicant( 3980): Failed to add interface wlan0
    D/wpa_supplicant( 3980): wlan0: Cancelling scan request
    D/wpa_supplicant( 3980): wlan0: Cancelling authentication timeout

 

posted on 2016-06-28 16:44  zengjf  阅读(901)  评论(0编辑  收藏  举报

导航