Enable WIFI时frameworks 在哪启动wpa_supplicant?

Enable WIFI时frameworks 在哪启动wpa_supplicant?

Android Frameworks中的代码流程大致如下:

    private boolean startSupplicant() {
        synchronized (mLock) {
            if (!mIfaceMgr.hasAnyStaIfaceForConnectivity()) {
                if (!startAndWaitForSupplicantConnection()) {
                    Log.e(TAG, "Failed to connect to supplicant");
                    return false;
                }
                if (!mSupplicantStaIfaceHal.registerDeathHandler(
                        new SupplicantDeathHandlerInternal())) {
                    Log.e(TAG, "Failed to register supplicant death handler");
                    return false;
                }
            }
            return true;
        }
    }
service wpa_supplicant /vendor/bin/hw/wpa_supplicant -g@android:wpa_wlan0 -G1010 -O/data/vendor/wifi/wpa/sockets -Dnl80211 -iwlan0 -c /vendor/etc/wifi/wpa_supplicant.conf -N -Dnl80211 -ip2p0 -c /data/vendor/wifi/wpa/p2p_supplicant.conf -puse_p2p_group_interface=1 -d
    interface android.hardware.wifi.supplicant@1.0::ISupplicant default
    interface android.hardware.wifi.supplicant@1.1::ISupplicant default
    interface android.hardware.wifi.supplicant@1.2::ISupplicant default
    class main
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot

系统需要配置:android.hardware.wifi.supplicant.xml

<manifest version="1.0" type="device">
    <hal format="hidl">
        <name>android.hardware.wifi.supplicant</name>
        <transport>hwbinder</transport>
        <version>1.4</version>
        <interface>
            <name>ISupplicant</name>
            <instance>default</instance>
        </interface>
    </hal>
</manifest>

 HAL 系统启动wpa_supplicant服务时的log如下:

04-14 10:37:43.970   850  1213 I SupplicantStaIfaceHal: Starting supplicant using HIDL
04-14 10:37:43.971   850   942 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.net.wifi.WIFI_STATE_CHANGED flg=0x4000010 (has extras) } to org.droidtv.tv.tptvservice/.tvinfo.WifiInfoReceiver
04-14 10:37:43.971   206   206 I hwservicemanager: Since android.hardware.wifi.supplicant@1.0::ISupplicant/default is not registered, trying to start it as a lazy HAL.
04-14 10:37:43.971  1724  1724 D CommonHelperService: Receive:WIFI_STATE_CHANGED_ACTION
04-14 10:37:43.971   850  1213 D SupplicantStaIfaceHal: Successfully triggered start of supplicant using HIDL
01-01 09:05:00.300     1     1 I init    : Control message: Processed ctl.interface_start for 'android.hardware.wifi.supplicant@1.0::ISupplicant/default' from pid: 206 (/system/bin/hwservicemanager)
04-14 10:37:44.011 15900 15900 D wpa_supplicant: wpa_supplicant v2.10-devel-12
04-14 10:37:44.012 15900 15900 D wpa_supplicant: Global control interface '@android:wpa_wlan0'

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值