Android wifi框架

Android wifi框架_第1张图片

文章目录

        • Wifi Service In System Service
          • WifiService
          • WifiController
          • WifiStateMachine
        • Wifi模块代码

Wifi Service In System Service

WifiService

WifiService: Implements the IWifiManager 3rd party API. The API and the device state information (screen on/off, battery state, sleep policy) go as input into the WifiController which tracks high level states as to whether STA or AP mode is operational and controls the WifiStateMachine to handle and shut down.

实现IWifiManager第三方API。API和设备信息(比如屏幕亮/暗,电量状态,睡眠方案)作为WifiController的输入。WifiController跟踪高级别状态(STA或者AP模式是否可用)并且控制WifiStateMachine

WifiController
  • WifiController: Acts as a controller to the WifiStateMachine based on various inputs (API and device state). Runs on the same thread created in WifiService.

    基于各种API和设备状态的输入,充当WifiStateMachine的控制器。和WifiService运行在同一个线程

  • WifiSettingsStore: Tracks the various settings (wifi toggle, airplane toggle, tethering toggle, scan mode toggle) and provides API to figure if wifi should be turned on or off.

    跟踪各种用户设置(wifi,飞行模式,网络分享,扫描模式的切换),并将这些设置提供给API,去计算出wifi需要开还是关

  • WifiTrafficPoller: Polls traffic on wifi and notifies apps listening on it.

    wifi传输量轮询:轮询wifi传输量,通知监听传输量的app

  • WifiNotificationController: Controls whether the open network notification is displayed or not based on the scan results.

    控制wifi扫描结果中的开放网络是否通过notification通知给用户

WifiStateMachine
  • WifiStateMachine: Tracks the various states on STA and AP connectivity and handles

    跟踪STA和AP连接的各种状态。控制开启和关闭

Wifi模块代码

  1. Wifi Settings应用程序

packages/apps/Settings/src/com/android/settings/wifi

  1. Wifi Framework

frameworks/base/wifi/java/android/net/wifi (UI通过android.net.wifi package发送命令给wifi.c)
frameworks/base/core/java/android/net(更高一级的网络管理)
frameworks/base/services/java/com/android/server

  1. Wifi JNI

frameworks/base/core/jni/android_net_wifi_Wifi.cpp

  1. Wifi Hardware (wifi管理库)

hardware/libhardware_legacy/wifi/wifi.c

  1. wpa_supplicant(wifi tool) external/wpa_supplicant8
  • wpa_client (生成库libwpaclient.so)
    external/wpa_supplicant_8/wpa_supplicant/src/common/wpa_ctrl.c
  • wpa_server (生成守护进程wpa_supplicant)
    external/wpa_supplicant_8/wpa_supplicant/main.c
  1. Wifi kernel

net/wireless drivers/wlan_xxx arch/arm/mach-xxx/wlan_pm.c

你可能感兴趣的:(Android,WLAN,wifi,wlan)