mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
Merge branch 'bugfix/reduce_BTU_TASK_stack_consumption_v4.4' into 'release/v4.4'
Reduce the stack consumption of BTU_TASK (backport v4.4) See merge request espressif/esp-idf!21435
This commit is contained in:
@ -1187,27 +1187,24 @@ void bta_gattc_write(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tBTA_GATT_STATUS status = BTA_GATT_OK;
|
tBTA_GATT_STATUS status = BTA_GATT_OK;
|
||||||
tGATT_VALUE attr;
|
|
||||||
|
|
||||||
attr.conn_id = p_clcb->bta_conn_id;
|
tGATT_CL_COMPLETE cl_data = {0};
|
||||||
attr.handle = p_data->api_write.handle;
|
|
||||||
attr.offset = p_data->api_write.offset;
|
cl_data.att_value.conn_id = p_clcb->bta_conn_id;
|
||||||
attr.len = p_data->api_write.len;
|
cl_data.att_value.handle = p_data->api_write.handle;
|
||||||
attr.auth_req = p_data->api_write.auth_req;
|
cl_data.att_value.offset = p_data->api_write.offset;
|
||||||
|
cl_data.att_value.len = p_data->api_write.len;
|
||||||
|
cl_data.att_value.auth_req = p_data->api_write.auth_req;
|
||||||
|
|
||||||
if (p_data->api_write.p_value) {
|
if (p_data->api_write.p_value) {
|
||||||
memcpy(attr.value, p_data->api_write.p_value, p_data->api_write.len);
|
memcpy(cl_data.att_value.value, p_data->api_write.p_value, p_data->api_write.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
status = GATTC_Write(p_clcb->bta_conn_id, p_data->api_write.write_type, &attr);
|
status = GATTC_Write(p_clcb->bta_conn_id, p_data->api_write.write_type, &cl_data.att_value);
|
||||||
|
|
||||||
/* write fail */
|
/* write fail */
|
||||||
if (status != BTA_GATT_OK) {
|
if (status != BTA_GATT_OK) {
|
||||||
|
|
||||||
tGATT_CL_COMPLETE cl_data = {0};
|
|
||||||
cl_data.handle = p_data->api_write.handle;
|
cl_data.handle = p_data->api_write.handle;
|
||||||
memcpy(&cl_data.att_value, &attr, sizeof(tGATT_VALUE));
|
|
||||||
|
|
||||||
bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_WRITE, status, &cl_data);
|
bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_WRITE, status, &cl_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user