From f095b48f8933f576695aad05989b5f7ace010630 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 13 Apr 2022 17:41:49 +0200 Subject: [PATCH] ble hostname --- components/BTlib/BTlib.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/BTlib/BTlib.c b/components/BTlib/BTlib.c index 1300a35..fe2a7f4 100644 --- a/components/BTlib/BTlib.c +++ b/components/BTlib/BTlib.c @@ -171,8 +171,6 @@ static const esp_gatts_attr_db_t gatt_db[ENV_IDX_NB] = }; -static char device_name[] = "prout"; - void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param){ switch(event){ case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: @@ -238,7 +236,7 @@ void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param){ switch(event){ case ESP_GATTS_REG_EVT: - ESP_ERROR_CHECK(esp_ble_gap_set_device_name(device_name)); + ESP_ERROR_CHECK(esp_ble_gap_set_device_name(main_app_conf->hostname)); ESP_ERROR_CHECK(esp_ble_gap_config_adv_data(&env_sense_adv_data)); adv_config_done |= ADV_CONFIG_FLAG; ESP_ERROR_CHECK(esp_ble_gap_config_adv_data(&scan_rsp_data));