From 1922f6cd8066b9cffc4adc260d35e44d9040ed11 Mon Sep 17 00:00:00 2001 From: Siarhei Volkau Date: Sat, 1 Jul 2017 13:12:22 +0300 Subject: [PATCH 1/2] using param, which corresponds to handled event In the handlers of ESP_GATTS_ADD_CHAR_DESCR_EVT was used incorrect parameter, which corresponding to ESP_GATTS_ADD_CHAR_EVT. --- examples/bluetooth/gatt_server/main/gatts_demo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/bluetooth/gatt_server/main/gatts_demo.c b/examples/bluetooth/gatt_server/main/gatts_demo.c index edbe743947..a29676cd17 100644 --- a/examples/bluetooth/gatt_server/main/gatts_demo.c +++ b/examples/bluetooth/gatt_server/main/gatts_demo.c @@ -457,7 +457,7 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i case ESP_GATTS_ADD_CHAR_DESCR_EVT: gl_profile_tab[PROFILE_A_APP_ID].descr_handle = param->add_char.attr_handle; ESP_LOGI(GATTS_TAG, "ADD_DESCR_EVT, status %d, attr_handle %d, service_handle %d\n", - param->add_char.status, param->add_char.attr_handle, param->add_char.service_handle); + param->add_char_descr.status, param->add_char_descr.attr_handle, param->add_char_descr.service_handle); break; case ESP_GATTS_DELETE_EVT: break; @@ -610,7 +610,7 @@ static void gatts_profile_b_event_handler(esp_gatts_cb_event_t event, esp_gatt_i case ESP_GATTS_ADD_CHAR_DESCR_EVT: gl_profile_tab[PROFILE_B_APP_ID].descr_handle = param->add_char.attr_handle; ESP_LOGI(GATTS_TAG, "ADD_DESCR_EVT, status %d, attr_handle %d, service_handle %d\n", - param->add_char.status, param->add_char.attr_handle, param->add_char.service_handle); + param->add_char_descr.status, param->add_char_descr.attr_handle, param->add_char_descr.service_handle); break; case ESP_GATTS_DELETE_EVT: break; From d5301bdac64191a95884bc9cdcf7468020ccb3c6 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 12 Sep 2017 10:57:45 +1000 Subject: [PATCH 2/2] gatts_demo example: Use add_char_descr.attr_handle everywhere --- examples/bluetooth/gatt_server/main/gatts_demo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/bluetooth/gatt_server/main/gatts_demo.c b/examples/bluetooth/gatt_server/main/gatts_demo.c index a29676cd17..8c30fd326e 100644 --- a/examples/bluetooth/gatt_server/main/gatts_demo.c +++ b/examples/bluetooth/gatt_server/main/gatts_demo.c @@ -455,7 +455,7 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i break; } case ESP_GATTS_ADD_CHAR_DESCR_EVT: - gl_profile_tab[PROFILE_A_APP_ID].descr_handle = param->add_char.attr_handle; + gl_profile_tab[PROFILE_A_APP_ID].descr_handle = param->add_char_descr.attr_handle; ESP_LOGI(GATTS_TAG, "ADD_DESCR_EVT, status %d, attr_handle %d, service_handle %d\n", param->add_char_descr.status, param->add_char_descr.attr_handle, param->add_char_descr.service_handle); break; @@ -608,7 +608,7 @@ static void gatts_profile_b_event_handler(esp_gatts_cb_event_t event, esp_gatt_i NULL, NULL); break; case ESP_GATTS_ADD_CHAR_DESCR_EVT: - gl_profile_tab[PROFILE_B_APP_ID].descr_handle = param->add_char.attr_handle; + gl_profile_tab[PROFILE_B_APP_ID].descr_handle = param->add_char_descr.attr_handle; ESP_LOGI(GATTS_TAG, "ADD_DESCR_EVT, status %d, attr_handle %d, service_handle %d\n", param->add_char_descr.status, param->add_char_descr.attr_handle, param->add_char_descr.service_handle); break;