Loading system/stack/acl/btm_acl.cc +45 −0 Original line number Diff line number Diff line Loading @@ -2826,3 +2826,48 @@ bool acl_set_peer_le_features_from_handle(uint16_t hci_handle, STREAM_TO_ARRAY(p_acl->peer_le_features, p, BD_FEATURES_LEN); return true; } void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status, uint8_t enc_mode) { btm_sec_connected(bda, handle, status, enc_mode); btm_acl_set_paging(false); l2c_link_hci_conn_comp(status, handle, bda); } constexpr uint16_t kDefaultPacketTypes = HCI_PKT_TYPES_MASK_DM1 | HCI_PKT_TYPES_MASK_DH1 | HCI_PKT_TYPES_MASK_DM3 | HCI_PKT_TYPES_MASK_DH3 | HCI_PKT_TYPES_MASK_DM5 | HCI_PKT_TYPES_MASK_DH5; void acl_create_classic_connection(const RawAddress& bd_addr, bool there_are_high_priority_channels, bool is_bonding) { const bool controller_supports_role_switch = controller_get_interface()->supports_role_switch(); const bool acl_allows_role_switch = acl_is_role_switch_allowed(); /* FW team says that we can participant in 4 piconets * typically 3 piconet + 1 for scanning. * We can enhance the code to count the number of piconets later. */ uint8_t allow_role_switch = HCI_CR_CONN_NOT_ALLOW_SWITCH; if (((acl_allows_role_switch && (BTM_GetNumAclLinks() < 3)) || (is_bonding && !there_are_high_priority_channels && controller_supports_role_switch))) allow_role_switch = HCI_CR_CONN_ALLOW_SWITCH; /* Check with the BT manager if details about remote device are known */ uint8_t page_scan_rep_mode{HCI_PAGE_SCAN_REP_MODE_R1}; uint8_t page_scan_mode{HCI_MANDATARY_PAGE_SCAN_MODE}; uint16_t clock_offset = BTM_GetClockOffset(bd_addr); tBTM_INQ_INFO* p_inq_info = BTM_InqDbRead(bd_addr); if (p_inq_info != nullptr && (p_inq_info->results.inq_result_type & BTM_INQ_RESULT_BR)) { page_scan_rep_mode = p_inq_info->results.page_scan_rep_mode; page_scan_mode = p_inq_info->results.page_scan_mode; clock_offset = p_inq_info->results.clock_offset; } btsnd_hcic_create_conn(bd_addr, kDefaultPacketTypes, page_scan_rep_mode, page_scan_mode, clock_offset, allow_role_switch); btm_acl_set_paging(true); } system/stack/include/acl_api.h +4 −0 Original line number Diff line number Diff line Loading @@ -342,3 +342,7 @@ void btm_acl_update_conn_addr(uint16_t conn_handle, const RawAddress& address); * ******************************************************************************/ bool BTM_ReadPowerMode(const RawAddress& remote_bda, tBTM_PM_MODE* p_mode); void acl_create_classic_connection(const RawAddress& bd_addr, bool there_are_high_priority_channels, bool is_bonding); system/stack/include/acl_hci_link_interface.h +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ // This header contains functions for HCIF-Acl Management to invoke // void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status, uint8_t enc_mode); void btm_acl_encrypt_change(uint16_t handle, uint8_t status, uint8_t encr_enable); void btm_blacklist_role_change_device(const RawAddress& bd_addr, Loading system/stack/include/l2cap_hci_link_interface.h +0 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,6 @@ extern void l2c_link_process_num_completed_pkts(uint8_t* p, uint8_t evt_len); extern void l2c_link_hci_conn_comp(uint8_t status, uint16_t handle, const RawAddress& p_bda); // TODO move extern void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status, uint8_t enc_mode); extern bool l2c_link_hci_disc_comp(uint16_t handle, uint8_t reason); extern void l2c_link_role_changed(const RawAddress* bd_addr, uint8_t new_role, Loading system/stack/l2cap/l2c_link.cc +0 −7 Original line number Diff line number Diff line Loading @@ -123,13 +123,6 @@ void l2c_link_hci_conn_req(const RawAddress& bd_addr) { } } void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status, uint8_t enc_mode) { btm_sec_connected(bda, handle, status, enc_mode); btm_acl_set_paging(false); l2c_link_hci_conn_comp(status, handle, bda); } void l2c_link_hci_conn_comp(uint8_t status, uint16_t handle, const RawAddress& p_bda) { tL2C_CONN_INFO ci; Loading Loading
system/stack/acl/btm_acl.cc +45 −0 Original line number Diff line number Diff line Loading @@ -2826,3 +2826,48 @@ bool acl_set_peer_le_features_from_handle(uint16_t hci_handle, STREAM_TO_ARRAY(p_acl->peer_le_features, p, BD_FEATURES_LEN); return true; } void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status, uint8_t enc_mode) { btm_sec_connected(bda, handle, status, enc_mode); btm_acl_set_paging(false); l2c_link_hci_conn_comp(status, handle, bda); } constexpr uint16_t kDefaultPacketTypes = HCI_PKT_TYPES_MASK_DM1 | HCI_PKT_TYPES_MASK_DH1 | HCI_PKT_TYPES_MASK_DM3 | HCI_PKT_TYPES_MASK_DH3 | HCI_PKT_TYPES_MASK_DM5 | HCI_PKT_TYPES_MASK_DH5; void acl_create_classic_connection(const RawAddress& bd_addr, bool there_are_high_priority_channels, bool is_bonding) { const bool controller_supports_role_switch = controller_get_interface()->supports_role_switch(); const bool acl_allows_role_switch = acl_is_role_switch_allowed(); /* FW team says that we can participant in 4 piconets * typically 3 piconet + 1 for scanning. * We can enhance the code to count the number of piconets later. */ uint8_t allow_role_switch = HCI_CR_CONN_NOT_ALLOW_SWITCH; if (((acl_allows_role_switch && (BTM_GetNumAclLinks() < 3)) || (is_bonding && !there_are_high_priority_channels && controller_supports_role_switch))) allow_role_switch = HCI_CR_CONN_ALLOW_SWITCH; /* Check with the BT manager if details about remote device are known */ uint8_t page_scan_rep_mode{HCI_PAGE_SCAN_REP_MODE_R1}; uint8_t page_scan_mode{HCI_MANDATARY_PAGE_SCAN_MODE}; uint16_t clock_offset = BTM_GetClockOffset(bd_addr); tBTM_INQ_INFO* p_inq_info = BTM_InqDbRead(bd_addr); if (p_inq_info != nullptr && (p_inq_info->results.inq_result_type & BTM_INQ_RESULT_BR)) { page_scan_rep_mode = p_inq_info->results.page_scan_rep_mode; page_scan_mode = p_inq_info->results.page_scan_mode; clock_offset = p_inq_info->results.clock_offset; } btsnd_hcic_create_conn(bd_addr, kDefaultPacketTypes, page_scan_rep_mode, page_scan_mode, clock_offset, allow_role_switch); btm_acl_set_paging(true); }
system/stack/include/acl_api.h +4 −0 Original line number Diff line number Diff line Loading @@ -342,3 +342,7 @@ void btm_acl_update_conn_addr(uint16_t conn_handle, const RawAddress& address); * ******************************************************************************/ bool BTM_ReadPowerMode(const RawAddress& remote_bda, tBTM_PM_MODE* p_mode); void acl_create_classic_connection(const RawAddress& bd_addr, bool there_are_high_priority_channels, bool is_bonding);
system/stack/include/acl_hci_link_interface.h +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ // This header contains functions for HCIF-Acl Management to invoke // void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status, uint8_t enc_mode); void btm_acl_encrypt_change(uint16_t handle, uint8_t status, uint8_t encr_enable); void btm_blacklist_role_change_device(const RawAddress& bd_addr, Loading
system/stack/include/l2cap_hci_link_interface.h +0 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,6 @@ extern void l2c_link_process_num_completed_pkts(uint8_t* p, uint8_t evt_len); extern void l2c_link_hci_conn_comp(uint8_t status, uint16_t handle, const RawAddress& p_bda); // TODO move extern void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status, uint8_t enc_mode); extern bool l2c_link_hci_disc_comp(uint16_t handle, uint8_t reason); extern void l2c_link_role_changed(const RawAddress* bd_addr, uint8_t new_role, Loading
system/stack/l2cap/l2c_link.cc +0 −7 Original line number Diff line number Diff line Loading @@ -123,13 +123,6 @@ void l2c_link_hci_conn_req(const RawAddress& bd_addr) { } } void btm_acl_connected(const RawAddress& bda, uint16_t handle, uint8_t status, uint8_t enc_mode) { btm_sec_connected(bda, handle, status, enc_mode); btm_acl_set_paging(false); l2c_link_hci_conn_comp(status, handle, bda); } void l2c_link_hci_conn_comp(uint8_t status, uint16_t handle, const RawAddress& p_bda) { tL2C_CONN_INFO ci; Loading