Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92

当上一次有连接过wifi,下次开机默认wifi有打开的情况下,系统会自动连接上最佳的无线网络。
手动连接和选择最优网络前面有提过了,这里给出自动连接的流程。

流程:
processMessage -> //SupplicantStartedState, 起来后会获取scan resulut: cmd:WifiMonitor.SCAN_RESULTS_EVENT 
 setScanResults ->
 mWifiAutoJoinController.newSupplicantResults -> //attemptAutoJoin为true,设置里手动连接的时候是false
  newSupplicantResults -> WifiAutoJoinController.java
  attemptAutoJoin -> //Wifi的auto join机制
  compareWifiConfigurations //如果之前有连过多个无线网络,会根据评分规则以及用户选择得到最优网络
  mWifiStateMachine.sendMessage -> //发送自动连接给wifi状态机WifiStateMachine.CMD_AUTO_CONNECT
  processMessage -> //ConnectModeState,当前状态是DisconnectedState,上面SupplicantStartedState和这里的状态只是父类调用而已
   mWifiConfigStore.saveNetwork //保存网络
   mWifiConfigStore.selectNetwork //选择前面计算出的最佳网络并使能

调试log:

07-06 15:41:00.357 557 608 D WifiAutoJoinController : attemptAutoJoin() status=wpa_state=SCANNING
07-06 15:41:00.357 557 608 D WifiAutoJoinController : p2p_device_address=b2:f1:ec:49:50:cb
07-06 15:41:00.357 557 608 D WifiAutoJoinController : address=b0:f1:ec:49:50:cb
07-06 15:41:00.357 557 608 D WifiAutoJoinController : uuid=544ae0ce-fa0a-58d2-af21-81be288cb44c
07-06 15:41:00.358 557 608 D WifiAutoJoinController : attemptAutoJoin() num recent config 2 —> suppNetId=-1
07-06 15:41:00.358 557 608 D WifiAutoJoinController : attemptAutoJoin good candidate seen, bumped hard -> status=”Kris”WPA_PSK status=0
07-06 15:41:00.358 557 608 D WifiAutoJoinController : attemptAutoJoin trying id=1 “Kris”WPA_PSK status=0
07-06 15:41:00.359 557 608 D WifiAutoJoinController : attemptAutoJoin good candidate seen, bumped hard -> status=”RD-TA100-2.4G”WPA_PSK status=0
07-06 15:41:00.359 557 608 D WifiAutoJoinController : attemptAutoJoin trying id=0 “RD-TA100-2.4G”WPA_PSK status=0 current candidate “Kris”WPA_PSK
07-06 15:41:00.359 557 608 D WifiAutoJoinController : attemptAutoJoin will compare candidate “Kris”WPA_PSK with “RD-TA100-2.4G”WPA_PSK
07-06 15:41:00.359 557 608 D WifiAutoJoinController : compareWifiConfigurationsRSSI: “Kris”WPA_PSK rssi=-55,-127 boost=0 “RD-TA100-2.4G”WPA_PSK rssi=-47,-127 boost=0
07-06 15:41:00.359 557 608 D WifiAutoJoinController : “Kris”WPA_PSK is5=false score=-55 “RD-TA100-2.4G”WPA_PSK is5=false score=-47
07-06 15:41:00.359 557 608 D WifiAutoJoinController : compareWifiConfigurationsRSSI “Kris”WPA_PSK rssi=(-55,-127) num=(1,0) < “RD-TA100-2.4G”WPA_PSK rssi=(-47,-127) num=(1,0) -> 8
07-06 15:41:00.360 557 608 D WifiAutoJoinController : compareWifiConfigurations prefers “Kris”WPA_PSK over “RD-TA100-2.4G”WPA_PSK due to user choice of 60 order -> -52
07-06 15:41:00.360 557 608 D WifiAutoJoinController : compareWifiConfigurations: “Kris”WPA_PSK > “RD-TA100-2.4G”WPA_PSK order -52
07-06 15:41:00.360 557 608 D WifiAutoJoinController : attemptAutoJoin compareWifiConfigurations returned -52
07-06 15:41:00.360 557 608 D WifiAutoJoinController : attemptAutoJoin networkSwitching candidate “Kris”WPA_PSK linked=false : delta=1000
07-06 15:41:00.361 557 608 D WifiStateMachine: shouldSwitchNetwork txSuccessRate=0.00 rxSuccessRate=0.00 delta 1000 -> 1000
07-06 15:41:00.361 557 608 D WifiAutoJoinController : AutoJoin auto connect with netId 1 to “Kris”WPA_PSK
07-06 15:41:00.361 557 608 D WifiAutoJoinController : attemptRoam: “Kris”WPA_PSK Found ee:29:f5:be:c5:6b rssi=-55 freq=2437
07-06 15:41:00.361 557 608 D WifiAutoJoinController : Done attemptAutoJoin status=3
07-06 15:41:00.364 557 608 D WifiStateMachine: handleMessage: X
07-06 15:41:00.365 557 608 D WIFI : got request NetworkRequest [ id=1, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
07-06 15:41:00.365 557 608 D WIFI_UT : got request NetworkRequest [ id=1, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
07-06 15:41:00.365 557 608 D WifiStateMachine: handleMessage: E msg.what=131215
07-06 15:41:00.365 557 608 D WifiStateMachine: processMsg: DisconnectedState
07-06 15:41:00.369 557 608 D WifiStateMachine: processMsg: ConnectModeState
07-06 15:41:00.374 557 608 D WifiStateMachine: CMD_AUTO_CONNECT sup state ScanState my state DisconnectedState nid=1 roam=3
07-06 15:41:00.374 557 608 E WifiConfigStore: saveWifiConfigBSSID Setting BSSID for “Kris”WPA_PSK to any
07-06 15:41:00.382 557 608 D WifiStateMachine: CMD_AUTO_CONNECT will save config -> “Kris” nid=1
07-06 15:41:00.452 557 608 D WifiStateMachine: CMD_AUTO_CONNECT did save config -> nid=1
07-06 15:41:00.456 867 867 I wpa_supplicant: wlan0: Trying to associate with ee:29:f5:be:c5:6b (SSID=’Kris’ freq=2437 MHz)
07-06 15:41:00.458 557 608 E WifiConfigStore: rewrite network history for “Kris”WPA_PSK

[RK3288][Android6.0] WiFi之开机自动连接过程相关推荐

  1. android6.0 wifi流程,[RK3288][Android6.0] WiFi之从Linkspeed看获取流程

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 WiFi的(Link speed)连接速度可以从Settings里查看 从连接速度来看下获取WiF ...

  2. [RK3288][Android6.0] WiFi之PNO功能了解

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 概念: PNO 即Preferred Network Offload,用于系统在休眠的时候连接Wi ...

  3. android删除wifi配置,[RK3288][Android6.0] WiFi之无线网络配置的忘记(移除)过程

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 ,这里看一下它的移除过程是怎样的,当选择界面的FORGET时,会触发以下流程调用. onForge ...

  4. [RK3288][Android6.0] WiFi的dts配置说明(AP6335)

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 原理图 配置文件 参考 使用的是AP6335, 硬件上用的是SDIO0. 原理图: 配置文件: 电 ...

  5. [RK3288][Android6.0] WiFi之NetworkFactory形成的评分机制

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 NetworkFactory作为网络评分机制中一个重要角色而存在,每个模块实现需要继承Networ ...

  6. [RK3288][Android6.0] WiFi之NetworkAgent对评分的更新

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 上一篇看了NetworkFactory的使用过程,它是在系统初始化时就被创建,接下来在接入网络时N ...

  7. android开启热点softap模式,[RK3288][Android6.0] Wifi开启热点(SoftAP)流程小结

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 在Settings中选择要打开wifi热点功能: 调用流程如下: onPreferenceChan ...

  8. [RK3288][Android6.0] WiFi之wpa_supplicant扫描过程

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 wpa_supplicant_req_scan -> wpa_supplicant_scan ...

  9. [RK3288][Android6.0] WiFi之cfg80211知识点小结

    Platform: Rockchip OS: Android 6.0 Kernel: 3.10.92 概念: cfg80211是Linux 802.11用于管理配置的一套API,它是用户和驱动之间的桥 ...

最新文章

  1. 天津春考计算机重点知识,天津春考第一学期期中试卷(计算机基础)
  2. 以非生产模式的方式启用SAP Spartacus的服务器端渲染SSR
  3. VC程序在没装VC的机器中运行
  4. mysql 会话级别的参数_PostgreSQL的参数设置级别及查询各级别的参数值
  5. Spring Cloud Alibaba到底坑不坑?反正是解放了部分使用的繁琐!
  6. Java小白版聊天室1.0版本
  7. matlab画图命令plot,matlab画图命令plot
  8. 微信公众号实现消息模板的推送
  9. 计算机技术专硕学哪些课程,计算机专业考研需要考哪些科目
  10. 极坐标弧长积分公式简单理解 极坐标求面积的公式,dθ 弧长积分公式,rd​原理; 极坐标弧积分
  11. oracle中的than,range分区values less than,代表的是小于等于还是小于啊。
  12. EMV学习过程中问题解决及汇总
  13. chrome android 功能大全,Android版Chrome 55 大更新,多个新功能袭来
  14. vue v-for和v-if同时使用
  15. 英文seo,英文seo怎么样
  16. oracle consistent gets,consistent gets在Oracle使用特例
  17. matlab中eye函数、ones函数
  18. 软件著作权侵权的裁判要点
  19. 【调剂】上海海事大学2022年硕士研究生调剂公告
  20. 2017——腾讯产培生笔试、面经

热门文章

  1. 超级狗是集软件授权、课件保护和身份认证于一身的加密狗。
  2. 我在传智播客上课的感受
  3. 微信小程序——按时间逆序排序
  4. Redis 5 集群扩容、缩容详解
  5. 服务器设置桌面快捷方式,Win7系统将IIS服务器发送到桌面快捷方式的方法
  6. 一次简单的防接口攻击
  7. DCANet:Learning Connected Attentions for Convolutional Neural Networks
  8. [0CTF 2016]piapiapia -php序列化溢出
  9. 如何为你的机器学习问题选择合适的算法?
  10. java c pho_Java PHO库中的行为设置方法