1 /******************************************************************************
2  *
3  *  Copyright 1999-2012 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 /******************************************************************************
20  *
21  *  this file contains the main Bluetooth Manager (BTM) internal
22  *  definitions.
23  *
24  ******************************************************************************/
25 
26 #ifndef BTM_BLE_INT_H
27 #define BTM_BLE_INT_H
28 
29 #include "stack/btm/btm_ble_int_types.h"
30 #include "stack/btm/security_device_record.h"
31 #include "stack/include/hci_error_code.h"
32 #include "types/ble_address_with_type.h"
33 #include "types/raw_address.h"
34 
35 void btm_send_hci_set_scan_params(uint8_t scan_type, uint16_t scan_int,
36                                   uint16_t scan_win, uint8_t scan_phy,
37                                   tBLE_ADDR_TYPE addr_type_own,
38                                   uint8_t scan_filter_policy);
39 
40 void btm_ble_init(void);
41 void btm_ble_free();
42 void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode,
43                        uint8_t role, tBLE_ADDR_TYPE addr_type,
44                        bool addr_matched,
45                        bool can_read_discoverable_characteristics);
46 
47 /* acceptlist function */
48 void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy);
49 
50 /* background connection function */
51 void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bda,
52                                    tHCI_STATUS status);
53 /* BLE address management */
54 tBTM_SEC_DEV_REC* btm_ble_resolve_random_addr(const RawAddress& random_bda);
55 
56 void btm_ble_batchscan_init(void);
57 void btm_ble_adv_filter_init(void);
58 bool btm_ble_topology_check(tBTM_BLE_STATE_MASK request);
59 bool btm_ble_clear_topology_mask(tBTM_BLE_STATE_MASK request_state);
60 bool btm_ble_set_topology_mask(tBTM_BLE_STATE_MASK request_state);
61 
62 void btm_ble_scanner_init(void);
63 void btm_ble_scanner_cleanup(void);
64 
65 #endif
66