转自: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. protocol(协议)的一些要点

    //遵循协议的变量声明 //要求你创建的PErson对象必须是遵循了 PersonProtocol Person<PersonProtocol> * p2 = [[Person alloc ...

  2. JSON Web Token

    What is JSON Web Token? JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact a ...

  3. ftp主动模式 被动模式 和iptables 设置

    FTP协议有两种工作方式:PORT方式和PASV方式,中文意思为主动式和被动式. Port模式:ftp server:tcp 21 <------client:dynamic    ftp se ...

  4. 由浅到深讲解C#-LINQ

    在说LINQ之前必须先说说几个重要的C#语言特性 一:与LINQ有关的语言特性 1.隐式类型 (1)源起 在隐式类型出现之前, 我们在声明一个变量的时候, 总是要为一个变量指定他的类型 甚至在fore ...

  5. XMPP协议介绍

    一.xmpp协议工作原理 二.XMPP地址模式 三.xmpp消息格式 xmpp xml包括三个元素,message,presence,iq,也翻译做三种节. 在'jabber:client'和'jab ...

  6. 原来现在很多人都用SignalR来实现Chat Room

    今天从一个业余开发的群里,看到有人要求这样一个项目需求: 1,)学员可以通过在线课堂找到自己喜欢的老师和课程. 2,)每个人可以建立自己课堂,每个课堂扣分多个子房间,交流群.设置管理员:有录音功能,可 ...

  7. PostgreSQL index types and index bloating

    warehouse_db=# create table item (item_id integer not null,item_name text,item_price numeric,item_da ...

  8. zjuoj 3600 Taxi Fare

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3600 Taxi Fare Time Limit: 2 Seconds    ...

  9. [原创]Scala学习:数组的基本操作,数组进阶操作,多维数组

    1.Scala中提供了一种数据结构-数组,其中存储相同类型的元素的固定大小的连续集合.数组用于存储数据的集合,但它往往是更加有用认为数组作为相同类型的变量的集合 2 声明数组变量: 要使用的程序的数组 ...

  10. cocos游戏开发之海岛冒险1

    1.首先在cocosStudio软件中新建项目:项目名称IslandAdventure:项目语言:C++ 2.在项目路径F:\cocos\MyProject\IslandAdventure如下: 3. ...