Android蓝牙Java层结构图

      +-----------------------------------------------+                                                              
      | /frameworks/base/core/java/android/bluetooth  |                                                              
      |                                               |                                                              
      |  +------------------+                         |    +--------------------------------------------------------+
      |  | BluetoothManager |                         |    | /frameworks/base/services/core/java/com/android/server |
      |  +------------------+                         |    |                                                        |
      |                         +-------------------+ |    |  +------------------------+                            |
      |  +----------------+  +--> IBluetoothManager +---------> BluetoothManagerService|                            |
      |  |BluetoothAdapter|  |  +-------------------+ |    |  +------------------------+                            |
      |  +----------------+  |                        |  +----+ mBluetooth             |                            |
      |  |mService        +--+   +-------------+      |  | |  +------------------------+                            |
      |  |mManagerService |  |   |             |      |  | |                                                        |
      |  +----------------+  +---> IBluetooth  <---------+ +--------------------------------------------------------+
      |                          |             |      |                                                              
      |   +----------------+     +-------------+-------------------+                                                 
      |   |    Profiles    |                          |            |                                                 
      |   +----------------+                          |            |                                                 
      |   |  mService      |     +---------------+    |            |                                                 
      |   +---+------------+     |BluetoothGatt  |    |            |                                                 
      |       |                  +---------------+    |            |                                                 
      |   +---v----------------+ +---------------+    |            |                                                 
+---------> IBluetooth***.aidl | |Bluetooth LE   |    |            |                                                 
|     |   +--------------------+ +---------------+    |            |                                                 
|     |                                               |            |                                                 
|     +-----------------------------------------------+            |                                                 
|                                                                  |                                                 
|                                                                  |                                                 
|    +------------------------------------------------------------------------------+                                
|    |  /android/packages/apps/Bluetooth(apk)                      |                |                                
|    |                                                             |                |                                
|    |                                                             |                |                                
|    | +--------------------------------------+         +----------v-----+          |                                
+------+ ProfileServices(OPP, PAN, A2DP, etc) |         | AdapterService |          |                                
     | +----------------+---------------------+         +----------------+          |                                
     |                  |                                                           |                                
     |                  |                               +-----------------------+   |                                
     |                  |                               | AdapterState(Machine) |   |                                
     | +----------------v---------------------+         +-----------------------+   |                                
     | | ProfileStateMachines(A2DP, HFP, etc) |                                     |                                
     | +----------+---------------------------+         +------------------+        |                                
     |            |                                     | BondStateMachine |        |                                
     |            |                                     +------------------+        |                                
     |            |                                                                 |                                
     |         +--v----+                                                            |                                
     +-----------|JNI|--------------------------------------------------------------+                                
               +--+----+                                                                                             
                  |                                                                                                  
            +--------------+                                                                                         
            | Native Layer |                                                                                         
            +--------------+                                                                                         

发表评论

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据