• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright 2020 The Android Open Source Project
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at:
7  *
8  *  http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *
16  */
17 
18 #pragma once
19 
20 #include <cstdint>
21 
22 #include "stack/include/bt_hdr.h"
23 #include "stack/include/bt_types.h"
24 #include "stack/include/hci_error_code.h"
25 #include "stack/include/hci_mode.h"
26 #include "stack/include/hcidefs.h"
27 #include "types/class_of_device.h"
28 #include "types/hci_role.h"
29 #include "types/raw_address.h"
30 
31 // This header contains functions for HCIF-Acl Management to invoke
32 //
33 void btm_connection_request(const RawAddress& bda,
34                             const bluetooth::types::ClassOfDevice& cod);
35 void btm_acl_connection_request(const RawAddress& bda, uint8_t* dc);
36 void btm_acl_connected(const RawAddress& bda, uint16_t handle,
37                        tHCI_STATUS status, uint8_t enc_mode);
38 void on_acl_br_edr_connected(const RawAddress& bda, uint16_t handle,
39                              uint8_t enc_mode, bool locally_initiated);
40 void on_acl_br_edr_failed(const RawAddress& bda, tHCI_STATUS status,
41                           bool locally_initiated);
42 void btm_acl_disconnected(tHCI_STATUS status, uint16_t handle,
43                           tHCI_STATUS reason);
44 void btm_acl_iso_disconnected(uint16_t handle, tHCI_STATUS reason);
45 void btm_acl_encrypt_change(uint16_t handle, uint8_t status,
46                             uint8_t encr_enable);
47 void btm_acl_paging(BT_HDR* p, const RawAddress& dest);
48 void btm_acl_resubmit_page(void);
49 void btm_acl_role_changed(tHCI_STATUS hci_status, const RawAddress& bd_addr,
50                           tHCI_ROLE new_role);
51 void btm_rejectlist_role_change_device(const RawAddress& bd_addr,
52                                        uint8_t hci_status);
53 void btm_pm_proc_cmd_status(tHCI_STATUS status);
54 void btm_pm_proc_mode_change(tHCI_STATUS hci_status, uint16_t hci_handle,
55                              tHCI_MODE mode, uint16_t interval);
56 void btm_pm_proc_ssr_evt(uint8_t* p, uint16_t evt_len);
57 void btm_read_automatic_flush_timeout_complete(uint8_t* p);
58 void btm_read_failed_contact_counter_complete(uint8_t* p);
59 void btm_read_link_quality_complete(uint8_t* p, uint16_t evt_len);
60 void btm_read_remote_ext_features_complete_raw(uint8_t* p, uint8_t evt_len);
61 void btm_read_remote_ext_features_complete(uint16_t handle, uint8_t page_num,
62                                            uint8_t max_page, uint8_t* features);
63 void btm_read_remote_ext_features_failed(uint8_t status, uint16_t handle);
64 void btm_read_remote_features_complete(uint16_t handle, uint8_t* features);
65 void btm_read_remote_version_complete(tHCI_STATUS status, uint16_t handle,
66                                       uint8_t lmp_version,
67                                       uint16_t manufacturer,
68                                       uint16_t lmp_subversion);
69 void btm_read_rssi_complete(uint8_t* p, uint16_t evt_len);
70 void btm_read_tx_power_complete(uint8_t* p, uint16_t evt_len, bool is_ble);
71 
72 void acl_rcv_acl_data(BT_HDR* p_msg);
73 void acl_link_segments_xmitted(BT_HDR* p_msg);
74 void acl_packets_completed(uint16_t handle, uint16_t num_packets);
75 void acl_process_supported_features(uint16_t handle, uint64_t features);
76 void acl_process_extended_features(uint16_t handle, uint8_t current_page_number,
77                                    uint8_t max_page_number, uint64_t features);
78 void btm_pm_on_mode_change(tHCI_STATUS status, uint16_t handle,
79                            tHCI_MODE current_mode, uint16_t interval);
80 void btm_pm_on_sniff_subrating(tHCI_STATUS status, uint16_t handle,
81                                uint16_t maximum_transmit_latency,
82                                uint16_t maximum_receive_latency,
83                                uint16_t minimum_remote_timeout,
84                                uint16_t minimum_local_timeout);
85 
86 void acl_cache_role(const RawAddress& bd_addr, tHCI_ROLE new_role,
87                     bool overwrite_cache);
88