转自: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. 基本结构

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

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介绍 【转】的更多相关文章

  1. BlueDroid介绍

    目录 1. 基本结构 2. 代码区 自从Android 4.2开始,Android开始使用自己的蓝牙协议栈BlueDroid,而不是bluez BlueDroid可分为两层: - BTE: Bluet ...

  2. 【转】BlueDroid介绍

    原文网址:http://www.cnblogs.com/hzl6255/p/3887547.html 自从Android 4.2开始,Android开始使用自己的蓝牙协议栈BlueDroid,而不是b ...

  3. Bluetooth Low Energy介绍

    目录 1. 介绍 2. 协议栈 3. 实现方案 3.1 硬件实现方案 3.2 软件实现方案 1. 介绍 Bluetooth low energy,也称BLE(低功耗蓝牙),在4.0规范中提出 BLE分 ...

  4. Android 4.2蓝牙介绍

    蓝牙一词源于公元十世纪丹麦国王HaraldBlatand名字中的Blatand.Blatand的英文之意就是Blue tooth.这是因为这位让丹麦人引以为傲的国王酷爱吃蓝莓以至于牙龈都被染成蓝色.由 ...

  5. 【转】Android 4.2蓝牙介绍

    原文网址:http://blog.csdn.net/innost/article/details/9187199 Tieto公司某蓝牙大牛写得<程序员>投稿文章 Android 4.2蓝牙 ...

  6. AndroidO bluedroid alarm 机制分析

    bluedroid的alarm 机制实现在osi/osi/src/alarm.cc 中: 这里面实现了很多的接口: alarm_t* alarm_new(const char* name): alar ...

  7. Bluedroid: 蓝牙协议栈源码剖析

    一. 基础知识介绍 1.缩略语 BTIF: Bluetooth Interface BTU : Bluetooth Upper Layer BTM: Bluetooth Manager BTE: Bl ...

  8. ZT Android 4.2蓝牙介绍

    Android 4.2蓝牙介绍 分类: Android开发系列 2013-06-27 14:16 7110人阅读 评论(22) 收藏 举报 目录(?)[-] Android 42蓝牙介绍 一  蓝牙规 ...

  9. Android蓝牙介绍

    1. 介绍 自从Android 4.2开始,Android开始使用自己的蓝牙协议栈BlueDroid,而不是bluez BlueDroid可分为两层: - BTE: Bluetooth Embedde ...

随机推荐

  1. 微信支付开发(4) 动态链接Native支付

    关键字:微信支付 微信支付v3 动态native支付 统一支付 Native支付 prepay_id 作者:方倍工作室原文: http://www.cnblogs.com/txw1958/p/wxpa ...

  2. 百度SEO建议

    SEO(Search Engine Optimization)汉译为搜索引擎优化.seo优化是专门利用搜索引擎的搜索规则来提高目前网站在有关搜索引擎内的自然排名的方式.SEO的目的理解是为网站提供生态 ...

  3. MVC项目实践,在三层架构下实现SportsStore-05,实现导航

    SportsStore是<精通ASP.NET MVC3框架(第三版)>中演示的MVC项目,在该项目中涵盖了MVC的众多方面,包括:使用DI容器.URL优化.导航.分页.购物车.订单.产品管 ...

  4. Python基础(冒泡、生成器、迭代器、列表与字典解析)

    一.冒泡算法 冒泡算法,给定一组数据,从大到小排序或者从小到大排序,就像气泡一样 原理:  相邻的两个对象相比,大的放到后面,交换位置 交换位置通过a,b=b,a来实现 1.我们可以通过for循环来根 ...

  5. 参数db_ultra_safe

    db_ultra_safe参数设置控制保护级别的其它参数的默认值 可以取的值有:off.data_only.data_and_index.默认值是off -off:不影响db_block_checki ...

  6. CPU informition

    tar jxvf util-linux-ng-2.18.bz2cd util-linux-ng-2.18/./configure --enable-arch --enable-partx --enab ...

  7. BenchmarkSQL测试脚本实现

    sqlTableCreates DROP SCHEMA IF EXISTS benchmarksql CASCADE; CREATE SCHEMA benchmarksql; create table ...

  8. SQL 面向对象(委托)

    委托:也称为代理,事件也是一种委托:定义在类的最外面 1.定义委托关键字:delegate函数签名:签名和函数保持一致定义委托的时候要根据函数来定义public delegate int First( ...

  9. yii框架中保存第三方登录信息

    (第三方登录) 创建应用,域名,详情请看:http://www.cnblogs.com/xujn/p/5287157.html 效果图:

  10. paper 66: MATLAB函数—disp的使用

    例子来源于网络:关键是看disp函数怎么把字符和数字在一起进行显示. 两点生成直线程序 %%以下是一个通过给定两点显示直线方程的程序, %%该程序需要给出两个点的坐标,结果返回为y=kx+b的格式,且 ...