From 95c7f45e84a818ecbe1879023ae0fe74f54b95f6 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Mon, 24 Dec 2018 14:35:24 +0800 Subject: [PATCH] Component/bt: add handle in gatts conf event for indication --- components/bt/bluedroid/bta/gatt/bta_gatts_act.c | 3 +++ components/bt/bluedroid/stack/gatt/gatt_sr.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/bt/bluedroid/bta/gatt/bta_gatts_act.c b/components/bt/bluedroid/bta/gatt/bta_gatts_act.c index a7d2ff128..6447d14d3 100644 --- a/components/bt/bluedroid/bta/gatt/bta_gatts_act.c +++ b/components/bt/bluedroid/bta/gatt/bta_gatts_act.c @@ -932,6 +932,9 @@ static void bta_gatts_send_request_cback (UINT16 conn_id, cb_data.req_data.trans_id = trans_id; cb_data.req_data.p_data = (tBTA_GATTS_REQ_DATA *)p_data; + if(req_type == BTA_GATTS_CONF_EVT) { + cb_data.req_data.handle = p_data->handle; + } (*p_rcb->p_cback)(req_type, &cb_data); } else { APPL_TRACE_ERROR("connection request on gatt_if[%d] is not interested", gatt_if); diff --git a/components/bt/bluedroid/stack/gatt/gatt_sr.c b/components/bt/bluedroid/stack/gatt/gatt_sr.c index 1a1f15a05..eccc9ec97 100644 --- a/components/bt/bluedroid/stack/gatt/gatt_sr.c +++ b/components/bt/bluedroid/stack/gatt/gatt_sr.c @@ -1595,8 +1595,10 @@ void gatts_process_value_conf(tGATT_TCB *p_tcb, UINT8 op_code) if (p_rcb->in_use && p_rcb->s_hdl <= handle && p_rcb->e_hdl >= handle) { trans_id = gatt_sr_enqueue_cmd(p_tcb, op_code, handle); conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, p_rcb->gatt_if); + tGATTS_DATA p_data = {0}; + p_data.handle = handle; gatt_sr_send_req_callback(conn_id, - trans_id, GATTS_REQ_TYPE_CONF, (tGATTS_DATA *)&handle); + trans_id, GATTS_REQ_TYPE_CONF, &p_data); } } }