OSDN Git Service

Restore LE CoC l2cap conn rsp
authorChris Manton <cmanton@google.com>
Thu, 8 Oct 2020 16:33:45 +0000 (09:33 -0700)
committerChris Manton <cmanton@google.com>
Thu, 8 Oct 2020 19:38:06 +0000 (19:38 +0000)
L2cap connection response not generated as server
Plus default config options were not being set

Re: 6613113056bcfd8b8c8abcdc337b15e18f7dfc71

Bug: 170396407
Test: Wireshark shows conn rsp being emitted w/default vals
Test: act -tc BleCocTest
Tag: #refactor
Change-Id: I0f696c2e0bac996ae2b9521fdb282577b9e8528a

stack/l2cap/l2c_ble.cc
stack/l2cap/l2c_csm.cc

index ee2349a..6b6cf64 100644 (file)
@@ -628,6 +628,11 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
       p_ccb->p_rcb = p_rcb;
       p_ccb->remote_cid = rcid;
 
+      p_ccb->local_conn_cfg.mtu = L2CAP_SDU_LENGTH_LE_MAX;
+      p_ccb->local_conn_cfg.mps =
+          controller_get_interface()->get_acl_data_size_ble();
+      p_ccb->local_conn_cfg.credits = L2CAP_LE_CREDIT_DEFAULT,
+
       p_ccb->peer_conn_cfg.mtu = mtu;
       p_ccb->peer_conn_cfg.mps = mps;
       p_ccb->peer_conn_cfg.credits = initial_credit;
index 92ccfaa..5312a9c 100644 (file)
@@ -453,8 +453,8 @@ static void l2c_csm_term_w4_sec_comp(tL2C_CCB* p_ccb, uint16_t event,
         alarm_set_on_mloop(p_ccb->l2c_ccb_timer, L2CAP_CHNL_CONNECT_TIMEOUT_MS,
                            l2c_ccb_timer_timeout, p_ccb);
 
+        l2c_csm_send_connect_rsp(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_TRACE_API("L2CAP - Calling Connect_Ind_Cb(), CID: 0x%04x",