Bluetooth, wifi,3g as the most common dongle mobile platform, Bluetooth is now widely used, especially now popular intelligent terminal, multi-point mutual control, wifi,3g and other resource consumption, infrared and the limitations of the distance and obstacles, so said Bluetooth communication in the future do not say, The use of single on the smart TV will be more and more extensive. Here is a preliminary understanding of learning, after which will be a layer from kernel to application
Writing is not easy, reprint need to indicate the source: http://blog.csdn.net/jscese/article/details/41283879
Structure level:
Let's look at a hierarchy chart:
You can see that it's roughly divided into three parts,
Java:
The top level is the application framework, an API for application use,
Java Layer API Class source code path:framework/base/core/java/android/bluetooth
and Bluetooth services under Packages/apps/bluetooth/src/com/android/bluetooth (compiled into the system in bluetooth.apk form)
Native Space:
The second layer starts with the local JNI called by the service call to the above Packages/apps/bluetooth, and invokes the definition in the hardware/libhardware/include/hardware/bluetooth.h hardware/libhardware/include/hardware/bt_*.h hardware ( ),
The implementation of bluetooth.default.so is placed in external/bluetooth/bluedroid
This is the core protocol stack of Bluetooth.
Can be seen divided into several parts, followed by a description of the role of the respective representatives
There is an abstract interface protocol layer HCI, which is used to connect with different manufacturers of Vendor, Vendor HCI is required to implement the necessary interfaces
Kernel
At the bottom of the kernel layer, Linux is the generic driver, here are Linux for Bluetooth operation related to the driver module
Before the Android version I do not know, but the online said android4.2 relative than before, Bluetooth changes very large, the original BlueZ replaced with bluedroid (that is, external), the original set in the framework of Bluetooth Service JNI is changed to the app in the package,
As far as I am currently debugging,/system/bluetooth is not used.
Module diagram:
This is a picture from Google's official website http://source.android.com/devices/bluetooth.html:
This is from application to Vendor, where the module in the Bluetooth Stack is made up of a Bluetooth application Layer(abbreviated as BTA) and bluetooth Embedded System(abbreviated as BTE) consists of two major parts.
BTA implements Bluetooth device management, state management, and some application specifications to interact with the Android framework.
BTE through HCI and the manufacturer of Bluetooth chip to achieve the Bluetooth protocol stack common functions and related protocols. In addition, the BTE includes a unified kernel interface (GKI) that allows Bluetooth chip manufacturers to quickly and easily migrate the Bluetooth protocol stack with GKI.
Subsequent analysis of each level of the module operation and up and down interaction ~
A brief introduction to Bluetooth android--4.2 (i.)