1 /******************************************************************************
3 * Copyright 2014 The Android Open Source Project
4 * Copyright 2006-2012 Broadcom Corporation
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:
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 ******************************************************************************/
20 /******************************************************************************
22 * This is the public interface file the BTA MCE I/F
24 ******************************************************************************/
28 #include "bt_target.h"
33 /*****************************************************************************
34 * Constants and data types
35 ****************************************************************************/
37 #define BTA_MCE_SUCCESS 0 /* Successful operation. */
38 #define BTA_MCE_FAILURE 1 /* Generic failure. */
39 #define BTA_MCE_BUSY 2 /* Temporarily can not handle this request. */
41 typedef uint8_t tBTA_MCE_STATUS;
43 /* MCE I/F callback events */
44 /* events received by tBTA_MCE_DM_CBACK */
45 #define BTA_MCE_ENABLE_EVT 0 /* MCE enabled */
46 #define BTA_MCE_MAS_DISCOVERY_COMP_EVT 1 /* SDP MAS discovery complete */
47 #define BTA_MCE_MAX_EVT 2 /* max number of MCE events */
49 #define BTA_MCE_MAX_MAS_INSTANCES 12
51 typedef uint16_t tBTA_MCE_EVT;
56 uint16_t srv_name_len;
61 /* data associated with BTA_MCE_MAS_DISCOVERY_COMP_EVT */
63 tBTA_MCE_STATUS status;
64 RawAddress remote_addr;
66 tBTA_MCE_MAS_INFO mas[BTA_MCE_MAX_MAS_INSTANCES];
67 } tBTA_MCE_MAS_DISCOVERY_COMP;
69 /* union of data associated with MCE callback */
71 tBTA_MCE_STATUS status; /* BTA_MCE_ENABLE_EVT */
72 tBTA_MCE_MAS_DISCOVERY_COMP
73 mas_disc_comp; /* BTA_MCE_MAS_DISCOVERY_COMP_EVT */
76 /* MCE DM Interface callback */
77 typedef void(tBTA_MCE_DM_CBACK)(tBTA_MCE_EVT event, tBTA_MCE* p_data,
80 /* MCE configuration structure */
82 uint16_t sdp_db_size; /* The size of p_sdp_db */
83 tSDP_DISCOVERY_DB* p_sdp_db; /* The data buffer to keep SDP database */
86 /*****************************************************************************
87 * External Function Declarations
88 ****************************************************************************/
90 /*******************************************************************************
92 * Function BTA_MceEnable
94 * Description Enable the MCE I/F service. When the enable
95 * operation is complete the callback function will be
96 * called with a BTA_MCE_ENABLE_EVT. This function must
97 * be called before other functions in the MCE API are
100 * Returns BTA_MCE_SUCCESS if successful.
101 * BTA_MCE_FAIL if internal failure.
103 ******************************************************************************/
104 extern tBTA_MCE_STATUS BTA_MceEnable(tBTA_MCE_DM_CBACK* p_cback);
106 /*******************************************************************************
108 * Function BTA_MceGetRemoteMasInstances
110 * Description This function performs service discovery for the MAS service
111 * by the given peer device. When the operation is completed
112 * the tBTA_MCE_DM_CBACK callback function will be called with
113 * a BTA_MCE_MAS_DISCOVERY_COMP_EVT.
115 * Returns BTA_MCE_SUCCESS, if the request is being processed.
116 * BTA_MCE_FAILURE, otherwise.
118 ******************************************************************************/
119 extern tBTA_MCE_STATUS BTA_MceGetRemoteMasInstances(const RawAddress& bd_addr);
121 #endif /* BTA_MCE_API_H */