]> granicus.if.org Git - esp-idf/commitdiff
using param, which corresponds to handled event
authorSiarhei Volkau <lis8215@gmail.com>
Sat, 1 Jul 2017 10:12:22 +0000 (13:12 +0300)
committerAngus Gratton <gus@projectgus.com>
Tue, 12 Sep 2017 00:41:43 +0000 (10:41 +1000)
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

index edbe74394726c29e812d5beac6bcde0724ff0d3a..a29676cd17858d86c6eb3702b01a2fcfd41bb3da 100644 (file)
@@ -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;