• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


コミットメタ情報

リビジョンff2b23178f68303bcdb5a3c2830cc7758b897a96 (tree)
日時2016-08-30 09:12:25
作者Subramanian Srinivasan <subrsrin@code...>
コミッターSubramanian Srinivasan

ログメッセージ

Dequeues direct connection request during cancel conn operation

When cancel connection request for a device is sent
from an app and if the current pending connection
request's BD address does not match with this device,
the entries of the connection request pending queue
are also checked. If BD address match occurs with an
entry in the connection request queue, the entry is
removed from the queue.

CRs-Fixed: 1060313
Change-Id: I1bf50a424d86ac53a5201fff742c822f4c8d1c0b

変更サマリ

差分

--- a/stack/btm/btm_ble_bgconn.c
+++ b/stack/btm/btm_ble_bgconn.c
@@ -701,6 +701,37 @@ void btm_ble_enqueue_direct_conn_req(void *p_param)
701701 }
702702 /*******************************************************************************
703703 **
704+** Function btm_ble_dequeue_direct_conn_req
705+**
706+** Description This function dequeues the direct connection request
707+**
708+** Returns None.
709+**
710+*******************************************************************************/
711+void btm_ble_dequeue_direct_conn_req(BD_ADDR rem_bda)
712+{
713+ if (fixed_queue_is_empty(btm_cb.ble_ctr_cb.conn_pending_q))
714+ return;
715+
716+ list_t *list = fixed_queue_get_list(btm_cb.ble_ctr_cb.conn_pending_q);
717+ for (const list_node_t *node = list_begin(list); node != list_end(list);
718+ node = list_next(node)) {
719+ tBTM_BLE_CONN_REQ *p_req = (tBTM_BLE_CONN_REQ *)list_node(node);
720+ tL2C_LCB *p_lcb = (tL2C_LCB *)p_req->p_param;
721+ if ((p_lcb == NULL) || (!p_lcb->in_use)) {
722+ continue;
723+ }
724+ //If BD address matches
725+ if (!memcmp (rem_bda, p_lcb->remote_bd_addr, BD_ADDR_LEN)) {
726+ fixed_queue_try_remove_from_queue(btm_cb.ble_ctr_cb.conn_pending_q, p_req);
727+ l2cu_release_lcb((tL2C_LCB *)p_req->p_param);
728+ osi_free((void *)p_req);
729+ break;
730+ }
731+ }
732+}
733+/*******************************************************************************
734+**
704735 ** Function btm_send_pending_direct_conn
705736 **
706737 ** Description This function send the pending direct connection request in queue
--- a/stack/btm/btm_ble_int.h
+++ b/stack/btm/btm_ble_int.h
@@ -433,6 +433,7 @@ extern void btm_ble_update_link_topology_mask(UINT8 role, BOOLEAN increase);
433433 /* direct connection utility */
434434 extern BOOLEAN btm_send_pending_direct_conn(void);
435435 extern void btm_ble_enqueue_direct_conn_req(void *p_param);
436+extern void btm_ble_dequeue_direct_conn_req(BD_ADDR rem_bda);
436437
437438 /* BLE address management */
438439 extern void btm_gen_resolvable_private_addr (void *p_cmd_cplt_cback);
--- a/stack/gatt/gatt_main.c
+++ b/stack/gatt/gatt_main.c
@@ -249,6 +249,8 @@ BOOLEAN gatt_disconnect (tGATT_TCB *p_tcb)
249249 {
250250 gatt_set_ch_state(p_tcb, GATT_CH_CLOSING);
251251 ret = L2CA_CancelBleConnectReq (p_tcb->peer_bda);
252+ if (!ret)
253+ gatt_set_ch_state(p_tcb, GATT_CH_CLOSE);
252254 }
253255 }
254256 else
--- a/stack/l2cap/l2c_ble.c
+++ b/stack/l2cap/l2c_ble.c
@@ -57,17 +57,17 @@ BOOLEAN L2CA_CancelBleConnectReq (BD_ADDR rem_bda)
5757 /* There can be only one BLE connection request outstanding at a time */
5858 if (btm_ble_get_conn_st() == BLE_CONN_IDLE)
5959 {
60- L2CAP_TRACE_WARNING ("L2CA_CancelBleConnectReq - no connection pending");
60+ L2CAP_TRACE_WARNING ("%s - no connection pending", __func__);
6161 return(FALSE);
6262 }
6363
6464 if (memcmp (rem_bda, l2cb.ble_connecting_bda, BD_ADDR_LEN))
6565 {
66- L2CAP_TRACE_WARNING ("L2CA_CancelBleConnectReq - different BDA Connecting: %08x%04x Cancel: %08x%04x",
66+ L2CAP_TRACE_WARNING ("%s - different BDA Connecting: %08x%04x Cancel: %08x%04x", __func__,
6767 (l2cb.ble_connecting_bda[0]<<24)+(l2cb.ble_connecting_bda[1]<<16)+(l2cb.ble_connecting_bda[2]<<8)+l2cb.ble_connecting_bda[3],
6868 (l2cb.ble_connecting_bda[4]<<8)+l2cb.ble_connecting_bda[5],
6969 (rem_bda[0]<<24)+(rem_bda[1]<<16)+(rem_bda[2]<<8)+rem_bda[3], (rem_bda[4]<<8)+rem_bda[5]);
70-
70+ btm_ble_dequeue_direct_conn_req(rem_bda);
7171 return(FALSE);
7272 }
7373