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

Commit 7145a9fe authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Increase MPS for LE CoC to one LE Buffer Size

This should improve throughtput, and reduce number of LE-U PDUs needed
to send message over LE channel.

Test: compilation
Change-Id: Ic1e203eaec0b8012984f27d3c488ea6eb0945399
parent f2105535
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include "bta_sys.h"
#include "btm_api.h"
#include "btm_int.h"
#include "device/include/controller.h"
#include "gap_api.h"
#include "l2c_api.h"
#include "osi/include/allocator.h"
@@ -51,8 +52,6 @@

using bluetooth::Uuid;

constexpr uint16_t DEFAULT_LE_MPS = 23;

tBTA_JV_CB bta_jv_cb;

/* one of these exists for each client */
@@ -935,9 +934,10 @@ void bta_jv_l2cap_connect(int32_t type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
    if ((type != BTA_JV_CONN_TYPE_L2CAP) ||
        (bta_jv_check_psm(remote_psm))) /* allowed */
    {
      handle = GAP_ConnOpen("", sec_id, 0, &peer_bd_addr, remote_psm,
                            DEFAULT_LE_MPS, &cfg, ertm_info.get(), sec_mask,
                            chan_mode_mask, bta_jv_l2cap_client_cback, type);
      uint16_t max_mps = controller_get_interface()->get_acl_data_size_ble();
      handle = GAP_ConnOpen("", sec_id, 0, &peer_bd_addr, remote_psm, max_mps,
                            &cfg, ertm_info.get(), sec_mask, chan_mode_mask,
                            bta_jv_l2cap_client_cback, type);
      if (handle != GAP_INVALID_HANDLE) {
        evt_data.status = BTA_JV_SUCCESS;
      }
@@ -1081,13 +1081,14 @@ void bta_jv_l2cap_start_server(int32_t type, tBTA_SEC sec_mask,
  */

  uint8_t sec_id = bta_jv_alloc_sec_id();
  uint16_t max_mps = controller_get_interface()->get_acl_data_size_ble();
  /* PSM checking is not required for LE COC */
  if (0 == sec_id ||
      ((type == BTA_JV_CONN_TYPE_L2CAP) && (!bta_jv_check_psm(local_psm))) ||
      (handle = GAP_ConnOpen("JV L2CAP", sec_id, 1, nullptr, local_psm,
                             DEFAULT_LE_MPS, &cfg, ertm_info.get(), sec_mask,
                             chan_mode_mask, bta_jv_l2cap_server_cback,
                             type)) == GAP_INVALID_HANDLE) {
      (handle = GAP_ConnOpen("JV L2CAP", sec_id, 1, nullptr, local_psm, max_mps,
                             &cfg, ertm_info.get(), sec_mask, chan_mode_mask,
                             bta_jv_l2cap_server_cback, type)) ==
          GAP_INVALID_HANDLE) {
    bta_jv_free_sec_id(&sec_id);
    evt_data.status = BTA_JV_FAILURE;
  } else {