BlueDroid介绍
来源:互联网 发布:温州广电网络 编辑:程序博客网 时间:2024/06/14 04:51
自从Android 4.2开始,Android开始使用自己的蓝牙协议栈BlueDroid,而不是bluez
BlueDroid可分为两层:
- BTE: Bluetooth Embedded System
- BTA: Bluetooth Application Layer
BTE实现了核心的蓝牙功能,BTA则与框架的应用程序进行通信
1. 基本结构
下图显示了协议栈的基本结构
Application framework
framework/base/core/java/android/bluetooth
这里是app代码,使用android.bluetooth APIs和蓝牙设备交互
其实现原理是通过Binder IPC机制使用蓝牙服务
Bluetooth system service
位于packages/app/Bluetooth,打包为一个Android应用程序(通过JNI与蓝牙协议栈交互)
它在Android框架层实现了蓝牙的服务和Profiles
JNI
有关代码位于packages/apps/Bluetooth/jni下
当进行蓝牙操作时,JNI的代码会调用到HAL层以获取回调
HAL
HAL层定义了android.bluetooth和Bluetooth process calls into的标准接口
其头文件位于hardware/libhardware/include/hardware
bluetooth.h: Contains the HAL for the Bluetooth hardware on the device bt_av.h: Contains the HAL for the advanced audio profile. bt_hf.h: Contains the HAL for the handsfree profile. bt_hh.h: Contains the HAL for the HID host profile bt_hl.h: Contains the HAL for the health profile bt_pan.h: Contains the HAL for the pan profile bt_sock.h: Contains the HAL for the socket profile
Bluetooth stack
蓝牙协议栈,位于external/bluetooth/bluedroid
实现了通用的蓝牙HAL及可配置组件
Vendor extensions
厂商可通过创建libbt-vendor模块来自定义扩展接口和HCI层来方便调试
2. 代码区
如下网址可在线查看相关代码
AndroidXref
external/bluetooth/bluedroid
packages/apps/Bluetooth
hardware/libhardware/include/hardware
github上可进行代码的下载
external_bluetooth_bluedroid
packages_apps_Bluetooth
android_hardware_libhardware
也可以到Android官网去下载
android Git repositories
参考:
<Android BlueDroid>
<BlueDroid的结构和代码分布>
- BlueDroid介绍
- BlueDroid介绍
- BlueDroid介绍
- BlueDroid介绍
- BlueDroid介绍
- BlueDroid介绍
- BlueDroid介绍
- Bluedroid 框架介绍
- Bluedroid中的线程介绍
- Bluedroid - Android M - 平台介绍
- Android下bluedroid、bluetooth apk介绍
- Bluedroid 筆記
- bluedroid 框架
- Android BlueDroid(一):BlueDroid概述
- BlueDroid代码分析之BlueDroid简介
- Android BlueDroid(一):BlueDroid概述
- Android BlueDroid(一):BlueDroid概述
- Android BlueDroid(一):BlueDroid概述
- 解决ViewPager+Fragment时状态保存的问题
- http://blog.csdn.net/javachannel/article/details/752437编写你自己的单点登录(SSO)服务桌面sso
- 随便写写
- Flex报错之一
- BOJ 446 大神题
- BlueDroid介绍
- 利用resteasy框架构建rest webservice----第二波:使用不同的方式让resteasy发布我们的restful webservice 服务(实例、教程)
- Kali linux安装之后的简单设置
- ACM 数论 扩展欧几里得算法 简单应用 NYOJ 144 小珂的苦恼
- 怒放的小鸟,回归篇
- 强连通模板
- TrueCrypt 6.2a原理及代码分析
- TrueCrypt原理与系统开发
- POJ 3119 Friends or Enemies? 模拟 计算题 需要预处理