• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright 2014 The Android Open Source Project
4  *  Copyright 2003-2012 Broadcom Corporation
5  *
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at:
9  *
10  *  http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *
18  ******************************************************************************/
19 
20 /******************************************************************************
21  *
22  *  This is the private interface file for the BTA MCE I/F
23  *
24  ******************************************************************************/
25 #ifndef BTA_MCE_INT_H
26 #define BTA_MCE_INT_H
27 
28 #include "bta_api.h"
29 #include "bta_mce_api.h"
30 #include "bta_sys.h"
31 
32 /*****************************************************************************
33  *  Constants
34  ****************************************************************************/
35 
36 enum {
37   /* these events are handled by the state machine */
38   BTA_MCE_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_MCE),
39   BTA_MCE_API_GET_REMOTE_MAS_INSTANCES_EVT,
40   BTA_MCE_MAX_INT_EVT
41 };
42 
43 /* data type for BTA_MCE_API_ENABLE_EVT */
44 typedef struct {
45   BT_HDR hdr;
46   tBTA_MCE_DM_CBACK* p_cback;
47 } tBTA_MCE_API_ENABLE;
48 
49 /* data type for BTA_MCE_API_GET_REMOTE_MAS_INSTANCES_EVT */
50 typedef struct {
51   BT_HDR hdr;
52   RawAddress bd_addr;
53 } tBTA_MCE_API_GET_REMOTE_MAS_INSTANCES;
54 
55 /* union of all data types */
56 typedef union {
57   /* GKI event buffer header */
58   BT_HDR hdr;
59   tBTA_MCE_API_ENABLE enable;
60   tBTA_MCE_API_GET_REMOTE_MAS_INSTANCES get_rmt_mas;
61 } tBTA_MCE_MSG;
62 
63 /* MCE control block */
64 typedef struct {
65   uint8_t sdp_active; /* see BTA_MCE_SDP_ACT_* */
66   RawAddress remote_addr;
67   tBTA_MCE_DM_CBACK* p_dm_cback;
68 } tBTA_MCE_CB;
69 
70 enum {
71   BTA_MCE_SDP_ACT_NONE = 0,
72   BTA_MCE_SDP_ACT_YES /* waiting for SDP result */
73 };
74 
75 /* MCE control block */
76 extern tBTA_MCE_CB bta_mce_cb;
77 
78 /* config struct */
79 extern tBTA_MCE_CFG* p_bta_mce_cfg;
80 
81 extern bool bta_mce_sm_execute(BT_HDR* p_msg);
82 
83 extern void bta_mce_enable(tBTA_MCE_MSG* p_data);
84 extern void bta_mce_get_remote_mas_instances(tBTA_MCE_MSG* p_data);
85 
86 #endif /* BTA_MCE_INT_H */
87