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

Commit 3a0e4ecb authored by Chris Manton's avatar Chris Manton
Browse files

stack::btm Enforce nodiscard for internal APIs

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

Change-Id: I1368e117d51df1db6081b3f7fa5f92223f23faf4
parent f22f5622
Loading
Loading
Loading
Loading
+60 −49
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ void BTM_reset_complete();
 * Returns          true if device is up, else false
 *
 ******************************************************************************/
bool BTM_IsDeviceUp(void);
[[nodiscard]] bool BTM_IsDeviceUp(void);

/*******************************************************************************
 *
@@ -70,7 +70,7 @@ bool BTM_IsDeviceUp(void);
 * Returns          BTM_CMD_STARTED if successful, otherwise an error
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name);
[[nodiscard]] tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name);

/*******************************************************************************
 *
@@ -81,7 +81,7 @@ tBTM_STATUS BTM_SetLocalDeviceName(const char* p_name);
 * Returns          BTM_SUCCESS if successful, otherwise an error
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS dev_class);
[[nodiscard]] tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS dev_class);

/*******************************************************************************
 *
@@ -96,7 +96,7 @@ tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS dev_class);
 *                              is returned and p_name is set to NULL
 *
 ******************************************************************************/
tBTM_STATUS BTM_ReadLocalDeviceName(const char** p_name);
[[nodiscard]] tBTM_STATUS BTM_ReadLocalDeviceName(const char** p_name);

/*******************************************************************************
 *
@@ -108,7 +108,7 @@ tBTM_STATUS BTM_ReadLocalDeviceName(const char** p_name);
 * Returns          BTM_CMD_STARTED if successful, otherwise an error
 *
 ******************************************************************************/
tBTM_STATUS BTM_ReadLocalDeviceNameFromController(
[[nodiscard]] tBTM_STATUS BTM_ReadLocalDeviceNameFromController(
    tBTM_CMPL_CB* p_rln_cmpl_cback);

/*******************************************************************************
@@ -120,7 +120,7 @@ tBTM_STATUS BTM_ReadLocalDeviceNameFromController(
 * Returns          the device class
 *
 ******************************************************************************/
DEV_CLASS BTM_ReadDeviceClass(void);
[[nodiscard]] DEV_CLASS BTM_ReadDeviceClass(void);

/*******************************************************************************
 *
@@ -166,7 +166,7 @@ void BTM_WriteVoiceSettings(uint16_t settings);
 *
 *
 ******************************************************************************/
tBTM_STATUS BTM_EnableTestMode(void);
[[nodiscard]] tBTM_STATUS BTM_EnableTestMode(void);

/*******************************************************************************
 * DEVICE DISCOVERY FUNCTIONS - Inquiry, Remote Name, Discovery, Class of Device
@@ -188,7 +188,7 @@ tBTM_STATUS BTM_EnableTestMode(void);
 *                  BTM_WRONG_MODE if the device is not up.
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode);
[[nodiscard]] tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode);

/*******************************************************************************
 *
@@ -224,7 +224,7 @@ tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode);
 *                  BTM_WRONG_MODE if the device is not up.
 *
 ******************************************************************************/
tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
[[nodiscard]] tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
                                           tBTM_CMPL_CB* p_cmpl_cb);

/*******************************************************************************
@@ -237,7 +237,7 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
 *                  BTM_GENERAL_INQUIRY_ACTIVE if a general inquiry is active
 *
 ******************************************************************************/
uint16_t BTM_IsInquiryActive(void);
[[nodiscard]] uint16_t BTM_IsInquiryActive(void);

/*******************************************************************************
 *
@@ -262,7 +262,7 @@ void BTM_CancelInquiry(void);
 *                  BTM_WRONG_MODE if the device is not up.
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetConnectability(uint16_t page_mode);
[[nodiscard]] tBTM_STATUS BTM_SetConnectability(uint16_t page_mode);

/*******************************************************************************
 *
@@ -280,7 +280,7 @@ tBTM_STATUS BTM_SetConnectability(uint16_t page_mode);
 *                  BTM_WRONG_MODE if the device is not up.
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetInquiryMode(uint8_t mode);
[[nodiscard]] tBTM_STATUS BTM_SetInquiryMode(uint8_t mode);

void BTM_EnableInterlacedInquiryScan();

@@ -310,7 +310,7 @@ void BTM_EnableInterlacedPageScan();
 *                  BTM_WRONG_MODE if the device is not up.
 *
 ******************************************************************************/
tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda,
[[nodiscard]] tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda,
                                                   tBTM_NAME_CMPL_CB* p_cb,
                                                   tBT_TRANSPORT transport);

@@ -331,7 +331,7 @@ tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda,
 *                  BTM_WRONG_MODE if there is no active remote name request.
 *
 ******************************************************************************/
tBTM_STATUS BTM_CancelRemoteDeviceName(void);
[[nodiscard]] tBTM_STATUS BTM_CancelRemoteDeviceName(void);

/*******************************************************************************
 *
@@ -341,7 +341,7 @@ tBTM_STATUS BTM_CancelRemoteDeviceName(void);
 *                  received on LE transport for this device.
 *
 ******************************************************************************/
bool BTM_IsRemoteVersionReceived(const RawAddress& remote_bda);
[[nodiscard]] bool BTM_IsRemoteVersionReceived(const RawAddress& remote_bda);

/*******************************************************************************
 *
@@ -352,8 +352,10 @@ bool BTM_IsRemoteVersionReceived(const RawAddress& remote_bda);
 * Returns          true if data valid, false otherwise
 *
 ******************************************************************************/
bool BTM_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version,
                           uint16_t* manufacturer, uint16_t* lmp_sub_version);
[[nodiscard]] bool BTM_ReadRemoteVersion(const RawAddress& addr,
                                         uint8_t* lmp_version,
                                         uint16_t* manufacturer,
                                         uint16_t* lmp_sub_version);

/*******************************************************************************
 *
@@ -367,7 +369,7 @@ bool BTM_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version,
 *                  HCI_FEATURE_BYTES_PER_PAGE bytes.
 *
 ******************************************************************************/
uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr);
[[nodiscard]] uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr);

/*******************************************************************************
 *
@@ -381,7 +383,7 @@ uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr);
 * Returns          pointer to entry, or NULL if not found
 *
 ******************************************************************************/
tBTM_INQ_INFO* BTM_InqDbRead(const RawAddress& p_bda);
[[nodiscard]] tBTM_INQ_INFO* BTM_InqDbRead(const RawAddress& p_bda);

/*******************************************************************************
 *
@@ -395,7 +397,7 @@ tBTM_INQ_INFO* BTM_InqDbRead(const RawAddress& p_bda);
 * Returns          pointer to first in-use entry, or NULL if DB is empty
 *
 ******************************************************************************/
tBTM_INQ_INFO* BTM_InqDbFirst(void);
[[nodiscard]] tBTM_INQ_INFO* BTM_InqDbFirst(void);

/*******************************************************************************
 *
@@ -408,7 +410,7 @@ tBTM_INQ_INFO* BTM_InqDbFirst(void);
 * Returns          pointer to next in-use entry, or NULL if no more found.
 *
 ******************************************************************************/
tBTM_INQ_INFO* BTM_InqDbNext(tBTM_INQ_INFO* p_cur);
[[nodiscard]] tBTM_INQ_INFO* BTM_InqDbNext(tBTM_INQ_INFO* p_cur);

/*******************************************************************************
 *
@@ -424,7 +426,7 @@ tBTM_INQ_INFO* BTM_InqDbNext(tBTM_INQ_INFO* p_cur);
 *                          is active, otherwise BTM_SUCCESS
 *
 ******************************************************************************/
tBTM_STATUS BTM_ClearInqDb(const RawAddress* p_bda);
[[nodiscard]] tBTM_STATUS BTM_ClearInqDb(const RawAddress* p_bda);

/*****************************************************************************
 *  (e)SCO CHANNEL MANAGEMENT FUNCTIONS
@@ -446,9 +448,11 @@ tBTM_STATUS BTM_ClearInqDb(const RawAddress* p_bda);
 *                                   with the sco index used for the connection.
 *
 ******************************************************************************/
tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig,
                          uint16_t pkt_types, uint16_t* p_sco_inx,
                          tBTM_SCO_CB* p_conn_cb, tBTM_SCO_CB* p_disc_cb);
[[nodiscard]] tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda,
                                        bool is_orig, uint16_t pkt_types,
                                        uint16_t* p_sco_inx,
                                        tBTM_SCO_CB* p_conn_cb,
                                        tBTM_SCO_CB* p_disc_cb);

/*******************************************************************************
 *
@@ -459,7 +463,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig,
 * Returns          BTM_CMD_STARTED if successfully initiated, otherwise error
 *
 ******************************************************************************/
tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx);
[[nodiscard]] tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx);
void BTM_RemoveSco(const RawAddress& bda);

/*******************************************************************************
@@ -472,7 +476,7 @@ void BTM_RemoveSco(const RawAddress& bda);
 * Returns          pointer to BD address or NULL if not known
 *
 ******************************************************************************/
const RawAddress* BTM_ReadScoBdAddr(uint16_t sco_inx);
[[nodiscard]] const RawAddress* BTM_ReadScoBdAddr(uint16_t sco_inx);

/*******************************************************************************
 *
@@ -487,7 +491,7 @@ const RawAddress* BTM_ReadScoBdAddr(uint16_t sco_inx);
 *                  BTM_BUSY if there are one or more active (e)SCO links.
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms);
[[nodiscard]] tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms);

/*******************************************************************************
 *
@@ -502,7 +506,8 @@ tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms);
 *                  BTM_ILLEGAL_VALUE if there is an illegal sco_inx
 *
 ******************************************************************************/
tBTM_STATUS BTM_RegForEScoEvts(uint16_t sco_inx, tBTM_ESCO_CBACK* p_esco_cback);
[[nodiscard]] tBTM_STATUS BTM_RegForEScoEvts(uint16_t sco_inx,
                                             tBTM_ESCO_CBACK* p_esco_cback);

/*******************************************************************************
 *
@@ -534,7 +539,7 @@ void BTM_EScoConnRsp(uint16_t sco_inx, uint8_t hci_status,
 * Returns          uint8_t
 *
 ******************************************************************************/
uint8_t BTM_GetNumScoLinks(void);
[[nodiscard]] uint8_t BTM_GetNumScoLinks(void);

/*******************************************************************************
 *
@@ -546,7 +551,7 @@ uint8_t BTM_GetNumScoLinks(void);
 * Returns          Data with SCO related debug dump.
 *
 ******************************************************************************/
tBTM_SCO_DEBUG_DUMP BTM_GetScoDebugDump(void);
[[nodiscard]] tBTM_SCO_DEBUG_DUMP BTM_GetScoDebugDump(void);

/*******************************************************************************
 *
@@ -563,7 +568,8 @@ tBTM_SCO_DEBUG_DUMP BTM_GetScoDebugDump(void);
 *                  BT_DEVICE_TYPE_BLE if only BLE transport is supported.
 *
 ******************************************************************************/
tBT_DEVICE_TYPE BTM_GetPeerDeviceTypeFromFeatures(const RawAddress& bd_addr);
[[nodiscard]] tBT_DEVICE_TYPE BTM_GetPeerDeviceTypeFromFeatures(
    const RawAddress& bd_addr);

/*******************************************************************************
 *
@@ -575,7 +581,7 @@ tBT_DEVICE_TYPE BTM_GetPeerDeviceTypeFromFeatures(const RawAddress& bd_addr);
 * Returns          the handle of the connection, or 0xFFFF if none.
 *
 ******************************************************************************/
uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda,
[[nodiscard]] uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda,
                                            tBT_TRANSPORT transport);

/*******************************************************************************
@@ -587,7 +593,8 @@ uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda,
 * Returns          True when PHY 2M supported false otherwise
 *
 ******************************************************************************/
bool BTM_IsPhy2mSupported(const RawAddress& remote_bda, tBT_TRANSPORT transport);
[[nodiscard]] bool BTM_IsPhy2mSupported(const RawAddress& remote_bda,
                                        tBT_TRANSPORT transport);

/*******************************************************************************
 *
@@ -609,7 +616,8 @@ void BTM_RequestPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport);
 *                  is not supported by peer device or ACL does not exist
 *
 ******************************************************************************/
uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport);
[[nodiscard]] uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda,
                                     tBT_TRANSPORT transport);

/*******************************************************************************
 *
@@ -624,7 +632,7 @@ uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport);
 *                  BTM_MODE_UNSUPPORTED - if local device cannot support it
 *
 ******************************************************************************/
tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff);
[[nodiscard]] tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff);

/*******************************************************************************
 *
@@ -639,7 +647,8 @@ tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff);
 *                  false - if not found
 *
 ******************************************************************************/
bool BTM_HasEirService(const uint32_t* p_eir_uuid, uint16_t uuid16);
[[nodiscard]] bool BTM_HasEirService(const uint32_t* p_eir_uuid,
                                     uint16_t uuid16);

/*******************************************************************************
 *
@@ -687,7 +696,8 @@ void BTM_RemoveEirService(uint32_t* p_eir_uuid, uint16_t uuid16);
 *                  HCI_EIR_COMPLETE_16BITS_UUID_TYPE, otherwise
 *
 ******************************************************************************/
uint8_t BTM_GetEirSupportedServices(uint32_t* p_eir_uuid, uint8_t** p,
[[nodiscard]] uint8_t BTM_GetEirSupportedServices(uint32_t* p_eir_uuid,
                                                  uint8_t** p,
                                                  uint8_t max_num_uuid16,
                                                  uint8_t* p_num_uuid16);

@@ -714,19 +724,20 @@ uint8_t BTM_GetEirSupportedServices(uint32_t* p_eir_uuid, uint8_t** p,
 *                  HCI_EIR_MORE_128BITS_UUID_TYPE
 *
 ******************************************************************************/
uint8_t BTM_GetEirUuidList(const uint8_t* p_eir, size_t eir_len,
[[nodiscard]] uint8_t BTM_GetEirUuidList(const uint8_t* p_eir, size_t eir_len,
                                         uint8_t uuid_size, uint8_t* p_num_uuid,
                           uint8_t* p_uuid_list, uint8_t max_num_uuid);
                                         uint8_t* p_uuid_list,
                                         uint8_t max_num_uuid);

/**
 * Send remote name request, either to legacy HCI, or to GD shim Name module
 */
void SendRemoteNameRequest(const RawAddress& raw_address);

bool BTM_IsScoActiveByBdaddr(const RawAddress& remote_bda);
[[nodiscard]] bool BTM_IsScoActiveByBdaddr(const RawAddress& remote_bda);

/* Read maximum data packet that can be sent over current connection */
uint16_t BTM_GetMaxPacketSize(const RawAddress& addr);
[[nodiscard]] uint16_t BTM_GetMaxPacketSize(const RawAddress& addr);

typedef void(BTM_CONSOLIDATION_CB)(const RawAddress& identity_addr,
                                   const RawAddress& rpa);
+69 −61
Original line number Diff line number Diff line
@@ -32,9 +32,9 @@

struct btm_client_interface_t {
  struct {
    tBTM_STATUS (*BTM_PmRegister)(uint8_t mask, uint8_t* p_pm_id,
    [[nodiscard]] tBTM_STATUS (*BTM_PmRegister)(uint8_t mask, uint8_t* p_pm_id,
                                                tBTM_PM_STATUS_CBACK* p_cback);
    uint16_t (*BTM_GetHCIConnHandle)(const RawAddress& bd_addr,
    [[nodiscard]] uint16_t (*BTM_GetHCIConnHandle)(const RawAddress& bd_addr,
                                                   tBT_TRANSPORT transport);
    void (*BTM_VendorSpecificCommand)(uint16_t opcode, uint8_t param_len,
                                      uint8_t* p_param_buf,
@@ -50,32 +50,37 @@ struct btm_client_interface_t {

  // Acl peer and lifecycle
  struct {
    bool (*BTM_IsAclConnectionUp)(const RawAddress& bd_addr,
    [[nodiscard]] bool (*BTM_IsAclConnectionUp)(const RawAddress& bd_addr,
                                                tBT_TRANSPORT transport);
    bool (*BTM_ReadConnectedTransportAddress)(RawAddress* bd_addr,
    [[nodiscard]] bool (*BTM_ReadConnectedTransportAddress)(
        RawAddress* bd_addr, tBT_TRANSPORT transport);
    [[nodiscard]] tBTM_STATUS (*BTM_CancelRemoteDeviceName)(void);
    [[nodiscard]] tBTM_STATUS (*BTM_ReadRemoteDeviceName)(
        const RawAddress& bd_addr, tBTM_NAME_CMPL_CB* p_cb,
        tBT_TRANSPORT transport);
    tBTM_STATUS (*BTM_CancelRemoteDeviceName)(void);
    tBTM_STATUS (*BTM_ReadRemoteDeviceName)(const RawAddress& bd_addr,
                                            tBTM_NAME_CMPL_CB* p_cb,
                                            tBT_TRANSPORT transport);
    uint8_t* (*BTM_ReadRemoteFeatures)(const RawAddress&);
    [[nodiscard]] uint8_t* (*BTM_ReadRemoteFeatures)(const RawAddress&);
    void (*BTM_ReadDevInfo)(const RawAddress& bd_addr,
                            tBT_DEVICE_TYPE* p_dev_type,
                            tBLE_ADDR_TYPE* p_addr_type);
    uint16_t (*BTM_GetMaxPacketSize)(const RawAddress& bd_addr);
    bool (*BTM_ReadRemoteVersion)(const RawAddress& addr, uint8_t* lmp_version,
    [[nodiscard]] uint16_t (*BTM_GetMaxPacketSize)(const RawAddress& bd_addr);
    [[nodiscard]] bool (*BTM_ReadRemoteVersion)(const RawAddress& addr,
                                                uint8_t* lmp_version,
                                                uint16_t* manufacturer,
                                                uint16_t* lmp_sub_version);
  } peer;

  struct {
    tBTM_STATUS (*BTM_GetRole)(const RawAddress& remote_bd_addr,
    [[nodiscard]] tBTM_STATUS (*BTM_GetRole)(const RawAddress& remote_bd_addr,
                                             tHCI_ROLE* p_role);
    tBTM_STATUS (*BTM_SetPowerMode)(uint8_t pm_id, const RawAddress& bd_addr,
    [[nodiscard]] tBTM_STATUS (*BTM_SetPowerMode)(uint8_t pm_id,
                                                  const RawAddress& bd_addr,
                                                  const tBTM_PM_PWR_MD* p_mode);
    tBTM_STATUS (*BTM_SetSsrParams)(const RawAddress& bd_addr, uint16_t max_lat,
                                    uint16_t min_rmt_to, uint16_t min_loc_to);
    tBTM_STATUS (*BTM_SwitchRoleToCentral)(const RawAddress& remote_bd_addr);
    [[nodiscard]] tBTM_STATUS (*BTM_SetSsrParams)(const RawAddress& bd_addr,
                                                  uint16_t max_lat,
                                                  uint16_t min_rmt_to,
                                                  uint16_t min_loc_to);
    [[nodiscard]] tBTM_STATUS (*BTM_SwitchRoleToCentral)(
        const RawAddress& remote_bd_addr);
    void (*BTM_block_role_switch_for)(const RawAddress& peer_addr);
    void (*BTM_block_sniff_mode_for)(const RawAddress& peer_addr);
    void (*BTM_default_unblock_role_switch)();
@@ -85,19 +90,20 @@ struct btm_client_interface_t {
  } link_policy;

  struct {
    tBTM_STATUS (*BTM_GetLinkSuperTout)(const RawAddress& bd_addr,
    [[nodiscard]] tBTM_STATUS (*BTM_GetLinkSuperTout)(const RawAddress& bd_addr,
                                                      uint16_t* p_timeout);
    tBTM_STATUS (*BTM_ReadRSSI)(const RawAddress& bd_addr, tBTM_CMPL_CB* p_cb);
    [[nodiscard]] tBTM_STATUS (*BTM_ReadRSSI)(const RawAddress& bd_addr,
                                              tBTM_CMPL_CB* p_cb);
  } link_controller;

  SecurityClientInterface security;
  struct {
    tBTM_STATUS (*BTM_BleGetEnergyInfo)(tBTM_BLE_ENERGY_INFO_CBACK* callback);
    tBTM_STATUS (*BTM_BleObserve)(bool start, uint8_t duration,
                                  tBTM_INQ_RESULTS_CB* p_results_cb,
                                  tBTM_CMPL_CB* p_cmpl_cb,
                                  bool low_latency_scan);
    tBTM_STATUS (*BTM_SetBleDataLength)(const RawAddress& bd_addr,
    [[nodiscard]] tBTM_STATUS (*BTM_BleGetEnergyInfo)(
        tBTM_BLE_ENERGY_INFO_CBACK* callback);
    [[nodiscard]] tBTM_STATUS (*BTM_BleObserve)(
        bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_results_cb,
        tBTM_CMPL_CB* p_cmpl_cb, bool low_latency_scan);
    [[nodiscard]] tBTM_STATUS (*BTM_SetBleDataLength)(const RawAddress& bd_addr,
                                                      uint16_t tx_pdu_length);
    void (*BTM_BleReadControllerFeatures)(
        tBTM_BLE_CTRL_FEATURES_CBACK* p_vsc_cback);
@@ -108,51 +114,53 @@ struct btm_client_interface_t {
                                     uint16_t max_conn_int,
                                     uint16_t peripheral_latency,
                                     uint16_t supervision_tout);
    bool (*BTM_UseLeLink)(const RawAddress& bd_addr);
    [[nodiscard]] bool (*BTM_UseLeLink)(const RawAddress& bd_addr);
  } ble;

  struct {
    tBTM_STATUS (*BTM_CreateSco)(const RawAddress* bd_addr, bool is_orig,
                                 uint16_t pkt_types, uint16_t* p_sco_inx,
    [[nodiscard]] tBTM_STATUS (*BTM_CreateSco)(const RawAddress* bd_addr,
                                               bool is_orig, uint16_t pkt_types,
                                               uint16_t* p_sco_inx,
                                               tBTM_SCO_CB* p_conn_cb,
                                               tBTM_SCO_CB* p_disc_cb);
    tBTM_STATUS (*BTM_RegForEScoEvts)(uint16_t sco_inx,
                                      tBTM_ESCO_CBACK* p_esco_cback);
    tBTM_STATUS (*BTM_RemoveSco)(uint16_t sco_inx);
    [[nodiscard]] tBTM_STATUS (*BTM_RegForEScoEvts)(
        uint16_t sco_inx, tBTM_ESCO_CBACK* p_esco_cback);
    [[nodiscard]] tBTM_STATUS (*BTM_RemoveSco)(uint16_t sco_inx);
    void (*BTM_WriteVoiceSettings)(uint16_t settings);
    void (*BTM_EScoConnRsp)(uint16_t sco_inx, uint8_t hci_status,
                            enh_esco_params_t* p_parms);
    uint8_t (*BTM_GetNumScoLinks)();
    tBTM_STATUS (*BTM_SetEScoMode)(enh_esco_params_t* p_parms);
    [[nodiscard]] uint8_t (*BTM_GetNumScoLinks)();
    [[nodiscard]] tBTM_STATUS (*BTM_SetEScoMode)(enh_esco_params_t* p_parms);
  } sco;

  struct {
    tBTM_STATUS (*BTM_ReadLocalDeviceName)(const char** p_name);
    tBTM_STATUS (*BTM_ReadLocalDeviceNameFromController)(
    [[nodiscard]] tBTM_STATUS (*BTM_ReadLocalDeviceName)(const char** p_name);
    [[nodiscard]] tBTM_STATUS (*BTM_ReadLocalDeviceNameFromController)(
        tBTM_CMPL_CB* p_rln_cmpl_cback);
    tBTM_STATUS (*BTM_SetLocalDeviceName)(const char* p_name);
    tBTM_STATUS (*BTM_SetDeviceClass)(DEV_CLASS dev_class);
    bool (*BTM_IsDeviceUp)();
    DEV_CLASS (*BTM_ReadDeviceClass)();
    [[nodiscard]] tBTM_STATUS (*BTM_SetLocalDeviceName)(const char* p_name);
    [[nodiscard]] tBTM_STATUS (*BTM_SetDeviceClass)(DEV_CLASS dev_class);
    [[nodiscard]] bool (*BTM_IsDeviceUp)();
    [[nodiscard]] DEV_CLASS (*BTM_ReadDeviceClass)();
  } local;

  struct {
    tBTM_STATUS (*BTM_WriteEIR)(BT_HDR* p_buff);
    uint8_t (*BTM_GetEirSupportedServices)(uint32_t* p_eir_uuid, uint8_t** p,
    [[nodiscard]] tBTM_STATUS (*BTM_WriteEIR)(BT_HDR* p_buff);
    [[nodiscard]] uint8_t (*BTM_GetEirSupportedServices)(uint32_t* p_eir_uuid,
                                                         uint8_t** p,
                                                         uint8_t max_num_uuid16,
                                                         uint8_t* p_num_uuid16);
    uint8_t (*BTM_GetEirUuidList)(const uint8_t* p_eir, size_t eir_len,
                                  uint8_t uuid_size, uint8_t* p_num_uuid,
                                  uint8_t* p_uuid_list, uint8_t max_num_uuid);
    [[nodiscard]] uint8_t (*BTM_GetEirUuidList)(
        const uint8_t* p_eir, size_t eir_len, uint8_t uuid_size,
        uint8_t* p_num_uuid, uint8_t* p_uuid_list, uint8_t max_num_uuid);
    void (*BTM_AddEirService)(uint32_t* p_eir_uuid, uint16_t uuid16);
    void (*BTM_RemoveEirService)(uint32_t* p_eir_uuid, uint16_t uuid16);
  } eir;

  struct {
    tBTM_INQ_INFO* (*BTM_InqDbRead)(const RawAddress& p_bda);
    tBTM_INQ_INFO* (*BTM_InqDbFirst)();
    tBTM_INQ_INFO* (*BTM_InqDbNext)(tBTM_INQ_INFO* p_cur);
    tBTM_STATUS (*BTM_ClearInqDb)(const RawAddress* p_bda);
    [[nodiscard]] tBTM_INQ_INFO* (*BTM_InqDbRead)(const RawAddress& p_bda);
    [[nodiscard]] tBTM_INQ_INFO* (*BTM_InqDbFirst)();
    [[nodiscard]] tBTM_INQ_INFO* (*BTM_InqDbNext)(tBTM_INQ_INFO* p_cur);
    [[nodiscard]] tBTM_STATUS (*BTM_ClearInqDb)(const RawAddress* p_bda);
  } db;
};