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

Commit d8ed7e6b authored by Chris Manton's avatar Chris Manton
Browse files

[10/19] get_btm_client_interface().peer.BTM_GetPeerSCA

Bug: 343772702
Test: m .
Flag: EXEMPT, Mechanical Refactor

Change-Id: I4dd4e35adb0da8dfbfbcf437cdbfbecb73a46cef
parent 6e5f5985
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -31,11 +31,10 @@
#include "le_audio/codec_manager.h"
#include "le_audio/devices.h"
#include "le_audio/le_audio_types.h"
#include "le_audio_set_configuration_provider.h"
#include "le_audio_utils.h"
#include "main/shim/entry.h"
#include "metrics_collector.h"
#include "os/log.h"
#include "stack/include/btm_client_interface.h"

namespace bluetooth::le_audio {

@@ -499,8 +498,8 @@ uint8_t LeAudioDeviceGroup::GetSCA(void) const {
  uint8_t sca = bluetooth::hci::iso_manager::kIsoSca0To20Ppm;

  for (const auto& leAudioDevice : leAudioDevices_) {
    uint8_t dev_sca =
        BTM_GetPeerSCA(leAudioDevice.lock()->address_, BT_TRANSPORT_LE);
    uint8_t dev_sca = get_btm_client_interface().peer.BTM_GetPeerSCA(leAudioDevice.lock()->address_,
                                                                     BT_TRANSPORT_LE);

    /* If we could not read SCA from the peer device or sca is 0,
     * then there is no reason to continue.
+4 −5
Original line number Diff line number Diff line
@@ -42,6 +42,10 @@ void bluetooth::manager::SetMockBtmInterface(
                                                           tBT_TRANSPORT transport) -> uint16_t {
    return btm_interface->GetHCIConnHandle(bd_addr, transport);
  };
  mock_btm_client_interface.peer.BTM_GetPeerSCA = [](const RawAddress& remote_bda,
                                                     tBT_TRANSPORT transport) {
    return btm_interface->GetPeerSCA(remote_bda, transport);
  };
}

bool BTM_IsLinkKeyKnown(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
@@ -61,11 +65,6 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr,
                                      p_ref_data, sec_act);
}

uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) {
  log::assert_that(btm_interface != nullptr, "Mock btm interface not set!");
  return btm_interface->GetPeerSCA(remote_bda, transport);
}

void BTM_BleSetPhy(const RawAddress& bd_addr, uint8_t tx_phys, uint8_t rx_phys,
                   uint16_t phy_options) {
  log::assert_that(btm_interface != nullptr, "Mock btm interface not set!");