Loading system/stack/btm/btm_ble_bgconn.cc +31 −0 Original line number Diff line number Diff line Loading @@ -680,6 +680,37 @@ void btm_ble_enqueue_direct_conn_req(void *p_param) } /******************************************************************************* ** ** Function btm_ble_dequeue_direct_conn_req ** ** Description This function dequeues the direct connection request ** ** Returns None. ** *******************************************************************************/ void btm_ble_dequeue_direct_conn_req(BD_ADDR rem_bda) { if (fixed_queue_is_empty(btm_cb.ble_ctr_cb.conn_pending_q)) return; list_t *list = fixed_queue_get_list(btm_cb.ble_ctr_cb.conn_pending_q); for (const list_node_t *node = list_begin(list); node != list_end(list); node = list_next(node)) { tBTM_BLE_CONN_REQ *p_req = (tBTM_BLE_CONN_REQ *)list_node(node); tL2C_LCB *p_lcb = (tL2C_LCB *)p_req->p_param; if ((p_lcb == NULL) || (!p_lcb->in_use)) { continue; } //If BD address matches if (!memcmp (rem_bda, p_lcb->remote_bd_addr, BD_ADDR_LEN)) { fixed_queue_try_remove_from_queue(btm_cb.ble_ctr_cb.conn_pending_q, p_req); l2cu_release_lcb((tL2C_LCB *)p_req->p_param); osi_free((void *)p_req); break; } } } /******************************************************************************* ** ** Function btm_send_pending_direct_conn ** ** Description This function send the pending direct connection request in queue Loading system/stack/btm/btm_ble_int.h +1 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,7 @@ extern void btm_ble_update_link_topology_mask(uint8_t role, bool increase); /* direct connection utility */ extern bool btm_send_pending_direct_conn(void); extern void btm_ble_enqueue_direct_conn_req(void *p_param); extern void btm_ble_dequeue_direct_conn_req(BD_ADDR rem_bda); /* BLE address management */ extern void btm_gen_resolvable_private_addr (void *p_cmd_cplt_cback); Loading system/stack/gatt/gatt_main.cc +2 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,8 @@ bool gatt_disconnect (tGATT_TCB *p_tcb) else { ret = L2CA_CancelBleConnectReq (p_tcb->peer_bda); if (!ret) gatt_set_ch_state(p_tcb, GATT_CH_CLOSE); } gatt_set_ch_state(p_tcb, GATT_CH_CLOSING); } Loading system/stack/l2cap/l2c_ble.cc +3 −3 Original line number Diff line number Diff line Loading @@ -57,17 +57,17 @@ bool L2CA_CancelBleConnectReq (BD_ADDR rem_bda) /* There can be only one BLE connection request outstanding at a time */ if (btm_ble_get_conn_st() == BLE_CONN_IDLE) { L2CAP_TRACE_WARNING ("L2CA_CancelBleConnectReq - no connection pending"); L2CAP_TRACE_WARNING ("%s - no connection pending", __func__); return(false); } if (memcmp (rem_bda, l2cb.ble_connecting_bda, BD_ADDR_LEN)) { L2CAP_TRACE_WARNING ("L2CA_CancelBleConnectReq - different BDA Connecting: %08x%04x Cancel: %08x%04x", L2CAP_TRACE_WARNING ("%s - different BDA Connecting: %08x%04x Cancel: %08x%04x", __func__, (l2cb.ble_connecting_bda[0]<<24)+(l2cb.ble_connecting_bda[1]<<16)+(l2cb.ble_connecting_bda[2]<<8)+l2cb.ble_connecting_bda[3], (l2cb.ble_connecting_bda[4]<<8)+l2cb.ble_connecting_bda[5], (rem_bda[0]<<24)+(rem_bda[1]<<16)+(rem_bda[2]<<8)+rem_bda[3], (rem_bda[4]<<8)+rem_bda[5]); btm_ble_dequeue_direct_conn_req(rem_bda); return(false); } Loading Loading
system/stack/btm/btm_ble_bgconn.cc +31 −0 Original line number Diff line number Diff line Loading @@ -680,6 +680,37 @@ void btm_ble_enqueue_direct_conn_req(void *p_param) } /******************************************************************************* ** ** Function btm_ble_dequeue_direct_conn_req ** ** Description This function dequeues the direct connection request ** ** Returns None. ** *******************************************************************************/ void btm_ble_dequeue_direct_conn_req(BD_ADDR rem_bda) { if (fixed_queue_is_empty(btm_cb.ble_ctr_cb.conn_pending_q)) return; list_t *list = fixed_queue_get_list(btm_cb.ble_ctr_cb.conn_pending_q); for (const list_node_t *node = list_begin(list); node != list_end(list); node = list_next(node)) { tBTM_BLE_CONN_REQ *p_req = (tBTM_BLE_CONN_REQ *)list_node(node); tL2C_LCB *p_lcb = (tL2C_LCB *)p_req->p_param; if ((p_lcb == NULL) || (!p_lcb->in_use)) { continue; } //If BD address matches if (!memcmp (rem_bda, p_lcb->remote_bd_addr, BD_ADDR_LEN)) { fixed_queue_try_remove_from_queue(btm_cb.ble_ctr_cb.conn_pending_q, p_req); l2cu_release_lcb((tL2C_LCB *)p_req->p_param); osi_free((void *)p_req); break; } } } /******************************************************************************* ** ** Function btm_send_pending_direct_conn ** ** Description This function send the pending direct connection request in queue Loading
system/stack/btm/btm_ble_int.h +1 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,7 @@ extern void btm_ble_update_link_topology_mask(uint8_t role, bool increase); /* direct connection utility */ extern bool btm_send_pending_direct_conn(void); extern void btm_ble_enqueue_direct_conn_req(void *p_param); extern void btm_ble_dequeue_direct_conn_req(BD_ADDR rem_bda); /* BLE address management */ extern void btm_gen_resolvable_private_addr (void *p_cmd_cplt_cback); Loading
system/stack/gatt/gatt_main.cc +2 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,8 @@ bool gatt_disconnect (tGATT_TCB *p_tcb) else { ret = L2CA_CancelBleConnectReq (p_tcb->peer_bda); if (!ret) gatt_set_ch_state(p_tcb, GATT_CH_CLOSE); } gatt_set_ch_state(p_tcb, GATT_CH_CLOSING); } Loading
system/stack/l2cap/l2c_ble.cc +3 −3 Original line number Diff line number Diff line Loading @@ -57,17 +57,17 @@ bool L2CA_CancelBleConnectReq (BD_ADDR rem_bda) /* There can be only one BLE connection request outstanding at a time */ if (btm_ble_get_conn_st() == BLE_CONN_IDLE) { L2CAP_TRACE_WARNING ("L2CA_CancelBleConnectReq - no connection pending"); L2CAP_TRACE_WARNING ("%s - no connection pending", __func__); return(false); } if (memcmp (rem_bda, l2cb.ble_connecting_bda, BD_ADDR_LEN)) { L2CAP_TRACE_WARNING ("L2CA_CancelBleConnectReq - different BDA Connecting: %08x%04x Cancel: %08x%04x", L2CAP_TRACE_WARNING ("%s - different BDA Connecting: %08x%04x Cancel: %08x%04x", __func__, (l2cb.ble_connecting_bda[0]<<24)+(l2cb.ble_connecting_bda[1]<<16)+(l2cb.ble_connecting_bda[2]<<8)+l2cb.ble_connecting_bda[3], (l2cb.ble_connecting_bda[4]<<8)+l2cb.ble_connecting_bda[5], (rem_bda[0]<<24)+(rem_bda[1]<<16)+(rem_bda[2]<<8)+rem_bda[3], (rem_bda[4]<<8)+rem_bda[5]); btm_ble_dequeue_direct_conn_req(rem_bda); return(false); } Loading