Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dac3515 authored by Srinu Jella's avatar Srinu Jella Committed by Ajay Panicker
Browse files

Handle L2CAP disconnection on incomplete connection

- Sometimes before receiving the connection complete
  event from remote device, upper layer might send a
  disconnection on incomplete L2CAP connection, and expects
  notification of connection failure.

- This change notifies disconnection to upper layers with
  error in case L2CAP disconnection is received on
  incomplete L2CAP channel.

Test: code compilation.

Change-Id: I4ab675329b3d791a3f68101495a6e6d90b13bde4
parent 8adf9308
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -654,7 +654,15 @@ static void l2c_csm_w4_l2cap_connect_rsp (tL2C_CCB *p_ccb, uint16_t event, void
                               btu_general_alarm_queue);
        }
        else
        {
            tL2CA_DISCONNECT_CFM_CB *disconnect_cfm = p_ccb->p_rcb->api.pL2CA_DisconnectCfm_Cb;
            l2cu_release_ccb(p_ccb);
            if (disconnect_cfm)
            {
                L2CAP_TRACE_API("%s: L2CAP - Calling DisconnectCfm_Cb(), CID: 0x%04x", __func__, local_cid);
                (*disconnect_cfm)(local_cid, L2CAP_CONN_NO_LINK);
            }
        }
        break;

    case L2CEVT_L2CA_DATA_WRITE:                    /* Upper layer data to send */