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

Commit 14ecae5c authored by Chris Manton's avatar Chris Manton
Browse files

mock: [43/63] Remove BTM_ReadRSSI

Use get_btm_client_interface() instead

Bug: 352129816
Test: m .
Flag: EXEMPT, Test infrastructure

Change-Id: Id0935c0f14988d0cf830fce26090d8e0a3028563
parent 70ed4991
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@
#include "osi/include/allocator.h"
#include "osi/include/properties.h"
#include "stack/btm/btm_sec.h"
#include "stack/include/acl_api.h"        // BTM_ReadRSSI
#include "stack/include/acl_api_types.h"  // tBTM_RSSI_RESULT
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
@@ -1973,7 +1972,10 @@ private:
      if (device->num_intervals_since_last_rssi_read >= PERIOD_TO_READ_RSSI_IN_INTERVALS) {
        device->num_intervals_since_last_rssi_read = 0;
        log::debug("bd_addr={}", device->address);
        BTM_ReadRSSI(device->address, read_rssi_callback);
        if (get_btm_client_interface().link_controller.BTM_ReadRSSI(
                    device->address, read_rssi_callback) != BTM_SUCCESS) {
          log::warn("Unable to read RSSI peer:{}", device->address);
        }
      }
    }
  }
+3 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#include "stack/include/acl_api.h"
#include "stack/include/acl_api_types.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/btm_client_interface.h"
#include "types/raw_address.h"

using bluetooth::audio::a2dp::BluetoothAudioStatus;
@@ -914,7 +915,8 @@ static bool btif_a2dp_source_enqueue_callback(BT_HDR* p_buf, size_t frames_n,

    // Request additional debug info if we had to flush buffers
    RawAddress peer_bda = btif_av_source_active_peer();
    tBTM_STATUS status = BTM_ReadRSSI(peer_bda, btm_read_rssi_cb);
    tBTM_STATUS status =
            get_btm_client_interface().link_controller.BTM_ReadRSSI(peer_bda, btm_read_rssi_cb);
    if (status != BTM_CMD_STARTED) {
      log::warn("Cannot read RSSI: status {}", status);
    }
+2 −1
Original line number Diff line number Diff line
@@ -572,7 +572,8 @@ static bt_status_t btif_gattc_read_remote_rssi(int client_if, const RawAddress&

  return do_in_jni_thread(base::Bind(
          [](int client_if, const RawAddress& bd_addr) {
            if (BTM_ReadRSSI(bd_addr, btm_read_rssi_cb) != BTM_SUCCESS) {
            if (get_btm_client_interface().link_controller.BTM_ReadRSSI(
                        bd_addr, btm_read_rssi_cb) != BTM_SUCCESS) {
              log::warn("Unable to read RSSI peer:{} client_if:{}", bd_addr, client_if);
            }
          },
+0 −5
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ struct acl_get_connection_from_address acl_get_connection_from_address;
struct btm_acl_for_bda btm_acl_for_bda;
struct acl_get_connection_from_handle acl_get_connection_from_handle;
struct BTM_ReadFailedContactCounter BTM_ReadFailedContactCounter;
struct BTM_ReadRSSI BTM_ReadRSSI;
struct BTM_ReadTxPower BTM_ReadTxPower;
struct BTM_SetLinkSuperTout BTM_SetLinkSuperTout;
struct BTM_SwitchRoleToCentral BTM_SwitchRoleToCentral;
@@ -239,10 +238,6 @@ tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda, tBTM_CMPL
  inc_func_call_count(__func__);
  return test::mock::stack_acl::BTM_ReadFailedContactCounter(remote_bda, p_cb);
}
tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) {
  inc_func_call_count(__func__);
  return test::mock::stack_acl::BTM_ReadRSSI(remote_bda, p_cb);
}
tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda, tBT_TRANSPORT transport,
                            tBTM_CMPL_CB* p_cb) {
  inc_func_call_count(__func__);
+0 −11
Original line number Diff line number Diff line
@@ -284,17 +284,6 @@ struct BTM_ReadFailedContactCounter {
  }
};
extern struct BTM_ReadFailedContactCounter BTM_ReadFailedContactCounter;
// Name: BTM_ReadRSSI
// Params: const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb
// Returns: tBTM_STATUS
struct BTM_ReadRSSI {
  std::function<tBTM_STATUS(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb)> body{
          [](const RawAddress& /* remote_bda */, tBTM_CMPL_CB* /* p_cb */) { return BTM_SUCCESS; }};
  tBTM_STATUS operator()(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) {
    return body(remote_bda, p_cb);
  }
};
extern struct BTM_ReadRSSI BTM_ReadRSSI;
// Name: BTM_ReadTxPower
// Params: const RawAddress& remote_bda, tBT_TRANSPORT transport,
// tBTM_CMPL_CB* p_cb Returns: tBTM_STATUS