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

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

Merge changes Icca1ccd4,I5188c0ca,I476ac69d,I8ca13279 into main am: 8416db35

parents 825dca92 8416db35
Loading
Loading
Loading
Loading
+23 −13
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@
#include "stack/include/btm_log_history.h"
#include "stack/include/btm_status.h"
#include "stack/include/l2c_api.h"
#include "stack/include/l2cap_interface.h"
#include "storage/config_keys.h"
#include "types/hci_role.h"
#include "types/raw_address.h"
@@ -1175,11 +1176,11 @@ void bta_av_str_opened(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
  log::verbose("l2c_cid: 0x{:x} stream_mtu: {}", p_scb->l2c_cid, p_scb->stream_mtu);

  /* Set the media channel as high priority */
  if (!L2CA_SetTxPriority(p_scb->l2c_cid, L2CAP_CHNL_PRIORITY_HIGH)) {
  if (!stack::l2cap::get_interface().L2CA_SetTxPriority(p_scb->l2c_cid, L2CAP_CHNL_PRIORITY_HIGH)) {
    log::warn("Unable to set L2CAP Tx priority peer:{} cid:{}", p_scb->PeerAddress(),
              p_scb->l2c_cid);
  }
  if (!L2CA_SetChnlFlushability(p_scb->l2c_cid, true)) {
  if (!stack::l2cap::get_interface().L2CA_SetChnlFlushability(p_scb->l2c_cid, true)) {
    log::warn("Unable to set L2CAP flush peer:{} cid:{}", p_scb->PeerAddress(), p_scb->l2c_cid);
  }

@@ -1210,7 +1211,7 @@ void bta_av_str_opened(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
            .sep = AVDT_TSEP_INVALID,
    };

    L2CA_SetMediaStreamChannel(p_scb->l2c_cid, true);
    stack::l2cap::get_interface().L2CA_SetMediaStreamChannel(p_scb->l2c_cid, true);

    p = get_btm_client_interface().peer.BTM_ReadRemoteFeatures(p_scb->PeerAddress());
    if (p != NULL) {
@@ -1327,7 +1328,8 @@ void bta_av_do_close(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* /* p_data */) {
  p_scb->use_rtp_header_marker_bit = false;

  /* drop the buffers queued in L2CAP */
  const uint16_t buffers_left = L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
  const uint16_t buffers_left =
          stack::l2cap::get_interface().L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
  if (buffers_left) {
    log::warn("Unable to flush L2CAP ALL channel peer:{} cid:{} buffers_left:{}",
              p_scb->PeerAddress(), p_scb->l2c_cid, buffers_left);
@@ -1933,7 +1935,8 @@ void bta_av_str_stopped(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {

    /* drop the audio buffers queued in L2CAP */
    if (p_data && p_data->api_stop.flush) {
      const uint16_t buffers_left = L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
      const uint16_t buffers_left = stack::l2cap::get_interface().L2CA_FlushChannel(
              p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);

      if (buffers_left) {
        log::warn("Unable to flush all L2CAP ALL channel peer:{} cid:{} buffers_left:{}",
@@ -2061,7 +2064,8 @@ void bta_av_reconfig(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
      bta_av_str_stopped(p_scb, NULL);
    }
    // Drop the buffers queued in L2CAP
    const uint16_t buffers_left = L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
    const uint16_t buffers_left =
            stack::l2cap::get_interface().L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
    if (buffers_left) {
      log::warn("Unable to flush all L2CAP ALL channel peer:{} cid:{} buffers_left:{}",
                p_scb->PeerAddress(), p_scb->l2c_cid, buffers_left);
@@ -2099,7 +2103,8 @@ void bta_av_data_path(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* /* p_data */) {
  }

  // Always get the current number of bufs que'd up
  p_scb->l2c_bufs = (uint8_t)L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_GET);
  p_scb->l2c_bufs = (uint8_t)stack::l2cap::get_interface().L2CA_FlushChannel(p_scb->l2c_cid,
                                                                             L2CAP_FLUSH_CHANS_GET);

  if (!list_is_empty(p_scb->a2dp_list)) {
    p_buf = (BT_HDR*)list_front(p_scb->a2dp_list);
@@ -2434,7 +2439,7 @@ void bta_av_str_closed(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
    get_btm_client_interface().link_policy.BTM_default_unblock_role_switch();
  }

  L2CA_SetMediaStreamChannel(p_scb->l2c_cid, false);
  stack::l2cap::get_interface().L2CA_SetMediaStreamChannel(p_scb->l2c_cid, false);

  if (p_scb->open_status != BTA_AV_SUCCESS) {
    /* must be failure when opening the stream */
@@ -2751,7 +2756,8 @@ void bta_av_suspend_cont(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
      bta_av_ssm_execute(p_scb, BTA_AV_STR_DISC_FAIL_EVT, NULL);
    } else {
      /* drop the buffers queued in L2CAP */
      const uint16_t buffers_left = L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
      const uint16_t buffers_left = stack::l2cap::get_interface().L2CA_FlushChannel(
              p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
      if (buffers_left) {
        log::error("suspend rejected, closing peer:{} cid:{} buffers_left:{}", p_scb->PeerAddress(),
                   p_scb->l2c_cid, buffers_left);
@@ -2806,7 +2812,8 @@ void bta_av_rcfg_cfm(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
    }
    /* started flag is false when reconfigure command is sent */
    /* drop the buffers queued in L2CAP */
    const uint16_t buffers_left = L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
    const uint16_t buffers_left =
            stack::l2cap::get_interface().L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
    if (buffers_left) {
      log::error("reconfig rejected, closing queued  peer:{} cid:{} buffers_left:{}",
                 p_scb->PeerAddress(), p_scb->l2c_cid, buffers_left);
@@ -3071,7 +3078,8 @@ void bta_av_vendor_offload_start_v2(tBTA_AV_SCB* p_scb, A2dpCodecConfigExt* offl
  if (mtu > MAX_3MBPS_AVDTP_MTU) {
    mtu = MAX_3MBPS_AVDTP_MTU;
  }
  if (L2CA_GetRemoteChannelId(p_scb->l2c_cid, &l2cap_channel_handle) == false) {
  if (stack::l2cap::get_interface().L2CA_GetRemoteChannelId(p_scb->l2c_cid,
                                                            &l2cap_channel_handle) == false) {
    log::error("Failed to fetch l2c rcid");
  }

@@ -3122,7 +3130,8 @@ void bta_av_vendor_offload_stop() {
            p_scb->PeerAddress(), BT_TRANSPORT_BR_EDR);
    uint16_t l2cap_channel_handle = 0;

    if (L2CA_GetRemoteChannelId(p_scb->l2c_cid, &l2cap_channel_handle) == false) {
    if (stack::l2cap::get_interface().L2CA_GetRemoteChannelId(p_scb->l2c_cid,
                                                              &l2cap_channel_handle) == false) {
      log::error("Failed to fetch l2c rcid");
    }

@@ -3304,7 +3313,8 @@ static void bta_av_offload_codec_builder(tBTA_AV_SCB* p_scb, tBT_A2DP_OFFLOAD* p
      p_a2dp_offload->sample_rate = BTAV_A2DP_CODEC_SAMPLE_RATE_96000;
      break;
  }
  if (L2CA_GetRemoteChannelId(p_scb->l2c_cid, &p_a2dp_offload->l2c_rcid) == false) {
  if (stack::l2cap::get_interface().L2CA_GetRemoteChannelId(p_scb->l2c_cid,
                                                            &p_a2dp_offload->l2c_rcid) == false) {
    log::error("Failed to fetch l2c rcid");
    return;
  }
+7 −5
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
#include "stack/include/bt_types.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/l2c_api.h"
#include "stack/include/l2cap_interface.h"
#include "stack/include/sdp_api.h"
#include "stack/include/sdp_status.h"
#include "types/raw_address.h"
@@ -1190,12 +1190,14 @@ void bta_av_stream_chg(tBTA_AV_SCB* p_scb, bool started) {

  if (started) {
    /* Let L2CAP know this channel is processed with high priority */
    if (!L2CA_SetAclPriority(p_scb->PeerAddress(), L2CAP_PRIORITY_HIGH)) {
    if (!stack::l2cap::get_interface().L2CA_SetAclPriority(p_scb->PeerAddress(),
                                                           L2CAP_PRIORITY_HIGH)) {
      log::warn("Unable to set L2CAP acl high priority peer:{}", p_scb->PeerAddress());
    }
  } else {
    /* Let L2CAP know this channel is processed with low priority */
    if (!L2CA_SetAclPriority(p_scb->PeerAddress(), L2CAP_PRIORITY_NORMAL)) {
    if (!stack::l2cap::get_interface().L2CA_SetAclPriority(p_scb->PeerAddress(),
                                                           L2CAP_PRIORITY_NORMAL)) {
      log::warn("Unable to set L2CAP acl normal priority peer:{}", p_scb->PeerAddress());
    }
  }
@@ -1436,7 +1438,7 @@ void bta_av_api_disconnect(tBTA_AV_DATA* p_data) {
 *
 ******************************************************************************/
void bta_av_set_use_latency_mode(tBTA_AV_SCB* p_scb, bool use_latency_mode) {
  if (!L2CA_UseLatencyMode(p_scb->PeerAddress(), use_latency_mode)) {
  if (!stack::l2cap::get_interface().L2CA_UseLatencyMode(p_scb->PeerAddress(), use_latency_mode)) {
    log::warn("Unable to set L2CAP latenty mode peer:{} use_latency_mode:{}", p_scb->PeerAddress(),
              use_latency_mode);
  }
@@ -1456,7 +1458,7 @@ void bta_av_api_set_latency(tBTA_AV_DATA* p_data) {

  tL2CAP_LATENCY latency =
          p_data->api_set_latency.is_low_latency ? L2CAP_LATENCY_LOW : L2CAP_LATENCY_NORMAL;
  if (!L2CA_SetAclLatency(p_scb->PeerAddress(), latency)) {
  if (!stack::l2cap::get_interface().L2CA_SetAclLatency(p_scb->PeerAddress(), latency)) {
    log::warn("Unable to set L2CAP latenty mode peer:{} use_latency_mode:{}", p_scb->PeerAddress(),
              latency);
  }
+13 −8
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@
#include "stack/include/btm_inq.h"
#include "stack/include/btm_status.h"
#include "stack/include/gatt_api.h"
#include "stack/include/l2c_api.h"
#include "stack/include/l2cap_interface.h"
#include "stack/include/main_thread.h"
#include "types/bluetooth/uuid.h"
#include "types/raw_address.h"
@@ -290,11 +290,13 @@ void BTA_dm_on_hw_on() {
void bta_dm_disable() {
  /* Set l2cap idle timeout to 0 (so BTE immediately disconnects ACL link after
   * last channel is closed) */
  if (!L2CA_SetIdleTimeoutByBdAddr(RawAddress::kAny, 0, BT_TRANSPORT_BR_EDR)) {
  if (!stack::l2cap::get_interface().L2CA_SetIdleTimeoutByBdAddr(RawAddress::kAny, 0,
                                                                 BT_TRANSPORT_BR_EDR)) {
    log::warn("Unable to set L2CAP idle timeout peer:{} transport:{} timeout:{}", RawAddress::kAny,
              BT_TRANSPORT_BR_EDR, 0);
  }
  if (!L2CA_SetIdleTimeoutByBdAddr(RawAddress::kAny, 0, BT_TRANSPORT_LE)) {
  if (!stack::l2cap::get_interface().L2CA_SetIdleTimeoutByBdAddr(RawAddress::kAny, 0,
                                                                 BT_TRANSPORT_LE)) {
    log::warn("Unable to set L2CAP idle timeout peer:{} transport:{} timeout:{}", RawAddress::kAny,
              BT_TRANSPORT_LE, 0);
  }
@@ -1556,7 +1558,8 @@ bool bta_dm_check_if_only_hd_connected(const RawAddress& peer_addr) {
void bta_dm_ble_set_conn_params(const RawAddress& bd_addr, uint16_t conn_int_min,
                                uint16_t conn_int_max, uint16_t peripheral_latency,
                                uint16_t supervision_tout) {
  L2CA_AdjustConnectionIntervals(&conn_int_min, &conn_int_max, BTM_BLE_CONN_INT_MIN);
  stack::l2cap::get_interface().L2CA_AdjustConnectionIntervals(&conn_int_min, &conn_int_max,
                                                               BTM_BLE_CONN_INT_MIN);

  get_btm_client_interface().ble.BTM_BleSetPrefConnParams(bd_addr, conn_int_min, conn_int_max,
                                                          peripheral_latency, supervision_tout);
@@ -1566,10 +1569,11 @@ void bta_dm_ble_set_conn_params(const RawAddress& bd_addr, uint16_t conn_int_min
void bta_dm_ble_update_conn_params(const RawAddress& bd_addr, uint16_t min_int, uint16_t max_int,
                                   uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
                                   uint16_t max_ce_len) {
  L2CA_AdjustConnectionIntervals(&min_int, &max_int, BTM_BLE_CONN_INT_MIN);
  stack::l2cap::get_interface().L2CA_AdjustConnectionIntervals(&min_int, &max_int,
                                                               BTM_BLE_CONN_INT_MIN);

  if (!L2CA_UpdateBleConnParams(bd_addr, min_int, max_int, latency, timeout, min_ce_len,
                                max_ce_len)) {
  if (!stack::l2cap::get_interface().L2CA_UpdateBleConnParams(bd_addr, min_int, max_int, latency,
                                                              timeout, min_ce_len, max_ce_len)) {
    log::error("Update connection parameters failed!");
  }
}
@@ -1872,7 +1876,8 @@ void bta_dm_ble_subrate_request(const RawAddress& bd_addr, uint16_t subrate_min,
                                uint16_t subrate_max, uint16_t max_latency, uint16_t cont_num,
                                uint16_t timeout) {
  // Logging done in l2c_ble.cc
  if (!L2CA_SubrateRequest(bd_addr, subrate_min, subrate_max, max_latency, cont_num, timeout)) {
  if (!stack::l2cap::get_interface().L2CA_SubrateRequest(bd_addr, subrate_min, subrate_max,
                                                         max_latency, cont_num, timeout)) {
    log::warn("Unable to set L2CAP ble subrating peer:{}", bd_addr);
  }
}
+8 −7
Original line number Diff line number Diff line
@@ -35,15 +35,13 @@
#include "btif/include/btif_debug_conn.h"
#include "hardware/bt_gatt_types.h"
#include "hci/controller_interface.h"
#include "internal_include/bt_trace.h"
#include "main/shim/entry.h"
#include "os/log.h"
#include "osi/include/allocator.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/btm_ble_api_types.h"
#include "stack/include/btm_sec_api.h"
#include "stack/include/l2c_api.h"
#include "stack/include/l2cap_interface.h"
#include "stack/include/main_thread.h"
#include "types/bluetooth/uuid.h"
#include "types/raw_address.h"
@@ -871,7 +869,8 @@ void bta_gattc_cfg_mtu(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) {

void bta_gattc_start_discover_internal(tBTA_GATTC_CLCB* p_clcb) {
  if (p_clcb->transport == BT_TRANSPORT_LE) {
    L2CA_LockBleConnParamsForServiceDiscovery(p_clcb->p_srcb->server_bda, true);
    bluetooth::stack::l2cap::get_interface().L2CA_LockBleConnParamsForServiceDiscovery(
            p_clcb->p_srcb->server_bda, true);
  }

  bta_gattc_init_cache(p_clcb->p_srcb);
@@ -995,7 +994,8 @@ void bta_gattc_disc_cmpl(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* /* p_da
  log::verbose("conn_id=0x{:x}", p_clcb->bta_conn_id);

  if (p_clcb->transport == BT_TRANSPORT_LE) {
    L2CA_LockBleConnParamsForServiceDiscovery(p_clcb->p_srcb->server_bda, false);
    bluetooth::stack::l2cap::get_interface().L2CA_LockBleConnParamsForServiceDiscovery(
            p_clcb->p_srcb->server_bda, false);
  }
  p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE;
  p_clcb->disc_active = false;
@@ -1023,7 +1023,8 @@ void bta_gattc_disc_cmpl(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* /* p_da
  else if (p_q_cmd != NULL) {
    p_clcb->p_q_cmd = NULL;
    /* execute pending operation of link block still present */
    if (L2CA_IsLinkEstablished(p_clcb->p_srcb->server_bda, p_clcb->transport)) {
    if (bluetooth::stack::l2cap::get_interface().L2CA_IsLinkEstablished(p_clcb->p_srcb->server_bda,
                                                                        p_clcb->transport)) {
      bta_gattc_sm_execute(p_clcb, p_q_cmd->hdr.event, p_q_cmd);
    }
    /* if the command executed requeued the cmd, we don't
@@ -1461,7 +1462,7 @@ static void bta_gattc_conn_cback(tGATT_IF gattc_if, const RawAddress& bdaddr, ui
  p_buf->int_conn.hdr.event = connected ? BTA_GATTC_INT_CONN_EVT : BTA_GATTC_INT_DISCONN_EVT;
  p_buf->int_conn.hdr.layer_specific = conn_id;
  p_buf->int_conn.client_if = gattc_if;
  p_buf->int_conn.role = L2CA_GetBleConnRole(bdaddr);
  p_buf->int_conn.role = bluetooth::stack::l2cap::get_interface().L2CA_GetBleConnRole(bdaddr);
  p_buf->int_conn.reason = reason;
  p_buf->int_conn.transport = transport;
  p_buf->int_conn.remote_bda = bdaddr;
+16 −10
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@
#include "stack/include/bt_uuid16.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/btm_status.h"
#include "stack/include/l2c_api.h"  // L2CAP_MIN_OFFSET
#include "stack/include/l2cap_interface.h"
#include "stack/include/main_thread.h"
#include "types/bluetooth/uuid.h"
#include "types/bt_transport.h"
@@ -420,8 +420,9 @@ public:

    log::info("L2CA_UpdateBleConnParams for device {} min_ce_len:{} max_ce_len:{}", address,
              min_ce_len, max_ce_len);
    if (!L2CA_UpdateBleConnParams(address, connection_interval, connection_interval, 0x000A,
                                  0x0064 /*1s*/, min_ce_len, max_ce_len)) {
    if (!stack::l2cap::get_interface().L2CA_UpdateBleConnParams(
                address, connection_interval, connection_interval, 0x000A, 0x0064 /*1s*/,
                min_ce_len, max_ce_len)) {
      log::warn("Unable to update L2CAP ble connection parameters peer:{}", address);
    }
    return connection_interval;
@@ -1318,14 +1319,14 @@ public:

    uint16_t diff_credit = 0;

    uint16_t target_current_credit = L2CA_GetPeerLECocCredit(
    uint16_t target_current_credit = stack::l2cap::get_interface().L2CA_GetPeerLECocCredit(
            target_side->address, GAP_ConnGetL2CAPCid(target_side->gap_handle));
    if (target_current_credit == L2CAP_LE_CREDIT_MAX) {
      log::error("Get target side credit value fail.");
      return true;
    }

    uint16_t other_current_credit = L2CA_GetPeerLECocCredit(
    uint16_t other_current_credit = stack::l2cap::get_interface().L2CA_GetPeerLECocCredit(
            other_side->address, GAP_ConnGetL2CAPCid(other_side->gap_handle));
    if (other_current_credit == L2CAP_LE_CREDIT_MAX) {
      log::error("Get other side credit value fail.");
@@ -1444,7 +1445,8 @@ public:
      encoded_data_left.resize(encoded_size);

      uint16_t cid = GAP_ConnGetL2CAPCid(left->gap_handle);
      uint16_t packets_in_chans = L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_GET);
      uint16_t packets_in_chans =
              stack::l2cap::get_interface().L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_GET);
      if (packets_in_chans > l2cap_flush_threshold) {
        // Compare the two sides LE CoC credit value to confirm need to drop or
        // skip audio packet.
@@ -1456,7 +1458,8 @@ public:
          log::info("{} skipping {} packets", left->address, packets_in_chans);
          left->audio_stats.packet_flush_count += packets_in_chans;
          left->audio_stats.frame_flush_count++;
          const uint16_t buffers_left = L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_ALL);
          const uint16_t buffers_left =
                  stack::l2cap::get_interface().L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_ALL);
          if (buffers_left) {
            log::warn("Unable to flush L2CAP ALL (left HA) channel peer:{} cid:{} buffers_left:{}",
                      left->address, cid, buffers_left);
@@ -1477,7 +1480,8 @@ public:
      encoded_data_right.resize(encoded_size);

      uint16_t cid = GAP_ConnGetL2CAPCid(right->gap_handle);
      uint16_t packets_in_chans = L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_GET);
      uint16_t packets_in_chans =
              stack::l2cap::get_interface().L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_GET);
      if (packets_in_chans > l2cap_flush_threshold) {
        // Compare the two sides LE CoC credit value to confirm need to drop or
        // skip audio packet.
@@ -1490,7 +1494,8 @@ public:
          log::info("{} skipping {} packets", right->address, packets_in_chans);
          right->audio_stats.packet_flush_count += packets_in_chans;
          right->audio_stats.frame_flush_count++;
          const uint16_t buffers_left = L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_ALL);
          const uint16_t buffers_left =
                  stack::l2cap::get_interface().L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_ALL);
          if (buffers_left) {
            log::warn("Unable to flush L2CAP ALL (right HA) channel peer:{} cid:{} buffers_left:{}",
                      right->address, cid, buffers_left);
@@ -1569,7 +1574,8 @@ public:
        RawAddress address = *GAP_ConnGetRemoteAddr(gap_handle);
        uint16_t tx_mtu = GAP_ConnGetRemMtuSize(gap_handle);

        init_credit = L2CA_GetPeerLECocCredit(address, GAP_ConnGetL2CAPCid(gap_handle));
        init_credit = stack::l2cap::get_interface().L2CA_GetPeerLECocCredit(
                address, GAP_ConnGetL2CAPCid(gap_handle));

        log::info("GAP_EVT_CONN_OPENED: bd_addr={} tx_mtu={} init_credit={}", address, tx_mtu,
                  init_credit);
Loading