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 #ifndef BTM_BLE_API_TYPES_H
20 #define BTM_BLE_API_TYPES_H
21 
22 #include <base/callback_forward.h>
23 #include <hardware/bt_common_types.h>
24 #include <vector>
25 
26 #define CHNL_MAP_LEN 5
27 typedef uint8_t tBTM_BLE_CHNL_MAP[CHNL_MAP_LEN];
28 
29 /* 0x00-0x04 only used for set advertising parameter command */
30 #define BTM_BLE_CONNECT_EVT 0x00
31 /* Connectable directed advertising */
32 #define BTM_BLE_CONNECT_DIR_EVT 0x01
33 /* Scannable undirected advertising */
34 #define BTM_BLE_DISCOVER_EVT 0x02
35 /* Non connectable undirected advertising */
36 #define BTM_BLE_NON_CONNECT_EVT 0x03
37 /* Connectable low duty cycle directed advertising  */
38 #define BTM_BLE_CONNECT_LO_DUTY_DIR_EVT 0x04
39 /* 0x00 - 0x04 can be received on adv event type */
40 #define BTM_BLE_ADV_IND_EVT  0x00
41 #define BTM_BLE_ADV_DIRECT_IND_EVT  0x01
42 #define BTM_BLE_ADV_SCAN_IND_EVT  0x02
43 #define BTM_BLE_ADV_NONCONN_IND_EVT  0x03
44 #define BTM_BLE_SCAN_RSP_EVT 0x04
45 
46 #define BTM_BLE_UNKNOWN_EVT 0xff
47 
48 typedef uint8_t tBTM_BLE_EVT;
49 typedef uint8_t tBTM_BLE_CONN_MODE;
50 
51 typedef uint32_t tBTM_BLE_REF_VALUE;
52 
53 #define BTM_BLE_SCAN_MODE_PASS 0
54 #define BTM_BLE_SCAN_MODE_ACTI 1
55 #define BTM_BLE_SCAN_MODE_NONE 0xff
56 typedef uint8_t tBLE_SCAN_MODE;
57 
58 #define BTM_BLE_BATCH_SCAN_MODE_DISABLE 0
59 #define BTM_BLE_BATCH_SCAN_MODE_PASS 1
60 #define BTM_BLE_BATCH_SCAN_MODE_ACTI 2
61 #define BTM_BLE_BATCH_SCAN_MODE_PASS_ACTI 3
62 
63 typedef uint8_t tBTM_BLE_BATCH_SCAN_MODE;
64 
65 /* advertising channel map */
66 #define BTM_BLE_ADV_CHNL_37 (0x01 << 0)
67 #define BTM_BLE_ADV_CHNL_38 (0x01 << 1)
68 #define BTM_BLE_ADV_CHNL_39 (0x01 << 2)
69 typedef uint8_t tBTM_BLE_ADV_CHNL_MAP;
70 
71 /*d efault advertising channel map */
72 #ifndef BTM_BLE_DEFAULT_ADV_CHNL_MAP
73 #define BTM_BLE_DEFAULT_ADV_CHNL_MAP \
74   (BTM_BLE_ADV_CHNL_37 | BTM_BLE_ADV_CHNL_38 | BTM_BLE_ADV_CHNL_39)
75 #endif
76 
77 /* advertising filter policy */
78 #define AP_SCAN_CONN_ALL 0x00 /* default */
79 #define AP_SCAN_WL_CONN_ALL 0x01
80 #define AP_SCAN_ALL_CONN_WL 0x02
81 #define AP_SCAN_CONN_WL 0x03
82 #define AP_SCAN_CONN_POLICY_MAX 0x04
83 typedef uint8_t tBTM_BLE_AFP;
84 
85 /* default advertising filter policy */
86 #ifndef BTM_BLE_DEFAULT_AFP
87 #define BTM_BLE_DEFAULT_AFP AP_SCAN_CONN_ALL
88 #endif
89 
90 /* scanning filter policy */
91 /* 0: accept adv packet from all, directed adv pkt not directed */
92 /*    to local device is ignored */
93 #define SP_ADV_ALL 0x00
94 
95 typedef uint8_t tBTM_BLE_SFP;
96 
97 #ifndef BTM_BLE_DEFAULT_SFP
98 #define BTM_BLE_DEFAULT_SFP SP_ADV_ALL
99 #endif
100 
101 /* Full scan boundary values */
102 #define BTM_BLE_ADV_SCAN_FULL_MIN 0x00
103 #define BTM_BLE_ADV_SCAN_FULL_MAX 0x64
104 
105 /* Partial scan boundary values */
106 #define BTM_BLE_ADV_SCAN_TRUNC_MAX BTM_BLE_ADV_SCAN_FULL_MAX
107 
108 /* Threshold values */
109 #define BTM_BLE_ADV_SCAN_THR_MAX BTM_BLE_ADV_SCAN_FULL_MAX
110 
111 /* connection parameter boundary values */
112 #define BTM_BLE_SCAN_INT_MIN 0x0004
113 #define BTM_BLE_SCAN_INT_MAX 0x4000
114 #define BTM_BLE_SCAN_WIN_MIN 0x0004
115 #define BTM_BLE_SCAN_WIN_MAX 0x4000
116 #define BTM_BLE_EXT_SCAN_INT_MAX 0x00FFFFFF
117 #define BTM_BLE_EXT_SCAN_WIN_MAX 0xFFFF
118 #define BTM_BLE_CONN_INT_MIN 0x0006
119 #define BTM_BLE_CONN_INT_MAX 0x0C80
120 #define BTM_BLE_CONN_LATENCY_MAX 500
121 #define BTM_BLE_CONN_SUP_TOUT_MIN 0x000A
122 #define BTM_BLE_CONN_SUP_TOUT_MAX 0x0C80
123 /* use this value when a specific value not to be overwritten */
124 #define BTM_BLE_CONN_PARAM_UNDEF 0xffff
125 #define BTM_BLE_SCAN_PARAM_UNDEF 0xffff
126 
127 /* default connection parameters if not configured, use GAP recommended value
128  * for auto/selective connection */
129 /* default scan interval */
130 #ifndef BTM_BLE_SCAN_FAST_INT
131 #define BTM_BLE_SCAN_FAST_INT 96 /* 30 ~ 60 ms (use 60)  = 96 *0.625 */
132 #endif
133 /* default scan window for background connection, applicable for auto connection
134  * or selective connection */
135 #ifndef BTM_BLE_SCAN_FAST_WIN
136 #define BTM_BLE_SCAN_FAST_WIN 48 /* 30 ms = 48 *0.625 */
137 #endif
138 
139 /* default scan paramter used in reduced power cycle (background scanning) */
140 #ifndef BTM_BLE_SCAN_SLOW_INT_1
141 #define BTM_BLE_SCAN_SLOW_INT_1 2048 /* 1.28 s   = 2048 *0.625 */
142 #endif
143 #ifndef BTM_BLE_SCAN_SLOW_WIN_1
144 #define BTM_BLE_SCAN_SLOW_WIN_1 48 /* 30 ms = 48 *0.625 */
145 #endif
146 
147 /* default scan paramter used in reduced power cycle (background scanning) */
148 #ifndef BTM_BLE_SCAN_SLOW_INT_2
149 #define BTM_BLE_SCAN_SLOW_INT_2 4096 /* 2.56 s   = 4096 *0.625 */
150 #endif
151 #ifndef BTM_BLE_SCAN_SLOW_WIN_2
152 #define BTM_BLE_SCAN_SLOW_WIN_2 36 /* 22.5 ms = 36 *0.625 */
153 #endif
154 
155 /* default connection interval min */
156 #ifndef BTM_BLE_CONN_INT_MIN_DEF
157 /* recommended min: 30ms  = 24 * 1.25 */
158 #define BTM_BLE_CONN_INT_MIN_DEF 24
159 #endif
160 
161 /* default connectino interval max */
162 #ifndef BTM_BLE_CONN_INT_MAX_DEF
163 /* recommended max: 50 ms = 56 * 1.25 */
164 #define BTM_BLE_CONN_INT_MAX_DEF 40
165 #endif
166 
167 /* default slave latency */
168 #ifndef BTM_BLE_CONN_SLAVE_LATENCY_DEF
169 #define BTM_BLE_CONN_SLAVE_LATENCY_DEF 0 /* 0 */
170 #endif
171 
172 /* default supervision timeout */
173 #ifndef BTM_BLE_CONN_TIMEOUT_DEF
174 #define BTM_BLE_CONN_TIMEOUT_DEF 500
175 #endif
176 
177 /* minimum supervision timeout */
178 #ifndef BTM_BLE_CONN_TIMEOUT_MIN_DEF
179 #define BTM_BLE_CONN_TIMEOUT_MIN_DEF 100
180 #endif
181 
182 /* minimum acceptable connection interval */
183 #ifndef BTM_BLE_CONN_INT_MIN_LIMIT
184 #define BTM_BLE_CONN_INT_MIN_LIMIT 0x0009
185 #endif
186 
187 /* minimum acceptable connection interval when there is bonded Hearing Aid
188  * device */
189 #ifndef BTM_BLE_CONN_INT_MIN_HEARINGAID
190 #define BTM_BLE_CONN_INT_MIN_HEARINGAID 0x0010
191 #endif
192 
193 #define BTM_CMAC_TLEN_SIZE 8 /* 64 bits */
194 #define BTM_BLE_AUTH_SIGN_LEN \
195   12 /* BLE data signature length 8 Bytes + 4 bytes counter*/
196 typedef uint8_t BLE_SIGNATURE[BTM_BLE_AUTH_SIGN_LEN]; /* Device address */
197 
198 #ifndef BTM_BLE_HOST_SUPPORT
199 #define BTM_BLE_HOST_SUPPORT 0x01
200 #endif
201 
202 #ifndef BTM_BLE_SIMULTANEOUS_HOST
203 #define BTM_BLE_SIMULTANEOUS_HOST 0x01
204 #endif
205 
206 /* Appearance Values Reported with BTM_BLE_AD_TYPE_APPEARANCE */
207 #define BTM_BLE_APPEARANCE_UKNOWN 0x0000
208 #define BTM_BLE_APPEARANCE_GENERIC_PHONE 0x0040
209 #define BTM_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080
210 #define BTM_BLE_APPEARANCE_GENERIC_WATCH 0x00C0
211 #define BTM_BLE_APPEARANCE_SPORTS_WATCH 0x00C1
212 #define BTM_BLE_APPEARANCE_GENERIC_CLOCK 0x0100
213 #define BTM_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140
214 #define BTM_BLE_APPEARANCE_GENERIC_REMOTE 0x0180
215 #define BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0
216 #define BTM_BLE_APPEARANCE_GENERIC_TAG 0x0200
217 #define BTM_BLE_APPEARANCE_GENERIC_KEYRING 0x0240
218 #define BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280
219 #define BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0
220 #define BTM_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300
221 #define BTM_BLE_APPEARANCE_THERMOMETER_EAR 0x0301
222 #define BTM_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340
223 #define BTM_BLE_APPEARANCE_HEART_RATE_BELT 0x0341
224 #define BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380
225 #define BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381
226 #define BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382
227 #define BTM_BLE_APPEARANCE_GENERIC_HID 0x03C0
228 #define BTM_BLE_APPEARANCE_HID_KEYBOARD 0x03C1
229 #define BTM_BLE_APPEARANCE_HID_MOUSE 0x03C2
230 #define BTM_BLE_APPEARANCE_HID_JOYSTICK 0x03C3
231 #define BTM_BLE_APPEARANCE_HID_GAMEPAD 0x03C4
232 #define BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5
233 #define BTM_BLE_APPEARANCE_HID_CARD_READER 0x03C6
234 #define BTM_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7
235 #define BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8
236 #define BTM_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400
237 #define BTM_BLE_APPEARANCE_GENERIC_WALKING 0x0440
238 #define BTM_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441
239 #define BTM_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442
240 #define BTM_BLE_APPEARANCE_WALKING_ON_HIP 0x0443
241 #define BTM_BLE_APPEARANCE_GENERIC_CYCLING 0x0480
242 #define BTM_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481
243 #define BTM_BLE_APPEARANCE_CYCLING_SPEED 0x0482
244 #define BTM_BLE_APPEARANCE_CYCLING_CADENCE 0x0483
245 #define BTM_BLE_APPEARANCE_CYCLING_POWER 0x0484
246 #define BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485
247 #define BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40
248 #define BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41
249 #define BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42
250 #define BTM_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80
251 #define BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440
252 #define BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441
253 #define BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442
254 #define BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443
255 #define BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444
256 
257 /* Structure returned with Rand/Encrypt complete callback */
258 typedef struct {
259   uint8_t status;
260   uint8_t param_len;
261   uint16_t opcode;
262   uint8_t param_buf[OCTET16_LEN];
263 } tBTM_RAND_ENC;
264 
265 /* General callback function for notifying an application that a synchronous
266  * BTM function is complete. The pointer contains the address of any returned
267  * data.
268 */
269 typedef void(tBTM_RAND_ENC_CB)(tBTM_RAND_ENC* p1);
270 
271 /* ADV data flag bit definition used for BTM_BLE_AD_TYPE_FLAG */
272 #define BTM_BLE_LIMIT_DISC_FLAG (0x01 << 0)
273 #define BTM_BLE_GEN_DISC_FLAG (0x01 << 1)
274 #define BTM_BLE_BREDR_NOT_SPT (0x01 << 2)
275 /* 4.1 spec adv flag for simultaneous BR/EDR+LE connection support */
276 #define BTM_BLE_DMT_CONTROLLER_SPT (0x01 << 3)
277 #define BTM_BLE_DMT_HOST_SPT (0x01 << 4)
278 
279 // TODO(jpawlowski): this should be removed with code that depend on it.
280 #define BTM_BLE_AD_BIT_FLAGS (0x00000001 << 1)
281 
282 #define BTM_BLE_AD_TYPE_FLAG HCI_EIR_FLAGS_TYPE /* 0x01 */
283 #define BTM_BLE_AD_TYPE_16SRV_CMPL          \
284   HCI_EIR_COMPLETE_16BITS_UUID_TYPE /* 0x03 \
285                                        */
286 #define BTM_BLE_AD_TYPE_APPEARANCE 0x19
287 
288 /*  Min/max Preferred  number of payload octets that the local Controller
289     should include in a single Link Layer Data Channel PDU. */
290 #define BTM_BLE_DATA_SIZE_MAX 0x00fb
291 #define BTM_BLE_DATA_SIZE_MIN 0x001b
292 
293 /*  Preferred maximum number of microseconds that the local Controller
294     should use to transmit a single Link Layer Data Channel PDU. */
295 #define BTM_BLE_DATA_TX_TIME_MAX_LEGACY  0x0848
296 #define BTM_BLE_DATA_TX_TIME_MAX         0x4290
297 
298 /* adv tx power in dBm */
299 typedef struct {
300   uint8_t adv_inst_max; /* max adv instance supported in controller */
301   uint8_t rpa_offloading;
302   uint16_t tot_scan_results_strg;
303   uint8_t max_irk_list_sz;
304   uint8_t filter_support;
305   uint8_t max_filter;
306   uint8_t energy_support;
307   bool values_read;
308   uint16_t version_supported;
309   uint16_t total_trackable_advertisers;
310   uint8_t extended_scan_support;
311   uint8_t debug_logging_supported;
312 } tBTM_BLE_VSC_CB;
313 
314 typedef void(tBTM_BLE_ADV_DATA_CMPL_CBACK)(tBTM_STATUS status);
315 
316 #ifndef BTM_BLE_MULTI_ADV_MAX
317 #define BTM_BLE_MULTI_ADV_MAX                           \
318   16 /* controller returned adv_inst_max should be less \
319         than this number */
320 #endif
321 
322 typedef uint8_t tGATT_IF;
323 
324 typedef void(tBTM_BLE_SCAN_THRESHOLD_CBACK)(tBTM_BLE_REF_VALUE ref_value);
325 using tBTM_BLE_SCAN_REP_CBACK =
326     base::Callback<void(uint8_t /* status */, uint8_t /* report_format */,
327                         uint8_t /* num_reports */, std::vector<uint8_t>)>;
328 
329 #ifndef BTM_BLE_BATCH_SCAN_MAX
330 #define BTM_BLE_BATCH_SCAN_MAX 5
331 #endif
332 
333 #ifndef BTM_BLE_BATCH_REP_MAIN_Q_SIZE
334 #define BTM_BLE_BATCH_REP_MAIN_Q_SIZE 2
335 #endif
336 
337 typedef enum {
338   BTM_BLE_SCAN_INVALID_STATE = 0,
339   BTM_BLE_SCAN_ENABLE_CALLED = 1,
340   BTM_BLE_SCAN_ENABLED_STATE = 2,
341   BTM_BLE_SCAN_DISABLE_CALLED = 3,
342   BTM_BLE_SCAN_DISABLED_STATE = 4
343 } tBTM_BLE_BATCH_SCAN_STATE;
344 
345 enum { BTM_BLE_DISCARD_OLD_ITEMS, BTM_BLE_DISCARD_LOWER_RSSI_ITEMS };
346 typedef uint8_t tBTM_BLE_DISCARD_RULE;
347 
348 typedef struct {
349   tBTM_BLE_BATCH_SCAN_STATE cur_state;
350   tBTM_BLE_BATCH_SCAN_MODE scan_mode;
351   uint32_t scan_interval;
352   uint32_t scan_window;
353   tBLE_ADDR_TYPE addr_type;
354   tBTM_BLE_DISCARD_RULE discard_rule;
355   tBTM_BLE_SCAN_THRESHOLD_CBACK* p_thres_cback;
356   tBTM_BLE_REF_VALUE ref_value;
357 } tBTM_BLE_BATCH_SCAN_CB;
358 
359 /* filter selection bit index  */
360 #define BTM_BLE_PF_ADDR_FILTER 0
361 #define BTM_BLE_PF_SRVC_DATA 1
362 #define BTM_BLE_PF_SRVC_UUID 2
363 #define BTM_BLE_PF_SRVC_SOL_UUID 3
364 #define BTM_BLE_PF_LOCAL_NAME 4
365 #define BTM_BLE_PF_MANU_DATA 5
366 #define BTM_BLE_PF_SRVC_DATA_PATTERN 6
367 /* when passed in payload filter type all, only clear action is applicable */
368 #define BTM_BLE_PF_TYPE_ALL 7
369 #define BTM_BLE_PF_TYPE_MAX 8
370 
371 /* max number of filter spot for different filter type */
372 #ifndef BTM_BLE_MAX_UUID_FILTER
373 #define BTM_BLE_MAX_UUID_FILTER 8
374 #endif
375 #ifndef BTM_BLE_MAX_ADDR_FILTER
376 #define BTM_BLE_MAX_ADDR_FILTER 8
377 #endif
378 #ifndef BTM_BLE_PF_STR_COND_MAX
379 #define BTM_BLE_PF_STR_COND_MAX 4 /* apply to manu data , or local name */
380 #endif
381 #ifndef BTM_BLE_PF_STR_LEN_MAX
382 #define BTM_BLE_PF_STR_LEN_MAX 29 /* match for first 29 bytes */
383 #endif
384 
385 typedef uint8_t tBTM_BLE_PF_COND_TYPE;
386 
387 #define BTM_BLE_PF_LOGIC_OR 0
388 #define BTM_BLE_PF_LOGIC_AND 1
389 typedef uint8_t tBTM_BLE_PF_LOGIC_TYPE;
390 
391 #define BTM_BLE_PF_ENABLE 1
392 #define BTM_BLE_PF_CONFIG 2
393 
394 typedef uint8_t tBTM_BLE_PF_FILT_INDEX;
395 
396 enum {
397   BTM_BLE_SCAN_COND_ADD,
398   BTM_BLE_SCAN_COND_DELETE,
399   BTM_BLE_SCAN_COND_CLEAR = 2
400 };
401 typedef uint8_t tBTM_BLE_SCAN_COND_OP;
402 
403 /* BLE adv payload filtering config complete callback */
404 using tBTM_BLE_PF_CFG_CBACK = base::Callback<void(
405     uint8_t /* avbl_space */, uint8_t /* action */, uint8_t /* status */)>;
406 
407 /* BLE adv payload filtering status setup complete callback */
408 using tBTM_BLE_PF_STATUS_CBACK =
409     base::Callback<void(uint8_t /*action*/, tBTM_STATUS /* status */)>;
410 
411 /* BLE adv payload filtering param setup complete callback */
412 using tBTM_BLE_PF_PARAM_CB = base::Callback<void(
413     uint8_t /* avbl_space */, uint8_t /* action */, uint8_t /* status */)>;
414 
415 #ifndef BTM_CS_IRK_LIST_MAX
416 #define BTM_CS_IRK_LIST_MAX 0x20
417 #endif
418 
419 typedef struct {
420   bool in_use;
421   RawAddress bd_addr;
422   uint8_t pf_counter[BTM_BLE_PF_TYPE_MAX]; /* number of filter indexed by
423                                               tBTM_BLE_PF_COND_TYPE */
424 } tBTM_BLE_PF_COUNT;
425 
426 typedef struct {
427   bool enable;
428   uint8_t op_type;
429   tBTM_BLE_PF_COUNT* p_addr_filter_count; /* per BDA filter array */
430   tBLE_BD_ADDR cur_filter_target;
431 } tBTM_BLE_ADV_FILTER_CB;
432 
433 /* Sub codes */
434 #define BTM_BLE_META_PF_ENABLE 0x00
435 #define BTM_BLE_META_PF_FEAT_SEL 0x01
436 #define BTM_BLE_META_PF_ADDR 0x02
437 #define BTM_BLE_META_PF_UUID 0x03
438 #define BTM_BLE_META_PF_SOL_UUID 0x04
439 #define BTM_BLE_META_PF_LOCAL_NAME 0x05
440 #define BTM_BLE_META_PF_MANU_DATA 0x06
441 #define BTM_BLE_META_PF_SRVC_DATA 0x07
442 #define BTM_BLE_META_PF_ALL 0x08
443 
444 #define ADV_INFO_PRESENT 0x00
445 #define NO_ADV_INFO_PRESENT 0x01
446 
447 typedef btgatt_track_adv_info_t tBTM_BLE_TRACK_ADV_DATA;
448 
449 typedef void(tBTM_BLE_TRACK_ADV_CBACK)(
450     tBTM_BLE_TRACK_ADV_DATA* p_track_adv_data);
451 
452 typedef struct {
453   tBTM_BLE_REF_VALUE ref_value;
454   tBTM_BLE_TRACK_ADV_CBACK* p_track_cback;
455 } tBTM_BLE_ADV_TRACK_CB;
456 
457 typedef uint32_t tBTM_BLE_TX_TIME_MS;
458 typedef uint32_t tBTM_BLE_RX_TIME_MS;
459 typedef uint32_t tBTM_BLE_IDLE_TIME_MS;
460 typedef uint32_t tBTM_BLE_ENERGY_USED;
461 
462 typedef void(tBTM_BLE_ENERGY_INFO_CBACK)(tBTM_BLE_TX_TIME_MS tx_time,
463                                          tBTM_BLE_RX_TIME_MS rx_time,
464                                          tBTM_BLE_IDLE_TIME_MS idle_time,
465                                          tBTM_BLE_ENERGY_USED energy_used,
466                                          tBTM_STATUS status);
467 
468 typedef struct {
469   tBTM_BLE_ENERGY_INFO_CBACK* p_ener_cback;
470 } tBTM_BLE_ENERGY_INFO_CB;
471 
472 typedef void(tBTM_BLE_CTRL_FEATURES_CBACK)(tBTM_STATUS status);
473 
474 #endif  // BTM_BLE_API_TYPES_H
475