Skip to content

Commit

Permalink
Fixed sometimes BTU task overflow when doing read and write performan…
Browse files Browse the repository at this point in the history
…ce test
  • Loading branch information
Weijian-Espressif committed Nov 21, 2022
1 parent 99cd534 commit 2e0a5b3
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,12 +1107,6 @@ void bta_gattc_read(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)

/* read fail */
if (status != BTA_GATT_OK) {
/* Dequeue the data, if it was enqueued */
if (p_clcb->p_q_cmd == p_data) {
p_clcb->p_q_cmd = NULL;
bta_gattc_pop_command_to_send(p_clcb);
}

bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_READ, status, NULL);
}
}
Expand Down Expand Up @@ -1142,12 +1136,6 @@ void bta_gattc_read_by_type(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)

/* read fail */
if (status != BTA_GATT_OK) {
/* Dequeue the data, if it was enqueued */
if (p_clcb->p_q_cmd == p_data) {
p_clcb->p_q_cmd = NULL;
bta_gattc_pop_command_to_send(p_clcb);
}

bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_READ, status, NULL);
}
}
Expand Down Expand Up @@ -1178,12 +1166,6 @@ void bta_gattc_read_multi(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)

/* read fail */
if (status != BTA_GATT_OK) {
/* Dequeue the data, if it was enqueued */
if (p_clcb->p_q_cmd == p_data) {
p_clcb->p_q_cmd = NULL;
bta_gattc_pop_command_to_send(p_clcb);
}

bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_READ, status, NULL);
}
}
Expand Down Expand Up @@ -1220,13 +1202,12 @@ void bta_gattc_write(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)

/* write fail */
if (status != BTA_GATT_OK) {
/* Dequeue the data, if it was enqueued */
if (p_clcb->p_q_cmd == p_data) {
p_clcb->p_q_cmd = NULL;
bta_gattc_pop_command_to_send(p_clcb);
}

bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_WRITE, status, NULL);
tGATT_CL_COMPLETE cl_data = {0};
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);
}
}
/*******************************************************************************
Expand Down

0 comments on commit 2e0a5b3

Please sign in to comment.