bta_hl_co.h revision 6ef101187774e30ddba6b46bbedef549a42196ad
1/******************************************************************************
2 *
3 *  Copyright (C) 2009-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 interface file for the HL (HeaLth device profile) subsystem
22 *  call-out functions.
23 *
24 ******************************************************************************/
25#ifndef BTA_HL_CO_H
26#define BTA_HL_CO_H
27
28#include "bta_api.h"
29#include "bta_hl_api.h"
30
31/*****************************************************************************
32**  Constants and Data Types
33*****************************************************************************/
34/**************************
35**  Common Definitions
36***************************/
37
38
39/*******************************************************************************
40**
41** Function        bta_hl_co_get_num_of_mdep
42**
43** Description     This function is called to get the number of MDEPs for this
44**                 application ID
45**
46** Parameters      app_id - application ID
47**                 p_num_of_mdep (output) - number of MDEP configurations supported
48**                                          by the application
49**
50** Returns         Bloolean - TRUE success
51**
52*******************************************************************************/
53BTA_API extern BOOLEAN bta_hl_co_get_num_of_mdep(UINT8 app_id, UINT8 *p_num_of_mdep);
54/*******************************************************************************
55**
56** Function        bta_hl_co_advrtise_source_sdp
57**
58** Description     This function is called to find out whether the SOURCE MDEP
59**                 configuration information should be advertize in the SDP or nopt
60**
61** Parameters      app_id - application ID
62**
63** Returns         Bloolean - TRUE advertise the SOURCE MDEP configuration
64**                            information
65**
66*******************************************************************************/
67BTA_API extern BOOLEAN bta_hl_co_advrtise_source_sdp(UINT8 app_id);
68/*******************************************************************************
69**
70** Function        bta_hl_co_get_mdep_config
71**
72** Description     This function is called to get the supported feature
73**                 configuration for the specified mdep index and it also assigns
74**                 the MDEP ID for the specified mdep index
75**
76** Parameters      app_id - HDP application ID
77**                 mdep_idx - the mdep index
78**                 mdep_id  - the assigned MDEP ID for the specified medp_idx
79**                 p_mdl_cfg (output) - pointer to the MDEP configuration
80**
81**
82** Returns         Bloolean - TRUE success
83*******************************************************************************/
84BTA_API extern BOOLEAN bta_hl_co_get_mdep_config(UINT8 app_id,
85                                                 UINT8 mdep_idx,
86                                                 tBTA_HL_MDEP_ID mdep_id,
87                                                 tBTA_HL_MDEP_CFG *p_mdep_cfg);
88
89
90/*******************************************************************************
91**
92** Function        bta_hl_co_get_echo_config
93**
94** Description     This function is called to get the echo test
95**                 maximum APDU size configuration
96**
97** Parameters      app_id - HDP application ID
98**                 p_echo_cfg (output) - pointer to the Echo test maximum APDU size
99**                                       configuration
100**
101** Returns         Bloolean - TRUE success
102*******************************************************************************/
103BTA_API extern BOOLEAN bta_hl_co_get_echo_config(UINT8  app_id,
104                                                 tBTA_HL_ECHO_CFG *p_echo_cfg);
105
106
107/*******************************************************************************
108**
109** Function        bta_hl_co_save_mdl
110**
111** Description     This function is called to save a MDL configuration item in persistent
112**                 storage
113**
114** Parameters      app_id - HDP application ID
115**                 item_idx - the MDL configuration storage index
116**                 p_mdl_cfg - pointer to the MDL configuration data
117**
118** Returns          void
119**
120*******************************************************************************/
121BTA_API extern void bta_hl_co_save_mdl(UINT8 app_id, UINT8 item_idx, tBTA_HL_MDL_CFG *p_mdl_cfg );
122/*******************************************************************************
123**
124** Function        bta_hl_co_delete_mdl
125**
126** Description     This function is called to delete a MDL configuration item in persistent
127**                 storage
128**
129** Parameters      app_id - HDP application ID
130**                 item_idx - the MDL configuration storage index
131**
132** Returns          void
133**
134*******************************************************************************/
135BTA_API extern void bta_hl_co_delete_mdl(UINT8 app_id, UINT8 item_idx);
136/*******************************************************************************
137**
138** Function         bta_hl_co_get_mdl_config
139**
140** Description     This function is called to get the MDL configuration
141**                 from teh persistent memory. This function shall only be called
142*8                 once after the device is powered up
143**
144** Parameters      app_id - HDP application ID
145**                 buffer_size - the unit of the buffer size is sizeof(tBTA_HL_MDL_CFG)
146**                 p_mdl_buf - Point to the starting location of the buffer
147**
148** Returns         BOOLEAN
149**
150**
151*******************************************************************************/
152BTA_API extern BOOLEAN bta_hl_co_load_mdl_config (UINT8 app_id, UINT8 buffer_size,
153                                                  tBTA_HL_MDL_CFG *p_mdl_buf );
154
155
156/*******************************************************************************
157**
158** Function         bta_hl_co_get_tx_data
159**
160** Description     Get the data to be sent
161**
162** Parameters      app_id - HDP application ID
163**                 mdl_handle - MDL handle
164**                 buf_size - the size of the buffer
165**                 p_buf - the buffer pointer
166**                 evt - the evt to be passed back to the HL in the
167**                       bta_hl_ci_get_tx_data call-in function
168**
169** Returns        Void
170**
171*******************************************************************************/
172BTA_API extern void bta_hl_co_get_tx_data (UINT8 app_id, tBTA_HL_MDL_HANDLE mdl_handle,
173                                           UINT16 buf_size, UINT8 *p_buf, UINT16 evt);
174
175
176/*******************************************************************************
177**
178** Function        bta_hl_co_put_rx_data
179**
180** Description     Put the received data
181**
182** Parameters      app_id - HDP application ID
183**                 mdl_handle - MDL handle
184**                 data_size - the size of the data
185**                 p_data - the data pointer
186**                 evt - the evt to be passed back to the HL in the
187**                       bta_hl_ci_put_rx_data call-in function
188**
189** Returns        Void
190**
191*******************************************************************************/
192BTA_API extern void bta_hl_co_put_rx_data (UINT8 app_id, tBTA_HL_MDL_HANDLE mdl_handle,
193                                           UINT16 data_size, UINT8 *p_data, UINT16 evt);
194/*******************************************************************************
195**
196** Function         bta_hl_co_get_tx_data
197**
198** Description     Get the Echo data to be sent
199**
200** Parameters      app_id - HDP application ID
201**                 mcl_handle - MCL handle
202**                 buf_size - the size of the buffer
203**                 p_buf - the buffer pointer
204**                 evt - the evt to be passed back to the HL in the
205**                       bta_hl_ci_get_tx_data call-in function
206**
207** Returns        Void
208**
209*******************************************************************************/
210BTA_API extern void bta_hl_co_get_echo_data (UINT8 app_id, tBTA_HL_MCL_HANDLE mcl_handle,
211                                             UINT16 buf_size, UINT8 *p_buf, UINT16 evt);
212
213/*******************************************************************************
214**
215** Function        bta_hl_co_put_echo_data
216**
217** Description     Put the received loopback echo data
218**
219** Parameters      app_id - HDP application ID
220**                 mcl_handle - MCL handle
221**                 data_size - the size of the data
222**                 p_data - the data pointer
223**                 evt - the evt to be passed back to the HL in the
224**                       bta_hl_ci_put_echo_data call-in function
225**
226** Returns        Void
227**
228*******************************************************************************/
229BTA_API extern void bta_hl_co_put_echo_data (UINT8 app_id, tBTA_HL_MCL_HANDLE mcl_handle,
230                                             UINT16 data_size, UINT8 *p_data, UINT16 evt);
231
232#endif /* BTA_HL_CO_H */
233