Android 蓝牙学习 @# Android 蓝牙
文章目录
- 1.sBluetoothInterface->enable()
-
- 1.1 sBluetoothInterface解析
- 1.2 sBluetoothInterface->enable
- 1.3 bt_interface_t->enable
- 1.4 start_up_stack_async
- 1.5 event_start_up_stack
- 1.6 module_start_up(get_local_module(HCI_MODULE));
- 1.7 hci_module_start_up
- 1.8 hci_initialize
- 1.9 BluetoothHci::initialize_1_1
- 1.10 VendorInterface::Initialize
- 1.11 VendorInterface::Open
- 1.12 bt_vendor_interface_t 定义
- 1.13 bt_vendor_interface_t.init
Android 12 Bluetooth Open[2]讲到了JNI获取了Bluedroid协议栈的操作接口结构体bt_interface_t,调用了sBluetoothInterface->enable() 打开蓝牙。
继续看sBluetoothInterface
1.sBluetoothInterface->enable()
1.1 sBluetoothInterface解析
sBluetoothInterface来自于Bluetooth.apk 开机启动自动加载JNI.so
在Android 12 Bluetooth Open[1]中1.3 Bluetooth.apk启动有提到,这里贴出
1.1.1 classInitNative
packages/apps/Bluetooth
本文详细介绍了Android 12中Bluetooth的开启流程,从sBluetoothInterface->enable()开始,涉及sBluetoothInterface解析、加载libbluetooth.so、启动蓝牙协议栈及 HCI 模块初始化,最后到VendorInterface的初始化和硬件交互。通过VendorInterface,厂商可以按照规定的接口实现与Android系统的对接。
订阅专栏 解锁全文


被折叠的 条评论
为什么被折叠?



