_____ 蓝牙协议框架
主要关注三个部分
GAP 和 GATT 的功能是解析 LL 层的 payload。
1. GAP层(Generic access profile)
GAP 主要负责设备的发现和连接管理,定义了设备如何广播、扫描、连接和断开连接。
2. Generic Attribute Profile (GATT)
GATT 负责定义蓝牙设备间数据的格式和传输方式,主要用于实现具体的服务和特性(如心率监测、温度传感等。
3. ATT(Attribute Protocol)属性层是GATT和GAP的基础,它定义了BLE协议栈上层的数据结构和组织方式。
_____ esp32
官方例子
GATT Server API - ESP32 - — ESP-IDF Programming Guide v5.2.2 documentation
This is a GATT server demo and its tutorial. This demo creates a GATT service with an attribute table, which releases the user from the operation of adding attributes one by one. This is the recommended method of adding attributes (officially recommended).
This is a GATT server demo and its tutorial. This demo creates a GATT service by adding attributes one by one as defined by Bluedroid. The recommended method of adding attributes is presented in the example below.