当前位置: 首页 > news >正文

BlueDroid介绍 【转】

转自:http://blog.csdn.net/fen_liu/article/details/41213167

[-]

  1. 基本结构
  2. 代码区


http://www.cnblogs.com/hzl6255/p/3887547.html

自从Android 4.2开始,Android开始使用自己的蓝牙协议栈BlueDroid,而不是bluez

BlueDroid可分为两层:
- BTE: Bluetooth Embedded System
- BTA: Bluetooth Application Layer

BTE实现了核心的蓝牙功能,BTA则与框架的应用程序进行通信

1. 基本结构

下图显示了协议栈的基本结构

bluedroid 

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的结构和代码分布>

转载于:https://www.cnblogs.com/sky-heaven/p/6029566.html

相关文章:

  • NT的密码究竟放在哪
  • Linux桌面版横评:六、红旗桌面5.0
  • HBase跨版本数据迁移总结
  • 旧城镇文兴小学远程教育网点学校工作领导组
  • Struts2 中#、@、%和$符号的用途
  • 项目中常用的几个JS
  • 【uva 658】It's not a Bug, it's a Feature!(图论--Dijkstra或spfa算法+二进制表示+类“隐式图搜索”)...
  • 一个CU的嵌入式BLOG地址
  • React系列之 Redux 架构模式
  • 新Delphi隐藏当前进程
  • [转]iSCSI完全指南
  • 倒计时
  • 11g RAC日志体系(cluster,database,asm,scan日志,ADRCI工具的使用)
  • 管理软件更需要Open Social
  • Android--带你一点点封装项目 MVP+BaseActivity+Retrofit+Dagger+RxJava(一)
  • [NodeJS] 关于Buffer
  • 【个人向】《HTTP图解》阅后小结
  • Android Volley源码解析
  • Effective Java 笔记(一)
  • gops —— Go 程序诊断分析工具
  • Hibernate最全面试题
  • iOS帅气加载动画、通知视图、红包助手、引导页、导航栏、朋友圈、小游戏等效果源码...
  • JavaScript 事件——“事件类型”中“HTML5事件”的注意要点
  • k8s如何管理Pod
  • miaov-React 最佳入门
  • Node项目之评分系统(二)- 数据库设计
  • PAT A1050
  • PHP 程序员也能做的 Java 开发 30分钟使用 netty 轻松打造一个高性能 websocket 服务...
  • Rancher如何对接Ceph-RBD块存储
  • Spring Cloud Alibaba迁移指南(一):一行代码从 Hystrix 迁移到 Sentinel
  • 每个JavaScript开发人员应阅读的书【1】 - JavaScript: The Good Parts
  • 前端性能优化——回流与重绘
  • 数组的操作
  • 我建了一个叫Hello World的项目
  • 用 vue 组件自定义 v-model, 实现一个 Tab 组件。
  • 做一名精致的JavaScripter 01:JavaScript简介
  • #162 (Div. 2)
  • $jQuery 重写Alert样式方法
  • (04)odoo视图操作
  • (4)(4.6) Triducer
  • (Java实习生)每日10道面试题打卡——JavaWeb篇
  • (ZT)薛涌:谈贫说富
  • (差分)胡桃爱原石
  • (多级缓存)缓存同步
  • (附源码)ssm基于jsp高校选课系统 毕业设计 291627
  • (附源码)计算机毕业设计SSM在线影视购票系统
  • (十一)手动添加用户和文件的特殊权限
  • (学习日记)2024.04.04:UCOSIII第三十二节:计数信号量实验
  • (一)【Jmeter】JDK及Jmeter的安装部署及简单配置
  • (一)为什么要选择C++
  • (原創) 如何將struct塞進vector? (C/C++) (STL)
  • .desktop 桌面快捷_Linux桌面环境那么多,这几款优秀的任你选
  • .net core IResultFilter 的 OnResultExecuted和OnResultExecuting的区别
  • .NET 设计模式—简单工厂(Simple Factory Pattern)
  • .net实现客户区延伸至至非客户区