"btm/btm_ble_adv_filter.cc",
"btm/btm_ble_batchscan.cc",
"btm/btm_ble_bgconn.cc",
+ "btm/btm_ble_cont_energy.cc",
"btm/btm_ble_gap.cc",
"btm/btm_ble_multi_adv.cc",
"btm/btm_ble_privacy.cc",
+ "btm/btm_client_interface.cc",
"btm/btm_dev.cc",
"btm/btm_devctl.cc",
"btm/btm_inq.cc",
"btm/btm_iso.cc",
"btm/btm_main.cc",
"btm/btm_sco.cc",
+ "btm/btm_scn.cc",
"btm/btm_sec.cc",
"test/btm/stack_btm_test.cc",
"test/common/mock_bta_dm_act.cc",
switch_role_state_ = BTM_ACL_SWKEY_STATE_IDLE;
sca = 0;
}
+
+void sACL_CB::Init() {
+ btm_def_link_super_tout = HCI_DEFAULT_INACT_TOUT;
+ acl_disc_reason = HCI_ERR_UNDEFINED;
+
+ btm_acl_pkt_types_supported =
+ HCI_PKT_TYPES_MASK_DH1 + HCI_PKT_TYPES_MASK_DM1 + HCI_PKT_TYPES_MASK_DH3 +
+ HCI_PKT_TYPES_MASK_DM3 + HCI_PKT_TYPES_MASK_DH5 + HCI_PKT_TYPES_MASK_DM5;
+}
/****************************************************
** ACL Management API
****************************************************/
-typedef struct {
+struct sACL_CB {
private:
friend bool BTM_IsBleConnection(uint16_t hci_handle);
friend bool acl_is_role_switch_allowed();
}
return cnt;
}
-} tACL_CB;
+
+ void Init();
+};
+typedef sACL_CB tACL_CB;
* Returns void
*
******************************************************************************/
-void btm_acl_init(void) {
- /* Initialize nonzero defaults */
- btm_cb.acl_cb_.btm_def_link_super_tout = HCI_DEFAULT_INACT_TOUT;
- btm_cb.acl_cb_.acl_disc_reason = HCI_ERR_UNDEFINED;
-
- btm_cb.acl_cb_.btm_acl_pkt_types_supported =
- HCI_PKT_TYPES_MASK_DH1 + HCI_PKT_TYPES_MASK_DM1 + HCI_PKT_TYPES_MASK_DH3 +
- HCI_PKT_TYPES_MASK_DM3 + HCI_PKT_TYPES_MASK_DH5 + HCI_PKT_TYPES_MASK_DM5;
-}
+void btm_acl_init(void) { btm_cb.acl_cb_.Init(); }
void BTM_acl_after_controller_started() {
internal_.btm_set_default_link_policy(
#include "bt_target.h"
#include "bt_types.h"
-#include "bt_utils.h"
#include "btm_ble_api.h"
#include "btm_int.h"
#include "btu.h"
#include "hcidefs.h"
#include "hcimsgs.h"
#include "stack/btm/btm_int_types.h"
+#include "utils/include/bt_utils.h"
extern tBTM_CB btm_cb;
#include "osi/include/osi.h"
#include "stack/btm/btm_int_types.h"
#include "stack/include/acl_hci_link_interface.h"
+#include "stack/include/btm_client_interface.h"
#include "types/raw_address.h"
base::MessageLoop* get_main_message_loop() { return nullptr; }
};
TEST_F(StackBtmTest, GlobalLifecycle) {
- btm_init();
- btm_free();
+ get_btm_client_interface().lifecycle.btm_init();
+ get_btm_client_interface().lifecycle.btm_free();
}
TEST_F(StackBtmTest, DynamicLifecycle) {
TEST_F(StackBtmTest, InformBtmOnConnection) {
MOCK_bluetooth_shim_is_gd_acl_enabled_ = true;
- btm_init();
+ get_btm_client_interface().lifecycle.btm_init();
RawAddress bda({0x11, 0x22, 0x33, 0x44, 0x55, 0x66});
ASSERT_EQ(static_cast<size_t>(1),
mock_function_count_map.count("BTA_dm_acl_up"));
- btm_free();
+ get_btm_client_interface().lifecycle.btm_free();
}
} // namespace