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

Commit f2a0ed52 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Use L2CAP_DEFAULT_MTU if mtu is not specified" am: 33d07fae am: b25dd6c6

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1996670

Change-Id: I2a81357e736dea89e996e3256984ab2915b22e05
parents ca1c7603 b25dd6c6
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -763,17 +763,22 @@ static void gap_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
  if (p_ccb == NULL) return;

  /* Remember the remote MTU size */

  if (!p_cfg->mtu_present) {
    p_ccb->rem_mtu_size = L2CAP_DEFAULT_MTU;
  } else {
    if (p_ccb->cfg.fcr.mode == L2CAP_FCR_ERTM_MODE) {
    local_mtu_size = BT_DEFAULT_BUFFER_SIZE - sizeof(BT_HDR) - L2CAP_MIN_OFFSET;
  } else
      local_mtu_size =
          BT_DEFAULT_BUFFER_SIZE - sizeof(BT_HDR) - L2CAP_MIN_OFFSET;
    } else {
      local_mtu_size = L2CAP_MTU_SIZE;

  if ((!p_cfg->mtu_present) || (p_cfg->mtu > local_mtu_size)) {
    }
    if (p_cfg->mtu > local_mtu_size) {
      p_ccb->rem_mtu_size = local_mtu_size;
  } else
    } else {
      p_ccb->rem_mtu_size = p_cfg->mtu;
    }
  }
}

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