From c802ea842d77ddda0556c058dfbf44061ad92a33 Mon Sep 17 00:00:00 2001 From: Yulong Date: Thu, 15 Mar 2018 02:29:11 -0400 Subject: [PATCH] component/bt: Change the char_uuid to descr_uuid in the add descriptor callback params. --- components/bt/bluedroid/api/include/esp_gatts_api.h | 2 +- components/bt/bluedroid/bta/gatt/bta_gatts_act.c | 4 ++-- components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/bt/bluedroid/api/include/esp_gatts_api.h b/components/bt/bluedroid/api/include/esp_gatts_api.h index dde024aa9d..bc97b76e46 100644 --- a/components/bt/bluedroid/api/include/esp_gatts_api.h +++ b/components/bt/bluedroid/api/include/esp_gatts_api.h @@ -162,7 +162,7 @@ typedef union { esp_gatt_status_t status; /*!< Operation status */ uint16_t attr_handle; /*!< Descriptor attribute handle */ uint16_t service_handle; /*!< Service attribute handle */ - esp_bt_uuid_t char_uuid; /*!< Characteristic uuid */ + esp_bt_uuid_t descr_uuid; /*!< Characteristic descriptor uuid */ } add_char_descr; /*!< Gatt server callback param of ESP_GATTS_ADD_CHAR_DESCR_EVT */ /** diff --git a/components/bt/bluedroid/bta/gatt/bta_gatts_act.c b/components/bt/bluedroid/bta/gatt/bta_gatts_act.c index 4c1380a3ce..6bf6a89377 100644 --- a/components/bt/bluedroid/bta/gatt/bta_gatts_act.c +++ b/components/bt/bluedroid/bta/gatt/bta_gatts_act.c @@ -420,7 +420,7 @@ void bta_gatts_add_char(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA *p_msg) p_msg->api_add_char.perm, p_msg->api_add_char.property, p_attr_val, p_control); cb_data.add_result.server_if = p_rcb->gatt_if; - cb_data.add_result.service_id = p_msg->api_add_incl_srvc.hdr.layer_specific; + cb_data.add_result.service_id = p_msg->api_add_char.hdr.layer_specific; cb_data.add_result.attr_id = attr_id; // btla-specific ++ memcpy(&cb_data.add_result.char_uuid, &p_msg->api_add_char.char_uuid, sizeof(tBT_UUID)); @@ -470,7 +470,7 @@ void bta_gatts_add_char_descr(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA *p_ p_control); cb_data.add_result.server_if = p_rcb->gatt_if; - cb_data.add_result.service_id = p_msg->api_add_incl_srvc.hdr.layer_specific; + cb_data.add_result.service_id = p_msg->api_add_char_descr.hdr.layer_specific; cb_data.add_result.attr_id = attr_id; // btla-specific ++ memcpy(&cb_data.add_result.char_uuid, &p_msg->api_add_char_descr.descr_uuid, sizeof(tBT_UUID)); diff --git a/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c b/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c index 4ea69a5476..4932c687c8 100644 --- a/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c +++ b/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c @@ -832,7 +832,7 @@ void btc_gatts_cb_handler(btc_msg_t *msg) param.add_char_descr.status = p_data->add_result.status; param.add_char_descr.attr_handle = p_data->add_result.attr_id; param.add_char_descr.service_handle = p_data->add_result.service_id; - bta_to_btc_uuid(¶m.add_char_descr.char_uuid, &p_data->add_result.char_uuid); + bta_to_btc_uuid(¶m.add_char_descr.descr_uuid, &p_data->add_result.char_uuid); btc_gatts_cb_to_app(ESP_GATTS_ADD_CHAR_DESCR_EVT, gatts_if, ¶m); break;