Implementation of WLAN on Android

Source: Internet
Author: User

As we all know, Android is based on the Linux kernel, so it directly supports the Linux WLAN interface. The kernel driver of WLAN is dynamically loaded based on user settings on the UI. the control and security of WLAN are achieved through ctrl_interface and openssl, and TCPIP is implemented based on WLAN standards.

The architecture of WLAN on Android is as follows:

Application Framework: base/wifi/java/android/net/wifi

WifiManager/WifiMonitor/WifiConfiguration...

Service Framework: base/services/java/com/android/server/

WifiService/WifiWatchdogService

JNI (Java Native Interface)

Jni/android_net_wifi_Wifi.cpp

HAL (Hardware Abstract Layer)

Hardware/libhardware/wifi. c

Wpa_supplicant/ctrl_interface

Kernel driver

The process for enabling WIFI on an Android phone is as follows:

1) Application Framework: WifiManager

SetWifiEnabled ()

2) Service: WifiService

SetWifiEnabled ()

HandleMessage (): MESSAGE_ENABLE_WIFI

3) JNI: android_net_wifi_Wifi.cpp:

JNINativeMethod: loadDriver

Android_net_wifi_loadDriver ()

4) HAL: hardware/libhardware/wifi. c

Wifi_load_driver ()

5) Kernel: load the Kernel driver

 

The WLAN search process is as follows:

1) Application Framework: WifiManager

StartScan ()

2) Service:

WifiService: startScan ()

WifiNative: scanCommand ();

3) JNI: android_net_wifi_Wifi.cpp:

JNINativeMethod: scanCommand/scanResultsCommand

Android_net_wifi_scanCommand/android_net_wifi_scanResultsCommand

4) HAL: hardware/libhardware/wifi. c

Wifi_send_command: SCAN/SCAN_RESULTS

Wpa_supplicant/driver_wext.c

Wpa_driver_wext_scan (): SIOCSIWSCAN

5) Kernel: Command for WLAN driver to process related interfaces

WAPI is the national standard for WLAN in China-GB 15629.11, and is compatible with 802.11i. To implement WAPI on Android, you only need to add corresponding authentication.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.