From e02ff1ed896d199eab1c2499655f7dc3bd398846 Mon Sep 17 00:00:00 2001 From: Yulong Date: Tue, 10 Oct 2017 03:12:00 -0400 Subject: [PATCH] component/bt: Change the bta_gattc_pop_command_to_send function to static. --- .../bt/bluedroid/bta/gatt/bta_gattc_act.c | 37 ++++--------------- .../bt/bluedroid/bta/include/bta_gattc_int.h | 1 - 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/components/bt/bluedroid/bta/gatt/bta_gattc_act.c b/components/bt/bluedroid/bta/gatt/bta_gattc_act.c index 1e1e929bb..2ee7bdb09 100644 --- a/components/bt/bluedroid/bta/gatt/bta_gattc_act.c +++ b/components/bt/bluedroid/bta/gatt/bta_gattc_act.c @@ -59,6 +59,7 @@ static void bta_gattc_cmpl_cback(UINT16 conn_id, tGATTC_OPTYPE op, tGATT_STATUS static void bta_gattc_cmpl_sendmsg(UINT16 conn_id, tGATTC_OPTYPE op, tBTA_GATT_STATUS status, tGATT_CL_COMPLETE *p_data); +static void bta_gattc_pop_command_to_send(tBTA_GATTC_CLCB *p_clcb); static void bta_gattc_deregister_cmpl(tBTA_GATTC_RCB *p_clreg); static void bta_gattc_enc_cmpl_cback(tGATT_IF gattc_if, BD_ADDR bda); @@ -916,10 +917,7 @@ void bta_gattc_cfg_mtu(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data) /* Dequeue the data, if it was enqueued */ if (p_clcb->p_q_cmd == p_data) { p_clcb->p_q_cmd = NULL; - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ - bta_gattc_pop_command_to_send(p_clcb); + bta_gattc_pop_command_to_send(p_clcb); } bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_CONFIG, status, NULL); @@ -1068,9 +1066,6 @@ void bta_gattc_read(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data) /* Dequeue the data, if it was enqueued */ if (p_clcb->p_q_cmd == p_data) { p_clcb->p_q_cmd = NULL; - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ bta_gattc_pop_command_to_send(p_clcb); } @@ -1107,10 +1102,7 @@ void bta_gattc_read_multi(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data) /* Dequeue the data, if it was enqueued */ if (p_clcb->p_q_cmd == p_data) { p_clcb->p_q_cmd = NULL; - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ - bta_gattc_pop_command_to_send(p_clcb); + bta_gattc_pop_command_to_send(p_clcb); } bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_READ, status, NULL); @@ -1151,9 +1143,6 @@ void bta_gattc_write(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data) /* Dequeue the data, if it was enqueued */ if (p_clcb->p_q_cmd == p_data) { p_clcb->p_q_cmd = NULL; - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ bta_gattc_pop_command_to_send(p_clcb); } @@ -1179,9 +1168,6 @@ void bta_gattc_execute(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data) /* Dequeue the data, if it was enqueued */ if (p_clcb->p_q_cmd == p_data) { p_clcb->p_q_cmd = NULL; - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ bta_gattc_pop_command_to_send(p_clcb); } @@ -1247,9 +1233,6 @@ void bta_gattc_read_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data) cb_data.read.conn_id = p_clcb->bta_conn_id; //free the command data store in the queue. bta_gattc_free_command_data(p_clcb); - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ bta_gattc_pop_command_to_send(p_clcb); /* read complete, callback */ ( *p_clcb->p_rcb->p_cback)(event, (tBTA_GATTC *)&cb_data); @@ -1283,9 +1266,6 @@ void bta_gattc_write_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data) } //free the command data store in the queue. bta_gattc_free_command_data(p_clcb); - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ bta_gattc_pop_command_to_send(p_clcb); cb_data.write.conn_id = p_clcb->bta_conn_id; /* write complete, callback */ @@ -1306,9 +1286,6 @@ void bta_gattc_exec_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data) tBTA_GATTC cb_data; //free the command data store in the queue. bta_gattc_free_command_data(p_clcb); - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ bta_gattc_pop_command_to_send(p_clcb); p_clcb->status = BTA_GATT_OK; @@ -1334,9 +1311,6 @@ void bta_gattc_cfg_mtu_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data) tBTA_GATTC cb_data; //free the command data store in the queue. bta_gattc_free_command_data(p_clcb); - /* Check if there has command pending in the command queue or not, - if there has command pending in the command queue, sent it to the state machine to decision - should be sent it to the remote device or not. */ bta_gattc_pop_command_to_send(p_clcb); if (p_data->p_cmpl && p_data->status == BTA_GATT_OK) { @@ -1483,11 +1457,14 @@ void bta_gattc_q_cmd(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data) ** Function bta_gattc_pop_command_to_send ** ** Description dequeue a command into control block. +** Check if there has command pending in the command queue or not, +** if there has command pending in the command queue, sent it to the state machine to decision +** should be sent it to the remote device or not. ** ** Returns None. ** *******************************************************************************/ -void bta_gattc_pop_command_to_send(tBTA_GATTC_CLCB *p_clcb) +static void bta_gattc_pop_command_to_send(tBTA_GATTC_CLCB *p_clcb) { if (!list_is_empty(p_clcb->p_cmd_list)) { list_node_t *node = list_begin(p_clcb->p_cmd_list); diff --git a/components/bt/bluedroid/bta/include/bta_gattc_int.h b/components/bt/bluedroid/bta/include/bta_gattc_int.h index 9c04c5559..1d53f7d1b 100644 --- a/components/bt/bluedroid/bta/include/bta_gattc_int.h +++ b/components/bt/bluedroid/bta/include/bta_gattc_int.h @@ -420,7 +420,6 @@ extern void bta_gattc_read(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data); extern void bta_gattc_write(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data); extern void bta_gattc_op_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data); extern void bta_gattc_q_cmd(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data); -extern void bta_gattc_pop_command_to_send(tBTA_GATTC_CLCB *p_clcb); extern void bta_gattc_free_command_data(tBTA_GATTC_CLCB *p_clcb); extern void bta_gattc_search(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data); extern void bta_gattc_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);