笔记之Android Bluetooth Input 连接流程小记
来源:互联网 发布:百视通软件下载 编辑:程序博客网 时间:2024/06/05 04:01
1. 当用户在setting的bluetooth device list中选择了input设备后会触发起所有profile的connect操作,input设备在Setting中叫做HidProfile.java.
值得我们注意的是Android的BluetoothInputDevice是通过getProfileProxy的方法取得的,这点并不同于HFP或HSP.
2. HidProfile通过调用BluetoothInputDevice的connect,如果是有效的设备则BluetoothInputDevice会直接调用bluetoothservice的connectInputDevice函式。
3. 其中bluetoothservice也就是简单的调用了BluetoothInputProfileHandler的connectInputDevice函式。connectInputDevice会向BluetoothDeviceProfileState发送CONNECT_HID_OUTGOING消息。
Framework中包含了很多profilehandler, 这些Handler有个共同的特点是都包含了一个此profile的设备列表。
4. BluetoothDeviceProfileState会切至OutgoingHidstate.此时OutgoingHid将deferMessageCONNECT_HID_OUTGOING消息并且交由BluetoothDeviceProfileState类的processCommand处理,在些它调用了BluetoothService的connectInputDeviceInternal.
5. 在些BluetoothService又去调用了mBluetoothInputProfileHandler的connectInputDeviceInternal,在其中其调用了jni方法BluetoothService的connectInputDeviceNative方法。此时的DBUS调用为异步调用。
6. 当Bluez在Input接口上连接成功后,会调用之前注册的onInputDeviceConnectionResult函数,(onInputDeviceConnectionResult是EventLoop中的函数)。
7. onInputDeviceConnectionResult将解析bluez返回的path,其格式中包含了address,所以androide有替换”_”到”:”. 后呼叫了BluetoothService的handleInputDevicePropertyChange去通过mBluetoothInputProfileHandler更新其中设备的连接状态。
- 笔记之Android Bluetooth Input 连接流程小记
- 笔记之Android Bluetooth OOP 传送文件流程小记
- Android: Bluetooth Input 连接流程分析
- [Bluetooth]: android 平台上BLE连接流程之优化方案
- Android之input系统流程
- Android之input系统流程
- Android之input系统流程
- Android之input系统流程
- Android之input系统流程
- Android之input系统流程
- Android/Bluetooth 初始化流程
- Android Bluetooth初始化流程
- Android/Bluetooth 初始化流程
- Android/Bluetooth 初始化流程
- Android Bluetooth初始化流程
- Android/Bluetooth 初始化流程
- Android/Bluetooth 初始化流程
- Android之Input子系统事件分发流程
- Reactor模式,或者叫反应器模式
- 查看表的所有相关列信息
- ————————反射
- erlang代码重构
- nav练习总结
- 笔记之Android Bluetooth Input 连接流程小记
- 利用开源项目建立公益查询接口
- Linux-2.6.32.2内核在mini2440上的移植----移植Nand驱动并更改分区信息
- weibo project note
- java 获取项目路径
- C++中接口与实现分离
- 16进制与字符串转换
- 不管你学的是什么专业,你都应该多少懂些管理学的东西
- 水滴石穿_java枚举的特殊用法