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

Commit 4d8fdaac authored by Chris Manton's avatar Chris Manton
Browse files

mock: [50/63] Remove BTM_SetBleDataLength

Use get_btm_client_interface() instead

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

Change-Id: I938709b5fdc307d932d95e4c4a7e3f2729aff44d
parent 2ad6a9b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1597,7 +1597,7 @@ void bta_dm_ble_set_data_length(const RawAddress& bd_addr) {
  uint16_t max_len =
  uint16_t max_len =
          bluetooth::shim::GetController()->GetLeMaximumDataLength().supported_max_tx_octets_;
          bluetooth::shim::GetController()->GetLeMaximumDataLength().supported_max_tx_octets_;


  if (BTM_SetBleDataLength(bd_addr, max_len) != BTM_SUCCESS) {
  if (get_btm_client_interface().ble.BTM_SetBleDataLength(bd_addr, max_len) != BTM_SUCCESS) {
    log::info("Unable to set ble data length:{}", max_len);
    log::info("Unable to set ble data length:{}", max_len);
  }
  }
}
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -525,7 +525,9 @@ public:


    // Set data length
    // Set data length
    // TODO(jpawlowski: for 16khz only 87 is required, optimize
    // TODO(jpawlowski: for 16khz only 87 is required, optimize
    BTM_SetBleDataLength(address, 167);
    if (get_btm_client_interface().ble.BTM_SetBleDataLength(address, 167) != BTM_SUCCESS) {
      log::warn("Unable to set BLE data length peer:{} size:{}", address, 167);
    }


    if (BTM_SecIsSecurityPending(address)) {
    if (BTM_SecIsSecurityPending(address)) {
      /* if security collision happened, wait for encryption done
      /* if security collision happened, wait for encryption done
+4 −1
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@
#include "stack/include/ais_api.h"
#include "stack/include/ais_api.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/l2cap_acl_interface.h"
#include "stack/include/l2cap_acl_interface.h"
#include "stack/include/l2cdefs.h"
#include "stack/include/l2cdefs.h"
#include "stack/include/sdp_api.h"
#include "stack/include/sdp_api.h"
@@ -843,7 +844,9 @@ void GATTC_UpdateUserAttMtuIfNeeded(const RawAddress& remote_bda, tBT_TRANSPORT
  }
  }


  p_tcb->max_user_mtu = user_mtu;
  p_tcb->max_user_mtu = user_mtu;
  BTM_SetBleDataLength(remote_bda, user_mtu);
  if (get_btm_client_interface().ble.BTM_SetBleDataLength(remote_bda, user_mtu) != BTM_SUCCESS) {
    log::warn("Unable to set ble data length peer:{} mtu:{}", remote_bda, user_mtu);
  }
}
}


std::list<uint16_t> GATTC_GetAndRemoveListOfConnIdsWaitingForMtuRequest(
std::list<uint16_t> GATTC_GetAndRemoveListOfConnIdsWaitingForMtuRequest(
+6 −4
Original line number Original line Diff line number Diff line
@@ -31,13 +31,11 @@
#include "gatt_int.h"
#include "gatt_int.h"
#include "hardware/bt_gatt_types.h"
#include "hardware/bt_gatt_types.h"
#include "internal_include/bt_target.h"
#include "internal_include/bt_target.h"
#include "internal_include/bt_trace.h"
#include "os/log.h"
#include "osi/include/allocator.h"
#include "osi/include/allocator.h"
#include "osi/include/osi.h"
#include "stack/arbiter/acl_arbiter.h"
#include "stack/arbiter/acl_arbiter.h"
#include "stack/eatt/eatt.h"
#include "stack/eatt/eatt.h"
#include "stack/include/bt_types.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_client_interface.h"
#include "types/bluetooth/uuid.h"
#include "types/bluetooth/uuid.h"


#define GATT_WRITE_LONG_HDR_SIZE 5 /* 1 opcode + 2 handle + 2 offset */
#define GATT_WRITE_LONG_HDR_SIZE 5 /* 1 opcode + 2 handle + 2 offset */
@@ -1127,7 +1125,11 @@ void gatt_process_mtu_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, uint16_t len, uint


    log::info("MTU Exchange resulted in: {}", tcb.payload_size);
    log::info("MTU Exchange resulted in: {}", tcb.payload_size);


    BTM_SetBleDataLength(tcb.peer_bda, tcb.max_user_mtu + L2CAP_PKT_OVERHEAD);
    if (get_btm_client_interface().ble.BTM_SetBleDataLength(
                tcb.peer_bda, tcb.max_user_mtu + L2CAP_PKT_OVERHEAD) != BTM_SUCCESS) {
      log::warn("Unable to set BLE data length peer:{} mtu:{}", tcb.peer_bda,
                tcb.max_user_mtu + L2CAP_PKT_OVERHEAD);
    }
  }
  }


  gatt_end_operation(p_clcb, status, NULL);
  gatt_end_operation(p_clcb, status, NULL);
+6 −1
Original line number Original line Diff line number Diff line
@@ -37,6 +37,7 @@
#include "stack/eatt/eatt.h"
#include "stack/eatt/eatt.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/l2cdefs.h"
#include "stack/include/l2cdefs.h"
#include "types/bluetooth/uuid.h"
#include "types/bluetooth/uuid.h"


@@ -869,7 +870,11 @@ static void gatts_process_mtu_req(tGATT_TCB& tcb, uint16_t cid, uint16_t len, ui
  log::info("MTU {} request from remote ({}), resulted MTU {}", mtu, tcb.peer_bda,
  log::info("MTU {} request from remote ({}), resulted MTU {}", mtu, tcb.peer_bda,
            tcb.payload_size);
            tcb.payload_size);


  BTM_SetBleDataLength(tcb.peer_bda, tcb.payload_size + L2CAP_PKT_OVERHEAD);
  if (get_btm_client_interface().ble.BTM_SetBleDataLength(
              tcb.peer_bda, tcb.payload_size + L2CAP_PKT_OVERHEAD) != BTM_SUCCESS) {
    log::warn("Unable to set BLE data length peer:{} mtu:{}", tcb.peer_bda,
              tcb.payload_size + L2CAP_PKT_OVERHEAD);
  }


  BT_HDR* p_buf = attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg, GATT_DEF_BLE_MTU_SIZE);
  BT_HDR* p_buf = attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg, GATT_DEF_BLE_MTU_SIZE);
  attp_send_sr_msg(tcb, cid, p_buf);
  attp_send_sr_msg(tcb, cid, p_buf);
Loading