@@ -63,7 +63,7 @@ static void bta_gattc_cmpl_sendmsg(UINT16 conn_id, tGATTC_OPTYPE op,
6363 tGATT_CL_COMPLETE * p_data );
6464static void bta_gattc_pop_command_to_send (tBTA_GATTC_CLCB * p_clcb );
6565
66- static void bta_gattc_deregister_cmpl (tBTA_GATTC_RCB * p_clreg );
66+ void bta_gattc_deregister_cmpl (tBTA_GATTC_RCB * p_clreg );
6767static void bta_gattc_enc_cmpl_cback (tGATT_IF gattc_if , BD_ADDR bda );
6868static void bta_gattc_cong_cback (UINT16 conn_id , BOOLEAN congested );
6969static void bta_gattc_req_cback (UINT16 conn_id , UINT32 trans_id , tGATTS_REQ_TYPE type , tGATTS_DATA * p_data );
@@ -154,7 +154,7 @@ void bta_gattc_disable(tBTA_GATTC_CB *p_cb)
154154 APPL_TRACE_DEBUG ("bta_gattc_disable" );
155155
156156 if (p_cb -> state != BTA_GATTC_STATE_ENABLED ) {
157- APPL_TRACE_ERROR ("not enabled or disable in pogress " );
157+ APPL_TRACE_ERROR ("not enabled or disable in progress " );
158158 return ;
159159 }
160160
@@ -227,7 +227,7 @@ void bta_gattc_register(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_data)
227227 if ((p_buf = (tBTA_GATTC_INT_START_IF * ) osi_malloc (sizeof (tBTA_GATTC_INT_START_IF ))) != NULL ) {
228228 p_buf -> hdr .event = BTA_GATTC_INT_START_IF_EVT ;
229229 p_buf -> client_if = p_cb -> cl_rcb [i ].client_if ;
230- APPL_TRACE_DEBUG ("GATTC getbuf sucess .\n" );
230+ APPL_TRACE_DEBUG ("GATTC getbuf success .\n" );
231231 bta_sys_sendmsg (p_buf );
232232 status = BTA_GATT_OK ;
233233 } else {
@@ -841,6 +841,9 @@ void bta_gattc_close(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
841841 (* p_cback )(BTA_GATTC_CLOSE_EVT , (tBTA_GATTC * )& cb_data );
842842 }
843843
844+ // Please note that BTA_GATTC_CLOSE_EVT will run in the BTC task.
845+ // because bta_gattc_deregister_cmpl did not execute as expected(this is a known issue),
846+ // we will run it again in bta_gattc_clcb_dealloc_by_conn_id.
844847 if (p_clreg -> num_clcb == 0 && p_clreg -> dereg_pending ) {
845848 bta_gattc_deregister_cmpl (p_clreg );
846849 }
@@ -1672,7 +1675,7 @@ void bta_gattc_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
16721675** Returns void
16731676**
16741677*******************************************************************************/
1675- static void bta_gattc_deregister_cmpl (tBTA_GATTC_RCB * p_clreg )
1678+ void bta_gattc_deregister_cmpl (tBTA_GATTC_RCB * p_clreg )
16761679{
16771680 tBTA_GATTC_CB * p_cb = & bta_gattc_cb ;
16781681 tBTA_GATTC_IF client_if = p_clreg -> client_if ;
@@ -2118,7 +2121,7 @@ void bta_gattc_process_indicate(UINT16 conn_id, tGATTC_OPTYPE op, tGATT_CL_COMPL
21182121 bta_gattc_proc_other_indication (p_clcb , op , p_data , & notify );
21192122 }
21202123 } else if (op == GATTC_OPTYPE_INDICATION ) {
2121- /* no one intersted and need ack? */
2124+ /* no one interested and need ack? */
21222125 APPL_TRACE_DEBUG ("%s no one interested, ack now" , __func__ );
21232126 GATTC_SendHandleValueConfirm (conn_id , handle );
21242127 }
@@ -2235,7 +2238,7 @@ static void bta_gattc_req_cback (UINT16 conn_id, UINT32 trans_id, tGATTS_REQ_TYP
22352238**
22362239** Function bta_gattc_init_clcb_conn
22372240**
2238- ** Description Initaite a BTA CLCB connection
2241+ ** Description Initiate a BTA CLCB connection
22392242**
22402243** Returns void
22412244**
@@ -2252,7 +2255,7 @@ void bta_gattc_init_clcb_conn(UINT8 cif, BD_ADDR remote_bda)
22522255 return ;
22532256 }
22542257
2255- /* initaite a new connection here */
2258+ /* initiate a new connection here */
22562259 if ((p_clcb = bta_gattc_clcb_alloc (cif , remote_bda , BTA_GATT_TRANSPORT_LE )) != NULL ) {
22572260 gattc_data .hdr .layer_specific = p_clcb -> bta_conn_id = conn_id ;
22582261
0 commit comments