01 Overview
The device is a GATT server and advertises. Espressif recommends the service-table example for production.
- Use when: App setup without a router.
- Skip when: you need public-internet control.
Phone nearby
A phone finds and controls the device. Starting point for local setup.
Official path: examples/bluetooth/bluedroid/ble/gatt_server
The device is a GATT server and advertises. Espressif recommends the service-table example for production.
1. Init controller + Bluedroid.
2. Create service, characteristic, CCCD, advertise.
3. Notifications only after CCCD is written.
4. Change name and UUIDs before shipping.
中文
手机近场
手机发现并控制设备。近场配置和控灯/控锁的起点。
官方路径: examples/bluetooth/bluedroid/ble/gatt_server
设备当 GATT 服务器并广播。官方建议量产改用 service table 示例。
1. 初始化控制器 + Bluedroid。
2. 建服务、特征、CCCD,开始广播。
3. 对端写 CCCD 后才能通知。
4. 出货必须改名字和 UUID,避免和演示设备撞车。