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/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/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/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 China's National Standard for WLAN-GB 15629.11, and is compatible with 802.11i. In 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.