1. android4.2.2中蓝牙的目录层次结构
a. 设置中的bluetooth
-
./packages/apps/Settings/src/com/android/settings/bluetooth/
-
实际上ct把packages中的Settings覆盖了,新目录在:
-
./device/softwinner/common/packages/TvdSettings/src/com/android/settings/bluetooth/
b. java中间层
-
./frameworks/base/core/java/android/bluetooth/
-
./frameworks/base/services/java/com/android/server/
c. packat中的java层
-
./packages/apps/Bluetooth/src/com/android/bluetooth/
d.packet 中的jni层
-
./packages/apps/Bluetooth/jni/
e.bluedroid协议栈
-
./external/bluetooth/bluedroid/
f. hw层,厂商自己的库libbt-vendor.so
g.内核层,蓝牙驱动的位置
-
./lichee/linux-3.4/drivers/net/wireless/bcmdhd/
2.蓝牙协议栈bluedroid目录结构分析
-
cong@msi:/work/ct/android/external/bluetooth/bluedroid$ tree -L 2 -d
-
├── audio_a2dp_hw // 音频相关
-
├── bta //Bluetooth Application Layer, 用于和android framework层交互
-
│ ├── ag //audio gateway
-
│ ├── ar //audio/video registration
-
│ ├── av //advanced audio/video
-
│ ├── dm //device manager
-
│ ├── fs //file system
-
│ ├── gatt
-
│ ├── hh //HID HOST
-
│ ├── hl //HeaLth(HL) device profile
-
│ ├── include
-
│ ├── jv //BTA Java(JV) I/F
-
│ ├── pan
-
│ ├── pb //phone book access server (PBS)
-
│ └── sys //system manager
-
├── btif
-
│ ├── co
-
│ ├── include
-
│ └── src
-
├── conf
-
├── embdrv
-
│ └── sbc
-
├── gki //Generic Kernel Interface
-
│ ├── common
-
│ └── ulinux
-
├── hci
-
│ ├── include
-
│ └── src
-
├── include
-
├── main
-
├── stack //stack 实现了各种协议
-
│ ├── a2dp //Advanced Audio Distribution Profile (A2DP)
-
│ ├── avct //audio/video control transport protocol.
-
│ ├── avdt //audio/video distribution transport protocol
-
│ ├── avrc //AVRCP
-
│ ├── bnep
-
│ ├── btm //Bluetooth Manager (BTM)
-
│ ├── btu //Bluetooth Upper Layer
-
│ ├── gatt
-
│ ├── hcic
-
│ ├── hid // HID
-
│ ├── include
-
│ ├── l2cap
-
│ ├── mcap
-
│ ├── pan
-
│ ├── rfcomm
-
│ ├── sdp
-
│ └── smp
-
├── test
-
│ └── bluedroidtest
-
├── tools
-
├── udrv
-
│ ├── include
-
│ └── ulinux
-
└── utils
-
├── include
-
└── src
3.术语
ACL: Asynchronous Connectionless, 无连接的界步连接,用于分组数据传输
A2dp: Advanced Audio Distribution Profile 蓝牙音频传输模型协定
ATT: Attribute Protocol
AVRCP: Audio/Video Remote Control Profile
A2MP: AMP Manager Protocol
BLE: Bluetooth Low Energy, 低耗电蓝牙
BTE: Bluetooth Embedded System,它实现了BT的核心功能。
BTE则通过HCI与厂商蓝牙芯片交互以实现了蓝牙协议栈的通用功能和相关协议
BTA: Bluetooth Application Layer, 用于和android framework层交互
BTA实现了蓝牙设备管理、状态管理及一些应用规范
btm:Bluetooth manager在协议栈中
btu:Bluetooth Upper Laye在协议栈中
BNEP: Bluetooth Network Encapsulation Protocol
cob: chip on board
dm: Device Management
EDR:Enhanced Data Rate
EIR: Extended inquiry response
HCI: Host Control Interface
HDP:Bluetooth Health Device Profile 蓝牙关于医疗方面的应用
HFP : Hands-free Profile 和电话相关,蓝牙接听、挂断电话
LMP: Link ManagerProtocol, 链路管理协议
L2CAP: Logical Link Control and Adaptation Protocol, 逻辑链路控制和适配协议
GATT: Generic Attribute Profile 通用属性配置文件
GAP: Generic Access Profile
PBAP: Phonebook Access Profile 电话号码簿访问协议
RFCOMM: 串口仿真协议
SCO: Synchronous Connection Oriented, 面向连接的同步连接,用于语音传输
SDP: ServiceDiscovery Protocol,服务发现协议
TCS: TelephonyControlprotocol Spectocol,二进制电话控制协议
3.1蓝牙工作模式:
激活(active) 呼吸(sniff) 保持(hold) 休眠(park)
阅读(1088) | 评论(0) | 转发(0) |