We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c176cc3 commit 4445f5fCopy full SHA for 4445f5f
main/src/user/ble_app.c
@@ -21,11 +21,11 @@
21
#define BLE_APP_TAG "ble_app"
22
#define BLE_GAP_TAG "ble_gap"
23
24
-static uint8_t adv_data_raw[] = {
+static uint8_t adv_data_raw[5 + sizeof(CONFIG_BT_NAME)] = {
25
2,
26
ESP_BT_EIR_TYPE_FLAGS,
27
ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT,
28
- 1,
+ 1 + sizeof(CONFIG_BT_NAME),
29
ESP_BLE_AD_TYPE_NAME_CMPL
30
};
31
@@ -72,6 +72,7 @@ void ble_app_init(void)
72
esp_ble_gap_set_rand_addr(ble_get_mac_address());
73
esp_ble_gap_register_callback(ble_gap_event_handler);
74
75
+ strcpy((char *)adv_data_raw + 5, CONFIG_BT_NAME);
76
esp_ble_gap_config_adv_data_raw(adv_data_raw, sizeof(adv_data_raw));
77
78
esp_ble_gatts_register_callback(ble_gatts_event_handler);
0 commit comments