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

Commit 6a3fcac8 authored by Chris Manton's avatar Chris Manton
Browse files

Use proper types tBTM_IO_CAP

Bug: 188297862
Test: mma .

Change-Id: I4ce46c6cde6fad6222cadfaba54de40f46ee2dcd
parent 389e19a0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3858,7 +3858,8 @@ static void ble_io_req(const RawAddress& bd_addr, tBTM_IO_CAP* p_io_cap,

  btif_dm_set_oob_for_le_io_req(bd_addr, p_oob_data, p_auth_req);

  if (bte_appl_cfg.ble_io_cap <= 4) *p_io_cap = bte_appl_cfg.ble_io_cap;
  if (bte_appl_cfg.ble_io_cap <= 4)
    *p_io_cap = static_cast<tBTM_IO_CAP>(bte_appl_cfg.ble_io_cap);

  if (bte_appl_cfg.ble_init_key <= BTM_BLE_INITIATOR_KEY_SIZE)
    *p_init_key = bte_appl_cfg.ble_init_key;
+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include "bt_target.h"
#include "stack/include/bt_device_type.h"
#include "stack/include/bt_octets.h"
#include "stack/include/btm_api_types.h"
#include "types/ble_address_with_type.h"
#include "types/raw_address.h"

@@ -142,7 +143,7 @@ bt_status_t btif_storage_set_remote_device_property(
 *                  returns BTM_LOCAL_IO_CAPS.
 *
 ******************************************************************************/
uint8_t btif_storage_get_local_io_caps();
tBTM_IO_CAP btif_storage_get_local_io_caps();

/*******************************************************************************
 *
+3 −3
Original line number Diff line number Diff line
@@ -584,9 +584,9 @@ static uint8_t btif_storage_get_io_cap_property(bt_property_type_t type,
 *                  returns BTM_LOCAL_IO_CAPS.
 *
 ******************************************************************************/
uint8_t btif_storage_get_local_io_caps() {
  return btif_storage_get_io_cap_property(BT_PROPERTY_LOCAL_IO_CAPS,
                                          BTM_LOCAL_IO_CAPS);
tBTM_IO_CAP btif_storage_get_local_io_caps() {
  return static_cast<tBTM_IO_CAP>(btif_storage_get_io_cap_property(
      BT_PROPERTY_LOCAL_IO_CAPS, BTM_LOCAL_IO_CAPS));
}

/** Helper function for fetching a bt_property of the adapter. */
+2 −1
Original line number Diff line number Diff line
@@ -182,7 +182,8 @@ class ShimUi : public bluetooth::security::UI {
      // Call sp_cback for IO_RSP
      tBTM_SP_IO_RSP io_rsp_evt_data;
      io_rsp_evt_data.bd_addr = bluetooth::ToRawAddress(address.GetAddress());
      io_rsp_evt_data.io_cap = gd_legacy_io_caps_map_[data.GetRemoteIoCaps()];
      io_rsp_evt_data.io_cap = static_cast<tBTM_IO_CAP>(
          gd_legacy_io_caps_map_[data.GetRemoteIoCaps()]);
      io_rsp_evt_data.auth_req =
          gd_legacy_auth_reqs_map_[data.GetRemoteAuthReqs()];
      io_rsp_evt_data.auth_req = BTM_AUTH_AP_YES;
+5 −1
Original line number Diff line number Diff line
@@ -2739,7 +2739,11 @@ void btm_io_capabilities_rsp(const uint8_t* p) {
  tBTM_SP_IO_RSP evt_data;

  STREAM_TO_BDADDR(evt_data.bd_addr, p);
  STREAM_TO_UINT8(evt_data.io_cap, p);

  uint8_t io_cap;
  STREAM_TO_UINT8(io_cap, p);
  evt_data.io_cap = static_cast<tBTM_IO_CAP>(io_cap);

  STREAM_TO_UINT8(evt_data.oob_data, p);
  STREAM_TO_UINT8(evt_data.auth_req, p);

Loading