From: Hansong Zhang Date: Mon, 28 Sep 2020 20:15:10 +0000 (-0700) Subject: LE COC: Indicate channel open on ConnectRsp recv X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6613113056;p=android-x86%2Fsystem-bt.git LE COC: Indicate channel open on ConnectRsp recv Also don't auto send ConnectRsp for LE. Need to clean up config. Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: I4e148d0d0d6597ef8d1d9115db8c8ba6f92a1b8e --- diff --git a/stack/l2cap/l2c_csm.cc b/stack/l2cap/l2c_csm.cc index 91e354033..de695f9fe 100644 --- a/stack/l2cap/l2c_csm.cc +++ b/stack/l2cap/l2c_csm.cc @@ -450,8 +450,10 @@ static void l2c_csm_term_w4_sec_comp(tL2C_CCB* p_ccb, uint16_t event, L2CAP_TRACE_API("L2CAP - Calling Connect_Ind_Cb(), CID: 0x%04x", p_ccb->local_cid); - l2c_csm_send_connect_rsp(p_ccb); - l2c_csm_send_config_req(p_ccb); + if (p_ccb->p_lcb->transport != BT_TRANSPORT_LE) { + l2c_csm_send_connect_rsp(p_ccb); + l2c_csm_send_config_req(p_ccb); + } } else { /* ** L2CAP Connect Response will be sent out by 3 sec timer expiration @@ -561,6 +563,9 @@ static void l2c_csm_w4_l2cap_connect_rsp(tL2C_CCB* p_ccb, uint16_t event, /* Connection is completed */ alarm_cancel(p_ccb->l2c_ccb_timer); p_ccb->chnl_state = CST_OPEN; + (*p_ccb->p_rcb->api.pL2CA_ConnectInd_Cb)( + p_ccb->p_lcb->remote_bd_addr, p_ccb->local_cid, p_ccb->p_rcb->psm, + p_ccb->remote_id); } else { p_ccb->chnl_state = CST_CONFIG; alarm_set_on_mloop(p_ccb->l2c_ccb_timer, L2CAP_CHNL_CFG_TIMEOUT_MS,