friend void BTM_acl_after_controller_started();
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);
friend void acl_set_disconnect_reason(uint8_t acl_disc_reason);
friend void btm_acl_created(const RawAddress& bda, uint16_t hci_handle,
uint8_t link_role, tBT_TRANSPORT transport);
#include "types/raw_address.h"
struct StackAclBtmAcl {
+ tACL_CONN* acl_allocate_connection();
tACL_CONN* acl_get_connection_from_handle(uint16_t handle);
tACL_CONN* btm_bda_to_acl(const RawAddress& bda, tBT_TRANSPORT transport);
tBTM_STATUS btm_set_packet_types(tACL_CONN* p, uint16_t pkt_types);
* Returns void
*
******************************************************************************/
+void acl_initialize_power_mode(const tACL_CONN& p_acl) {
+ tBTM_PM_MCB* p_db =
+ &btm_cb.acl_cb_.pm_mode_db[btm_handle_to_acl_index(p_acl.hci_handle)];
+ memset(p_db, 0, sizeof(tBTM_PM_MCB));
+ p_db->state = BTM_PM_ST_ACTIVE;
+}
+
+tACL_CONN* StackAclBtmAcl::acl_allocate_connection() {
+ tACL_CONN* p_acl = &btm_cb.acl_cb_.acl_db[0];
+ for (uint8_t xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl++) {
+ if (!p_acl->in_use) {
+ return p_acl;
+ }
+ }
+ return nullptr;
+}
+
void btm_acl_created(const RawAddress& bda, uint16_t hci_handle,
uint8_t link_role, tBT_TRANSPORT transport) {
tBTM_SEC_DEV_REC* p_dev_rec = NULL;