Android Bluetooth源码学习笔记01
2015-09-25 12:14
781 查看
〇、学习参考链接:
博客文章目录整理/article/2738616.html
android – 蓝牙 bluetooth (一) 入门
/article/2738611.html
android – 蓝牙 bluetooth (二) 打开蓝牙
/article/2738612.html
android – 蓝牙 bluetooth (三)搜索蓝牙
/article/2738613.html
android – 蓝牙 bluetooth (四)OPP文件传输
/article/2738614.html
android – 蓝牙 bluetooth (五)接电话与听音乐
/article/2738615.html
Android4.2蓝牙Enable完全分析
/article/1837721.html
Bluedroid的结构和代码分布
http://blog.sina.com.cn/s/blog_69b5d2a50101f2ew.html
ANDROID4.4 之BLUETOOTH整理
http://www.cnphp6.com/archives/38834
Android4.4 之Bluetooth整理
/article/3551528.html
Android 4.4 Bluetooth学习之一
http://my.oschina.net/u/1436933/blog/192060
一、Bluetooth代码结构分析(android 4.2.2):
1.蓝牙应用层代码
packages/apps/Bluetooth/这里是蓝牙应用层代码。
packages/apps/Settings/src/com/android/settings/bluetooth/
这里是蓝牙应用层settings代码。
packages/apps/Bluetooth/src/com/android/bluetooth/
这里是蓝牙应用层profiles代码,包括opp、hfp、hdp、a2dp、pan等。
packages/apps/Bluetooth/src/com/android/bluetooth/btservice/
这里是蓝牙应用层services代码。(”frameworks/base/core/java/android/server/”的代码在android 4.2.2已经转移到应用层了,即上面的那个路径,但路径还保留着)
2.蓝牙frameworks层代码
frameworks/base/core/java/android/bluetooth/这里是framework层相关java、aidl和C++写的相关代码。
3.蓝牙JNI层代码
packages/apps/Bluetooth/jni/这里是蓝牙JNI层代码,会调用到HAL层(硬件抽象层)。
4.蓝牙HAL层代码
hardware/libhardware/这里是蓝牙HAL层(硬件抽象层)代码,会被JNI层调用。
5.蓝牙适配层代码
system/bluetooth/这里是蓝牙适配层代码,和蓝牙framework层作用类似,是串联framework与blueZ的工具。
6.蓝牙官方协议栈代码
external/bluetooth/bluedroid/这里是BRCM和Google共同开发的官方蓝牙协议栈(BlueZ应用空间协议)。
7.蓝牙Kernel层具体协议实现代码
linux/kernel/drivers/bluetooth/这里是蓝牙Kernel层具体协议实现代码,包括hci、hid、rfcomm、sco、sdp等协议。
8.蓝牙Kernel层驱动代码
linux/kernel/net/bluetooth/这里是蓝牙Linux Kernel层对各种接口的Bluetoothdevice的驱动代码。
二、Bluetooth一般调用路径:
APP/Settings -> Bluetooth -> framework -> bluedroid -> hci -> chip三、Bluetooth关键类管理流程:
1.Android Bluetooth调用顺序
注:如果图片看不清请下载后再看。
2.Android Bluetooth调用顺序(竖图)
注:如果图片看不清请下载后再看。
3.Android Bluetooth调用顺序(横图)
注:如果图片看不清请下载后再看。
四、调用分析1:
五、调用分析2:
相关文章推荐
- notepad++自动补全的插件QuickText
- UI27_多长时间移除
- UI26_编程总结
- iOS8.0 之后UIAlertView和UIActionSheet的创建方式的新变化
- STL系列之五 priority_queue 优先级队列
- Arduino线程库ProtoThreads
- 关于“打印队列 Printer Queue, ACM/ICPC NWERC 2006, UVa 12100)"的讨论
- request_firmware
- Errors running builder 'DeploymentBuilder' on project
- android bluedroid架构
- Google HTML/CSS Style Guide
- Google HTML/CSS Style Guide
- 【UIDatePicker日期选择器控件】
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
- Handler Looper MessageQueue 之间的关系
- easyui tree 取消选中节点
- ios9兼容系列之解决iPad提交报错“iPad Multitasking support requires launch story board in bundle '”
- maven+liquibase实现持续数据库集成
- 黑马程序员--GUI
- Android ViewGroup事件分发机制(requestDisallowInterceptTouchEvent方法)