ESP32 BLE 设备信息服务 (DIS):广播设备名称和广播数据的最大长度是多少?
使用 espressif/ble_services 包时,你可以这样配置设备信息服务 (DIS) 来广播设备名称和其他数据:
esp_ble_conn_config_example.cpp
esp_ble_conn_config_t config = {
.device_name = "ABC123",
.broadcast_data = "MyProduct",
};以下是这些字段的最大长度:
- 设备名称:最大长度为
MAX_BLE_DEVNAME_LEN,即29 字节。 - 广播数据:最大长度为
MAX_BLE_BROADCAST_DATA_LEN,即15 字节。
这些参数定义在 esp_ble_conn_mgr.h 中。
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow