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

Commit 96e9e04a authored by Chris Manton's avatar Chris Manton
Browse files

Add and Use stack//btm_acl::internal::set_default_packet_types_supported

Towards encapsulated code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: Iab53674505ab691565b7b83a282aa28c76454614
parent d4e784d5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -388,7 +388,6 @@ struct sACL_CB {
  friend uint16_t acl_get_supported_packet_types();
  friend uint8_t btm_handle_to_acl_index(uint16_t hci_handle);
  friend void BTM_SetDefaultLinkSuperTout(uint16_t timeout);
  friend void BTM_acl_after_controller_started(const controller_t* controller);
  friend void BTM_default_block_role_switch();
  friend void BTM_default_unblock_role_switch();
  friend void acl_initialize_power_mode(const tACL_CONN& p_acl);
+6 −3
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ void gatt_find_in_device_record(const RawAddress& bd_addr,
void l2c_link_hci_conn_comp(uint8_t status, uint16_t handle,
                            const RawAddress& p_bda);

extern tBTM_CB btm_cb;

struct StackAclBtmAcl {
  tACL_CONN* acl_allocate_connection();
  tACL_CONN* acl_get_connection_from_handle(uint16_t handle);
@@ -80,6 +82,9 @@ struct StackAclBtmAcl {
  void btm_acl_role_changed(tHCI_STATUS hci_status, const RawAddress& bd_addr,
                            uint8_t new_role);
  void hci_start_role_switch_to_central(tACL_CONN& p_acl);
  void set_default_packet_types_supported(uint16_t packet_types_supported) {
    btm_cb.acl_cb_.btm_acl_pkt_types_supported = packet_types_supported;
  }
};

namespace {
@@ -117,8 +122,6 @@ inline bool IsEprAvailable(const tACL_CONN& p_acl) {
         controller_get_interface()->supports_encryption_pause();
}

extern tBTM_CB btm_cb;

static bool acl_is_role_central(const RawAddress& bda, tBT_TRANSPORT transport);
static void btm_acl_chk_peer_pkt_type_support(tACL_CONN* p,
                                              uint16_t* p_pkt_type);
@@ -258,7 +261,7 @@ void BTM_acl_after_controller_started(const controller_t* controller) {
      btm_acl_pkt_types_supported |=
          (HCI_PKT_TYPES_MASK_NO_2_DH5 + HCI_PKT_TYPES_MASK_NO_3_DH5);
  }
  btm_cb.acl_cb_.btm_acl_pkt_types_supported = btm_acl_pkt_types_supported;
  internal_.set_default_packet_types_supported(btm_acl_pkt_types_supported);
}

/*******************************************************************************