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 #pragma once
18 
19 #include <cstdint>
20 
21 #include "stack/include/bt_types.h"
22 #include "stack/include/btm_status.h"
23 #include "types/raw_address.h"
24 
25 // Note: From include/btm_api_types.h
26 
27 /*****************************************************************************
28  *  ACL CHANNEL MANAGEMENT
29  ****************************************************************************/
30 /******************
31  *  ACL Constants
32  ******************/
33 /***************
34  *  ACL Types
35  ***************/
36 
37 /* Structure returned with read RSSI event (in tBTM_CMPL_CB callback function)
38  * in response to BTM_ReadRSSI call.
39  */
40 typedef struct {
41   tBTM_STATUS status;
42   uint8_t hci_status;
43   RawAddress rem_bda;
44   int8_t rssi;
45 } tBTM_RSSI_RESULT;
46 
47 /* Structure returned with read failed contact counter event
48  * (in tBTM_CMPL_CB callback function) in response to
49  * BTM_ReadFailedContactCounter call.
50  */
51 typedef struct {
52   tBTM_STATUS status;
53   uint8_t hci_status;
54   RawAddress rem_bda;
55   uint16_t failed_contact_counter;
56 } tBTM_FAILED_CONTACT_COUNTER_RESULT;
57 
58 /* Structure returned with read automatic flush timeout event
59  * (in tBTM_CMPL_CB callback function) in response to
60  * BTM_ReadAutomaticFlushTimeout call.
61  */
62 typedef struct {
63   tBTM_STATUS status;
64   uint8_t hci_status;
65   RawAddress rem_bda;
66   uint16_t automatic_flush_timeout;
67 } tBTM_AUTOMATIC_FLUSH_TIMEOUT_RESULT;
68 
69 /* Structure returned with read current TX power event (in tBTM_CMPL_CB callback
70  * function) in response to BTM_ReadTxPower call.
71  */
72 typedef struct {
73   tBTM_STATUS status;
74   uint8_t hci_status;
75   RawAddress rem_bda;
76   int8_t tx_power;
77 } tBTM_TX_POWER_RESULT;
78 
79 /* Structure returned with read link quality event (in tBTM_CMPL_CB callback
80  * function) in response to BTM_ReadLinkQuality call.
81  */
82 typedef struct {
83   tBTM_STATUS status;
84   uint8_t hci_status;
85   RawAddress rem_bda;
86   uint8_t link_quality;
87 } tBTM_LINK_QUALITY_RESULT;
88 
89 #define BTM_INQUIRY_STARTED 1
90 #define BTM_INQUIRY_CANCELLED 2
91 #define BTM_INQUIRY_COMPLETE 3
92