Bluetooth GAP介绍

来源:互联网 发布:mac口红铁锈红是几号 编辑:程序博客网 时间:2024/06/15 00:10

GAP Profile: Generic Access Profile
该Profile保证不同的Bluetooth产品可以互相发现对方并建立连接

GAP定义了蓝牙设备如何发现和建立与其他设备的安全/不安全连接
它处理一些一般模式的业务(如询问、命名和搜索)和一些安全性问题(如担保)
同时还处理一些有关连接的业务(如链路建立、信道和连接建立)
GAP规定的是一些一般性的运行任务。因此,它具有强制性,并作为所有其它蓝牙应用规范的基础

1 GAP协议栈


GAP有如下四个目的
- Profile Role
- 可发现模式和过程
- 连接模式和过程
- 安全模式和过程

2 Profile Role

在BLE下,GAP Role有四种
- Broadcaster : 发送advertising events的设备(有Transmitter, 可能有Receiver)
- Observer    : 接收advertising events的设备(可能有Transmitter, 有Receiver)
- Peripheral  : 物理链路上接受连接的设备, 在LL层Connection State为Slave(有Transmitter和Receiver)
- Central     : 物理链路上发起连接的设备, 在LL层Connection State为Master(有Transmitter和Receiver)

3 用户接口

用户可配置的参数如下
- Bluetooth Device Address : BD_ADDR
- Bluetooth Device Name    : the user-friendly name
- Bluetooth Passkey        : Bluetooth PIN
- Class of Device          : 设备发现阶段用于指示设备类别和支持的设备类别

4 模式

发现模式(Discoverablity Modes)
- Non-discoverable Mode
- Discoverable Mode
- Limited discoverable Mode
- General discoverable Mode

连接模式(Connectability Modes)
- Non-connectable Mode
- Connectable Mode

配对模式(Bondable Modes)
- Non-bondable Mode
- Bondable Mode

5 安全

5.1 认证(Authentication)

认证过程描述了两个蓝牙设备进行LMP认证和LMP配对的一般过程
过程如下


5.2 安全模式

安全模式描述了Channel连接建立过程中的涉及的Secure问题

安全模式大体上可分为两种Legacy Security Modes(1、2、3)和Security Mode 4
Legacy Security Modes用于Controller/Host不支持SSP(Secure Simple Pairing)

注意: 设备可能同时支持Security Mode 2(兼容不支持SSP设备)和Security Mode 4

详细有如下四种
- Security Mode 1 : Non-secure
- Security Mode 2 : Service level enforced security
- Security Mode 3 : Link level enforced security
- Security Mode 4 : Service level enforced security

6 Idle Mode Procedures

描述了发起方Inquiry和Discovery的过程

- General Inquiry
- Limited Inquiry
- Name Discovery
- Device Discovery
- Bonding

7 Establishment Procedures

进行下面过程之前需要Discovery过程提供远端设备如下信息

基本信息
- DB_ADDR、Device Access Code
- System Clock
- Page Scan Mode

附加信息
- The Class of device
- The Device name
- The supported Service Classes

有如下三种
- Link Establishment
- Channel Establishment
- Connection Establishment

8 BLE操作模式和过程

在LE物理层通道上可能同时存在多个模式和过程

- Broadcast mode and observation procedure
- Discovery modes and procedures
- Connection modes and procedures
- Bonding modes and procedures

====================== 华丽的分割线 =========================

笔者能力有限,对于GAP目前只能了解这么多
规范中有非常完整的描述
见Core System Package[Host volume]
   
-Part C(Generic Access Profile)

0 0
原创粉丝点击