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

Commit 73956d27 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Get rid of warning when connecting LE device

am: 078f3bb8

Change-Id: I293dc741e31950adeebf2f65c49f7449f74db17e
parents 23f985fe 078f3bb8
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
@@ -2681,23 +2681,30 @@ void l2cu_process_fixed_chnl_resp(tL2C_LCB* p_lcb) {

  /* Tell all registered fixed channels about the connection */
  for (int xx = 0; xx < L2CAP_NUM_FIXED_CHNLS; xx++) {
    uint16_t channel_id = xx + L2CAP_FIRST_FIXED_CHNL;

    /* See BT Spec Ver 5.0 | Vol 3, Part A 2.1 table 2.1 and 2.2 */

    /* skip sending LE fix channel callbacks on BR/EDR links */
    if (p_lcb->transport == BT_TRANSPORT_BR_EDR &&
        xx + L2CAP_FIRST_FIXED_CHNL >= L2CAP_ATT_CID &&
        xx + L2CAP_FIRST_FIXED_CHNL <= L2CAP_SMP_CID)
        channel_id >= L2CAP_ATT_CID && channel_id <= L2CAP_SMP_CID)
      continue;

    /* skip sending BR fix channel callbacks on LE links */
    if (p_lcb->transport == BT_TRANSPORT_LE && channel_id == L2CAP_SMP_BR_CID)
      continue;
    if (l2cb.fixed_reg[xx].pL2CA_FixedConn_Cb != NULL) {
      if (p_lcb->peer_chnl_mask[(xx + L2CAP_FIRST_FIXED_CHNL) / 8] &
          (1 << ((xx + L2CAP_FIRST_FIXED_CHNL) % 8))) {

    if (!l2cb.fixed_reg[xx].pL2CA_FixedConn_Cb) continue;

    if (p_lcb->peer_chnl_mask[(channel_id) / 8] & (1 << ((channel_id) % 8))) {
      if (p_lcb->p_fixed_ccbs[xx])
        p_lcb->p_fixed_ccbs[xx]->chnl_state = CST_OPEN;
        (*l2cb.fixed_reg[xx].pL2CA_FixedConn_Cb)(xx + L2CAP_FIRST_FIXED_CHNL,
                                                 p_lcb->remote_bd_addr, true, 0,
                                                 p_lcb->transport);
      (*l2cb.fixed_reg[xx].pL2CA_FixedConn_Cb)(
          channel_id, p_lcb->remote_bd_addr, true, 0, p_lcb->transport);
    } else {
      (*l2cb.fixed_reg[xx].pL2CA_FixedConn_Cb)(
            xx + L2CAP_FIRST_FIXED_CHNL, p_lcb->remote_bd_addr, false,
            p_lcb->disc_reason, p_lcb->transport);
          channel_id, p_lcb->remote_bd_addr, false, p_lcb->disc_reason,
          p_lcb->transport);

      if (p_lcb->p_fixed_ccbs[xx]) {
        l2cu_release_ccb(p_lcb->p_fixed_ccbs[xx]);
@@ -2706,7 +2713,6 @@ void l2cu_process_fixed_chnl_resp(tL2C_LCB* p_lcb) {
    }
  }
}
}
#endif

/*******************************************************************************