1 /*
2  * Copyright 2019 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 #pragma once
18 
19 #include <vector>
20 
21 #include "base/functional/callback.h"
22 #include "device/include/esco_parameters.h"
23 #include "hci/le_rand_callback.h"
24 #include "stack/btm/neighbor_inquiry.h"
25 #include "stack/include/btm_api_types.h"
26 #include "stack/include/btm_ble_api_types.h"
27 #include "types/hci_role.h"
28 #include "types/raw_address.h"
29 
30 namespace bluetooth {
31 namespace shim {
32 
33 /*******************************************************************************
34  *
35  * Function         BTM_ClearEventFilter
36  *
37  * Description      Clears the event filter in the controller
38  *
39  * Returns          Return btm status
40  *
41  ******************************************************************************/
42 tBTM_STATUS BTM_ClearEventFilter(void);
43 
44 /*******************************************************************************
45  *
46  * Function         BTM_ClearEventMask
47  *
48  * Description      Clears the event mask in the controller
49  *
50  * Returns          Return btm status
51  *
52  ******************************************************************************/
53 tBTM_STATUS BTM_ClearEventMask(void);
54 
55 /*******************************************************************************
56  *
57  * Function         BTM_ClearFilterAcceptList
58  *
59  * Description      Clears the connect list in the controller
60  *
61  * Returns          Return btm status
62  *
63  ******************************************************************************/
64 tBTM_STATUS BTM_ClearFilterAcceptList(void);
65 
66 /*******************************************************************************
67  *
68  * Function         BTM_DisconnectAllAcls
69  *
70  * Description      Disconnects all of the ACL connections
71  *
72  * Returns          Return btm status
73  *
74  ******************************************************************************/
75 tBTM_STATUS BTM_DisconnectAllAcls(void);
76 
77 /*******************************************************************************
78  *
79  * Function        BTM_SetEventFilterConnectionSetupAllDevices
80  *
81  * Description    Tell the controller to allow all devices
82  *
83  * Parameters
84  *
85  *******************************************************************************/
86 tBTM_STATUS BTM_SetEventFilterConnectionSetupAllDevices(void);
87 
88 /*******************************************************************************
89  *
90  * Function        BTM_AllowWakeByHid
91  *
92  * Description     Allow the device to be woken by HID devices
93  *
94  * Parameters      std::vector of RawAddress
95  *
96  *******************************************************************************/
97 tBTM_STATUS BTM_AllowWakeByHid(
98     std::vector<RawAddress> classic_hid_devices,
99     std::vector<std::pair<RawAddress, uint8_t>> le_hid_devices);
100 
101 /*******************************************************************************
102  *
103  * Function        BTM_RestoreFilterAcceptList
104  *
105  * Description    Floss: Restore the state of the for the filter accept list
106  *
107  * Parameters
108  *
109  *******************************************************************************/
110 tBTM_STATUS BTM_RestoreFilterAcceptList(
111     std::vector<std::pair<RawAddress, uint8_t>> le_devices);
112 
113 /*******************************************************************************
114  *
115  * Function        BTM_SetDefaultEventMaskExcept
116  *
117  * Description    Floss: Set the default event mask for Classic and LE except
118  *                the given values (they will be disabled in the final set
119  *                mask).
120  *
121  * Parameters     Bits set for event mask and le event mask that should be
122  *                disabled in the final value.
123  *
124  *******************************************************************************/
125 tBTM_STATUS BTM_SetDefaultEventMaskExcept(uint64_t mask, uint64_t le_mask);
126 
127 /*******************************************************************************
128  *
129  * Function        BTM_SetEventFilterInquiryResultAllDevices
130  *
131  * Description    Floss: Set the event filter to inquiry result device all
132  *
133  * Parameters
134  *
135  *******************************************************************************/
136 tBTM_STATUS BTM_SetEventFilterInquiryResultAllDevices(void);
137 
138 /*******************************************************************************
139  *
140  * Function         BTM_BleResetId
141  *
142  * Description      Resets the local BLE keys
143  *
144  *******************************************************************************/
145 tBTM_STATUS BTM_BleResetId(void);
146 
147 /*******************************************************************************
148  *
149  * Function         BTM_BleGetNumberOfAdvertisingInstancesInUse
150  *
151  * Description      Obtains the number of BLE advertising instances in use
152  *
153  * Returns          Return the number of BLE advertising instances in use
154  *******************************************************************************/
155 size_t BTM_BleGetNumberOfAdvertisingInstancesInUse(void);
156 
157 }  // namespace shim
158 }  // namespace bluetooth
159