From e8a3f87e4f5e54112319a8c4e410d91888ebed99 Mon Sep 17 00:00:00 2001 From: Yulong Date: Fri, 28 Apr 2017 07:23:52 -0400 Subject: [PATCH] component/bt:Fixed the bug for #11754:GATT service should provide command to set char/descriptor read value. --- components/bt/bluedroid/api/esp_gatts_api.c | 1 + components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c | 3 ++- components/bt/bluedroid/btc/profile/std/include/btc_gatts.h | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/bt/bluedroid/api/esp_gatts_api.c b/components/bt/bluedroid/api/esp_gatts_api.c index 47b8f947a7..aaf93533c2 100644 --- a/components/bt/bluedroid/api/esp_gatts_api.c +++ b/components/bt/bluedroid/api/esp_gatts_api.c @@ -347,6 +347,7 @@ esp_err_t esp_ble_gatts_set_attr_value(uint16_t attr_handle, uint16_t length, co msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_GATTS; msg.act = BTC_GATTS_ACT_SET_ATTR_VALUE; + arg.set_attr_val.handle = attr_handle; arg.set_attr_val.length = length; arg.set_attr_val.value = (uint8_t *)value; 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 4dcf8b8179..7ca7343556 100644 --- a/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c +++ b/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c @@ -560,7 +560,8 @@ void btc_gatts_call_handler(btc_msg_t *msg) break; } case BTC_GATTS_ACT_SET_ATTR_VALUE: - + BTA_SetAttributeValue(arg->set_attr_val.handle, arg->set_attr_val.length, + arg->set_attr_val.value); break; case BTC_GATTS_ACT_OPEN: { // Ensure device is in inquiry database diff --git a/components/bt/bluedroid/btc/profile/std/include/btc_gatts.h b/components/bt/bluedroid/btc/profile/std/include/btc_gatts.h index caae44de44..35cf84c5b1 100644 --- a/components/bt/bluedroid/btc/profile/std/include/btc_gatts.h +++ b/components/bt/bluedroid/btc/profile/std/include/btc_gatts.h @@ -123,7 +123,8 @@ typedef union { } send_rsp; //BTC_GATTS_SET_ATTR_VALUE - struct set_attr_val_args{ + struct set_attr_val_args { + uint16_t handle; uint16_t length; uint8_t *value; } set_attr_val;