1 /******************************************************************************
2  *
3  *  Copyright 2003-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 is the private interface file for the BTA system manager.
22  *
23  ******************************************************************************/
24 #ifndef BTA_SYS_INT_H
25 #define BTA_SYS_INT_H
26 
27 #include <cstdint>
28 
29 #include "bta/sys/bta_sys.h"
30 #include "internal_include/bt_target.h"
31 /*****************************************************************************
32  *  Constants and data types
33  ****************************************************************************/
34 
35 /*****************************************************************************
36  *  state table
37  ****************************************************************************/
38 
39 /* Collision callback */
40 #define MAX_COLLISION_REG 5
41 
42 typedef struct {
43   tBTA_SYS_ID id[MAX_COLLISION_REG];
44   tBTA_SYS_CONN_CBACK* p_coll_cback[MAX_COLLISION_REG];
45 } tBTA_SYS_COLLISION;
46 
47 /* system manager control block */
48 typedef struct {
49   tBTA_SYS_REG* reg[BTA_ID_MAX]; /* registration structures */
50   bool is_reg[BTA_ID_MAX];       /* registration structures */
51   uint16_t sys_features;         /* Bitmask of sys features */
52 
53   tBTA_SYS_CONN_CBACK* prm_cb;           /* role management callback registered by DM */
54   tBTA_SYS_CONN_CBACK* ppm_cb;           /* low power management callback registered by DM */
55   tBTA_SYS_SNIFF_CBACK* sniff_cb;        /* low power management sniff callback registered by DM */
56   tBTA_SYS_CONN_SCO_CBACK* p_sco_cb;     /* SCO connection change callback registered by AV */
57   tBTA_SYS_ROLE_SWITCH_CBACK* p_role_cb; /* role change callback registered by AV */
58   tBTA_SYS_COLLISION colli_reg;          /* collision handling module */
59   tBTA_SYS_EIR_CBACK* eir_cb;            /* add/remove UUID into EIR */
60   tBTA_SYS_CUST_EIR_CBACK* cust_eir_cb;  /* add/remove customer UUID into EIR */
61   tBTA_SYS_SSR_CFG_CBACK* p_ssr_cb;
62   /* VS event handler */
63   tBTA_SYS_VS_EVT_HDLR* p_vs_evt_hdlr;
64 } tBTA_SYS_CB;
65 
66 /*****************************************************************************
67  *  Global variables
68  ****************************************************************************/
69 
70 /* system manager control block */
71 extern tBTA_SYS_CB bta_sys_cb;
72 
73 #endif /* BTA_SYS_INT_H */
74