• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright (C) 1998-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 file for the message access equipment (MSE)
22  *  subsystem.
23  *
24  ******************************************************************************/
25 #ifndef BTA_HL_INT_H
26 #define BTA_HL_INT_H
27 
28 #include "bt_target.h"
29 #include "bta_sys.h"
30 #include "obx_api.h"
31 #include "bta_hl_api.h"
32 #include "bta_hl_co.h"
33 #include "l2cdefs.h"
34 
35 
36 typedef UINT16 (tBTA_HL_ALLOCATE_PSM) (void);
37 
38 /*****************************************************************************
39 **  Constants and data types
40 *****************************************************************************/
41 
42 #ifndef BTA_HL_DISC_SIZE
43 #define BTA_HL_DISC_SIZE                1600
44 #endif
45 #define BTA_HL_NUM_SRCH_ATTR            10
46 #define BTA_HL_MIN_SDP_MDEP_LEN         7
47 
48 /* L2CAP defualt parameters */
49 #define BTA_HL_L2C_TX_WIN_SIZE          10
50 #define BTA_HL_L2C_MAX_TRANSMIT         32
51 #define BTA_HL_L2C_RTRANS_TOUT          2000
52 #define BTA_HL_L2C_MON_TOUT             12000
53 #define BTA_HL_L2C_MPS                  1017
54 #define BTA_HL_L2C_USER_RX_POOL_ID      L2CAP_DEFAULT_ERM_POOL_ID
55 #define BTA_HL_L2C_USER_TX_POOL_ID      L2CAP_DEFAULT_ERM_POOL_ID /* todo this should be based on data type */
56 #define BTA_HL_L2C_FCR_RX_POOL_ID       L2CAP_DEFAULT_ERM_POOL_ID
57 #define BTA_HL_L2C_FCR_TX_POOL_ID       L2CAP_DEFAULT_ERM_POOL_ID
58 
59 /* L2CAP FCS setting*/
60 #define BTA_HL_MCA_USE_FCS              MCA_FCS_USE
61 #define BTA_HL_MCA_NO_FCS               MCA_FCS_BYPASS
62 #define BTA_HL_L2C_USE_FCS              1
63 #define BTA_HL_L2C_NO_FCS               0
64 #define BTA_HL_DEFAULT_SOURCE_FCS       BTA_HL_L2C_USE_FCS
65 
66 /* SDP Operations */
67 #define BTA_HL_SDP_OP_NONE                  0
68 #define BTA_HL_SDP_OP_CCH_INIT              1
69 #define BTA_HL_SDP_OP_DCH_OPEN_INIT         2
70 #define BTA_HL_SDP_OP_DCH_RECONNECT_INIT    3
71 #define BTA_HL_SDP_OP_SDP_QUERY_NEW         4
72 #define BTA_HL_SDP_OP_SDP_QUERY_CURRENT     5
73 
74 typedef UINT8 tBTA_HL_SDP_OPER;
75 
76 /* CCH Operations */
77 #define     BTA_HL_CCH_OP_NONE            0
78 #define     BTA_HL_CCH_OP_LOCAL_OPEN      1
79 #define     BTA_HL_CCH_OP_REMOTE_OPEN     2
80 #define     BTA_HL_CCH_OP_LOCAL_CLOSE     3
81 #define     BTA_HL_CCH_OP_REMOTE_CLOSE    4
82 
83 typedef UINT8 tBTA_HL_CCH_OPER;
84 
85 /* Pending DCH close operations when closing a CCH */
86 #define    BTA_HL_CCH_CLOSE_OP_DCH_NONE     0
87 #define    BTA_HL_CCH_CLOSE_OP_DCH_ABORT    1
88 #define    BTA_HL_CCH_CLOSE_OP_DCH_CLOSE    2
89 typedef UINT8 tBTA_HL_CCH_CLOSE_DCH_OPER;
90 
91 /* DCH Operations */
92 #define    BTA_HL_DCH_OP_NONE                    0
93 #define    BTA_HL_DCH_OP_REMOTE_CREATE           1
94 #define    BTA_HL_DCH_OP_LOCAL_OPEN              2
95 #define    BTA_HL_DCH_OP_REMOTE_OPEN             3
96 #define    BTA_HL_DCH_OP_LOCAL_CLOSE             4
97 #define    BTA_HL_DCH_OP_REMOTE_CLOSE            5
98 #define    BTA_HL_DCH_OP_LOCAL_DELETE            6
99 #define    BTA_HL_DCH_OP_REMOTE_DELETE           7
100 #define    BTA_HL_DCH_OP_LOCAL_RECONNECT         8
101 #define    BTA_HL_DCH_OP_REMOTE_RECONNECT        9
102 #define    BTA_HL_DCH_OP_LOCAL_CLOSE_ECHO_TEST   10
103 #define    BTA_HL_DCH_OP_LOCAL_CLOSE_RECONNECT   11
104 
105 typedef UINT8 tBTA_HL_DCH_OPER;
106 
107 /* Echo test Operations */
108 #define    BTA_HL_ECHO_OP_NONE                 0
109 #define    BTA_HL_ECHO_OP_CI_GET_ECHO_DATA     1
110 #define    BTA_HL_ECHO_OP_SDP_INIT             2
111 #define    BTA_HL_ECHO_OP_MDL_CREATE_CFM       3
112 #define    BTA_HL_ECHO_OP_DCH_OPEN_CFM         4
113 #define    BTA_HL_ECHO_OP_LOOP_BACK            5
114 #define    BTA_HL_ECHO_OP_CI_PUT_ECHO_DATA     6
115 #define    BTA_HL_ECHO_OP_DCH_CLOSE_CFM        7
116 #define    BTA_HL_ECHO_OP_OPEN_IND             8
117 #define    BTA_HL_ECHO_OP_ECHO_PKT             9
118 
119 typedef UINT8 tBTA_HL_ECHO_OPER;
120 
121 /* abort status mask for abort_oper */
122 
123 #define BTA_HL_ABORT_NONE_MASK      0x00
124 #define BTA_HL_ABORT_PENDING_MASK   0x01
125 #define BTA_HL_ABORT_LOCAL_MASK     0x10
126 #define BTA_HL_ABORT_REMOTE_MASK    0x20
127 #define BTA_HL_ABORT_CCH_CLOSE_MASK 0x40
128 
129 /* call out mask for cout_oper */
130 #define BTA_HL_CO_NONE_MASK          0x00
131 #define BTA_HL_CO_GET_TX_DATA_MASK   0x01
132 #define BTA_HL_CO_PUT_RX_DATA_MASK   0x02
133 #define BTA_HL_CO_GET_ECHO_DATA_MASK 0x04
134 #define BTA_HL_CO_PUT_ECHO_DATA_MASK 0x08
135 
136 typedef struct
137 {
138     UINT16      mtu;
139     UINT8       fcs;                    /* '0' No FCS, otherwise '1' */
140 } tBTA_HL_L2CAP_CFG_INFO;
141 
142 
143 /* State Machine Events */
144 enum
145 {
146     /* these events are handled by the state machine */
147     BTA_HL_CCH_OPEN_EVT     = BTA_SYS_EVT_START(BTA_ID_HL),
148     BTA_HL_CCH_SDP_OK_EVT,
149     BTA_HL_CCH_SDP_FAIL_EVT,
150     BTA_HL_MCA_CONNECT_IND_EVT,
151     BTA_HL_MCA_DISCONNECT_IND_EVT,
152     BTA_HL_CCH_CLOSE_EVT,
153     BTA_HL_CCH_CLOSE_CMPL_EVT,
154     BTA_HL_MCA_RSP_TOUT_IND_EVT,
155     /* DCH EVENT */
156     BTA_HL_DCH_SDP_INIT_EVT,
157     BTA_HL_DCH_OPEN_EVT,
158     BTA_HL_MCA_CREATE_IND_EVT,
159     BTA_HL_MCA_CREATE_CFM_EVT,
160     BTA_HL_MCA_OPEN_IND_EVT,
161 
162     BTA_HL_MCA_OPEN_CFM_EVT,
163     BTA_HL_DCH_CLOSE_EVT,
164     BTA_HL_MCA_CLOSE_IND_EVT,
165     BTA_HL_MCA_CLOSE_CFM_EVT,
166     BTA_HL_API_SEND_DATA_EVT,
167 
168     BTA_HL_MCA_RCV_DATA_EVT,
169     BTA_HL_DCH_CLOSE_CMPL_EVT,
170     BTA_HL_DCH_RECONNECT_EVT,
171     BTA_HL_DCH_SDP_FAIL_EVT,
172     BTA_HL_MCA_RECONNECT_IND_EVT,
173 
174     BTA_HL_MCA_RECONNECT_CFM_EVT,
175     BTA_HL_DCH_CLOSE_ECHO_TEST_EVT,
176     BTA_HL_API_DCH_CREATE_RSP_EVT,
177     BTA_HL_DCH_ABORT_EVT,
178     BTA_HL_MCA_ABORT_IND_EVT,
179 
180     BTA_HL_MCA_ABORT_CFM_EVT,
181     BTA_HL_MCA_CONG_CHG_EVT,
182     BTA_HL_CI_GET_TX_DATA_EVT,
183     BTA_HL_CI_PUT_RX_DATA_EVT,
184     BTA_HL_CI_GET_ECHO_DATA_EVT,
185     BTA_HL_DCH_ECHO_TEST_EVT,
186     BTA_HL_CI_PUT_ECHO_DATA_EVT,
187 
188     /* these events are handled outside the state machine */
189     BTA_HL_API_ENABLE_EVT,
190     BTA_HL_API_DISABLE_EVT,
191     BTA_HL_API_REGISTER_EVT,
192     BTA_HL_API_DEREGISTER_EVT,
193     BTA_HL_API_CCH_OPEN_EVT,
194     BTA_HL_API_CCH_CLOSE_EVT,
195     BTA_HL_API_DCH_OPEN_EVT,
196     BTA_HL_API_DCH_RECONNECT_EVT,
197     BTA_HL_API_DCH_CLOSE_EVT,
198     BTA_HL_API_DELETE_MDL_EVT,
199     BTA_HL_API_DCH_ABORT_EVT,
200 
201     BTA_HL_API_DCH_ECHO_TEST_EVT,
202     BTA_HL_API_SDP_QUERY_EVT,
203     BTA_HL_SDP_QUERY_OK_EVT,
204     BTA_HL_SDP_QUERY_FAIL_EVT,
205     BTA_HL_MCA_DELETE_IND_EVT,
206     BTA_HL_MCA_DELETE_CFM_EVT
207 };
208 typedef UINT16 tBTA_HL_INT_EVT;
209 
210 #define BTA_HL_DCH_EVT_MIN BTA_HL_DCH_SDP_INIT_EVT
211 #define BTA_HL_DCH_EVT_MAX 0xFFFF
212 
213 
214 /* state machine states */
215 enum
216 {
217     BTA_HL_CCH_IDLE_ST = 0,      /* Idle  */
218     BTA_HL_CCH_OPENING_ST,       /* Opening a connection*/
219     BTA_HL_CCH_OPEN_ST,          /* Connection is open */
220     BTA_HL_CCH_CLOSING_ST        /* Closing is in progress */
221 };
222 typedef UINT8 tBTA_HL_CCH_STATE;
223 
224 enum
225 {
226     BTA_HL_DCH_IDLE_ST = 0,      /* Idle  */
227     BTA_HL_DCH_OPENING_ST,       /* Opening a connection*/
228     BTA_HL_DCH_OPEN_ST,          /* Connection is open */
229     BTA_HL_DCH_CLOSING_ST        /* Closing is in progress */
230 };
231 typedef UINT8 tBTA_HL_DCH_STATE;
232 
233 
234 typedef struct
235 {
236     BT_HDR              hdr;
237     tBTA_HL_CTRL_CBACK  *p_cback;        /* pointer to control callback function */
238 } tBTA_HL_API_ENABLE;
239 
240 typedef struct
241 {
242     BT_HDR              hdr;
243     UINT8               app_id;
244     tBTA_HL_CBACK       *p_cback;        /* pointer to application callback function */
245     tBTA_HL_DEVICE_TYPE dev_type;           /* sink, source or dual roles */
246     tBTA_SEC            sec_mask;           /* security mask for accepting conenction*/
247     char                srv_name[BTA_SERVICE_NAME_LEN +1];        /* service name to be used in the SDP; null terminated*/
248     char                srv_desp[BTA_SERVICE_DESP_LEN +1];        /* service description to be used in the SDP; null terminated */
249     char                provider_name[BTA_PROVIDER_NAME_LEN +1];   /* provide name to be used in the SDP; null terminated */
250 } tBTA_HL_API_REGISTER;
251 
252 typedef struct
253 {
254     BT_HDR                  hdr;
255     tBTA_HL_APP_HANDLE      app_handle;
256 } tBTA_HL_API_DEREGISTER;
257 
258 typedef struct
259 {
260     BT_HDR                  hdr;
261     tBTA_HL_APP_HANDLE      app_handle;
262     UINT16                  ctrl_psm;
263     BD_ADDR                 bd_addr;        /* Address of peer device */
264     tBTA_SEC                sec_mask;       /* security mask for initiating connection*/
265 } tBTA_HL_API_CCH_OPEN;
266 
267 
268 typedef struct
269 {
270     BT_HDR                  hdr;
271     tBTA_HL_MCL_HANDLE      mcl_handle;
272 } tBTA_HL_API_CCH_CLOSE;
273 
274 
275 
276 typedef struct
277 {
278     BT_HDR                  hdr;
279     tBTA_HL_MCL_HANDLE      mcl_handle;
280     UINT16                  ctrl_psm;
281     tBTA_HL_MDEP_ID         local_mdep_id;     /* local MDEP ID */
282     tBTA_HL_MDEP_ID         peer_mdep_id;      /* peer mdep id */
283     tBTA_HL_DCH_CFG         local_cfg;
284     tBTA_SEC                sec_mask;          /* security mask for initiating connection*/
285 } tBTA_HL_API_DCH_OPEN;
286 
287 
288 typedef struct
289 {
290     BT_HDR                  hdr;
291 
292     tBTA_HL_MCL_HANDLE      mcl_handle;
293     UINT16                  ctrl_psm;
294     tBTA_HL_MDL_ID          mdl_id;
295 } tBTA_HL_API_DCH_RECONNECT;
296 
297 typedef struct
298 {
299     BT_HDR                  hdr;
300     tBTA_HL_MDL_HANDLE      mdl_handle;
301 } tBTA_HL_API_DCH_CLOSE;
302 
303 typedef struct
304 {
305     BT_HDR                  hdr;
306     tBTA_HL_MCL_HANDLE      mcl_handle;
307     tBTA_HL_MDL_ID          mdl_id;
308 } tBTA_HL_API_DELETE_MDL;
309 
310 typedef struct
311 {
312     BT_HDR              hdr;
313     tBTA_HL_MCL_HANDLE mcl_handle;
314 } tBTA_HL_API_DCH_ABORT;
315 
316 
317 typedef struct
318 {
319     BT_HDR              hdr;
320     tBTA_HL_MDL_HANDLE  mdl_handle;
321     UINT16              pkt_size;
322 } tBTA_HL_API_SEND_DATA;
323 
324 typedef struct
325 {
326     BT_HDR              hdr;
327     tBTA_HL_MCL_HANDLE  mcl_handle;
328     UINT16              ctrl_psm;
329     UINT16              pkt_size;
330     tBTA_HL_DCH_CFG     local_cfg;
331 } tBTA_HL_API_DCH_ECHO_TEST;
332 
333 typedef struct
334 {
335     BT_HDR                  hdr;
336     UINT8                   app_idx;
337     UINT8                   mcl_idx;
338     BOOLEAN                 release_mcl_cb;
339 }tBTA_HL_CCH_SDP;
340 
341 
342 /* MCA callback event parameters. */
343 typedef struct
344 {
345     BT_HDR              hdr;
346     tBTA_HL_APP_HANDLE  app_handle;
347     tBTA_HL_MCL_HANDLE  mcl_handle;
348     tMCA_CTRL       mca_data;
349 } tBTA_HL_MCA_EVT;
350 
351 
352 /* MCA callback event parameters. */
353 typedef struct
354 {
355     BT_HDR          hdr;
356     UINT8           app_idx;
357     UINT8           mcl_idx;
358     UINT8           mdl_idx;
359     BT_HDR          *p_pkt;
360 } tBTA_HL_MCA_RCV_DATA_EVT;
361 
362 
363 typedef struct
364 {
365     BT_HDR                  hdr;
366     UINT8                   app_idx;
367     UINT8                   mcl_idx;
368     UINT8                   mdl_idx;
369 }tBTA_HL_DCH_SDP;
370 
371 typedef struct
372 {
373     BT_HDR                  hdr;
374     tBTA_HL_APP_HANDLE      app_handle;
375     BD_ADDR                 bd_addr;        /* Address of peer device */
376 } tBTA_HL_API_SDP_QUERY;
377 
378 typedef struct
379 {
380     BT_HDR                  hdr;
381     tBTA_HL_MCL_HANDLE      mcl_handle;
382     tBTA_HL_MDL_ID          mdl_id;
383     tBTA_HL_MDEP_ID         local_mdep_id;
384     tBTA_HL_DCH_CREATE_RSP  rsp_code;
385     tBTA_HL_DCH_CFG         cfg_rsp;
386 } tBTA_HL_API_DCH_CREATE_RSP;
387 
388 typedef struct
389 {
390     BT_HDR                  hdr;
391     tBTA_HL_MDL_HANDLE      mdl_handle;
392     tBTA_HL_STATUS          status;
393 } tBTA_HL_CI_GET_PUT_DATA;
394 
395 typedef struct
396 {
397     BT_HDR                  hdr;
398     tBTA_HL_MCL_HANDLE      mcl_handle;
399     tBTA_HL_STATUS          status;
400 } tBTA_HL_CI_ECHO_DATA;
401 
402 /* union of all state machine event data types */
403 typedef union
404 {
405     BT_HDR                      hdr;
406     tBTA_HL_API_ENABLE          api_enable; /* data for BTA_MSE_API_ENABLE_EVT */
407     tBTA_HL_API_REGISTER        api_reg;
408     tBTA_HL_API_DEREGISTER      api_dereg;
409     tBTA_HL_API_CCH_OPEN        api_cch_open;
410     tBTA_HL_API_CCH_CLOSE       api_cch_close;
411     tBTA_HL_API_DCH_CREATE_RSP  api_dch_create_rsp;
412     tBTA_HL_API_DCH_OPEN        api_dch_open;
413     tBTA_HL_API_DCH_RECONNECT   api_dch_reconnect;
414     tBTA_HL_API_DCH_CLOSE       api_dch_close;
415     tBTA_HL_API_DELETE_MDL      api_delete_mdl;
416     tBTA_HL_API_DCH_ABORT       api_dch_abort;
417     tBTA_HL_API_SEND_DATA       api_send_data;
418     tBTA_HL_API_DCH_ECHO_TEST   api_dch_echo_test;
419     tBTA_HL_API_SDP_QUERY       api_sdp_query;
420 
421     tBTA_HL_CCH_SDP             cch_sdp;
422     tBTA_HL_MCA_EVT             mca_evt;
423     tBTA_HL_MCA_RCV_DATA_EVT    mca_rcv_data_evt;
424     tBTA_HL_DCH_SDP             dch_sdp; /* for DCH_OPEN_EVT and DCH_RECONNECT_EVT */
425     tBTA_HL_CI_GET_PUT_DATA     ci_get_put_data;
426     tBTA_HL_CI_ECHO_DATA        ci_get_put_echo_data;
427 } tBTA_HL_DATA;
428 
429 
430 typedef struct
431 {
432     BOOLEAN                 in_use;
433     UINT16                  mdl_id;
434     tBTA_HL_MDL_HANDLE      mdl_handle;
435     tBTA_HL_DCH_OPER        dch_oper;
436     BOOLEAN                 intentional_close;
437     tBTA_HL_DCH_STATE       dch_state;
438     UINT8                   abort_oper;
439     UINT16                  req_data_psm;
440     UINT16                  max_rx_apdu_size;
441     UINT16                  max_tx_apdu_size;
442     BT_HDR                  *p_tx_pkt;
443     BT_HDR                  *p_rx_pkt;
444     tBTA_HL_MDEP_ID         local_mdep_id;
445     UINT8                   local_mdep_cfg_idx;
446     tBTA_HL_DCH_CFG         local_cfg;
447     tBTA_HL_DCH_CFG         remote_cfg;
448     tBTA_HL_MDEP_ID         peer_mdep_id;
449     UINT16  peer_data_type;
450     tBTA_HL_MDEP_ROLE       peer_mdep_role;
451     tBTA_HL_DCH_MODE        dch_mode;
452     tBTA_SEC                sec_mask;
453     BOOLEAN                 is_the_first_reliable;
454     BOOLEAN                 delete_mdl;
455     UINT16                  mtu;
456     tMCA_CHNL_CFG           chnl_cfg;
457     BOOLEAN                 mdl_cfg_idx_included;
458     UINT8                   mdl_cfg_idx;
459     UINT8                   echo_oper;
460     BOOLEAN                 cong;
461     BOOLEAN                 close_pending;
462     UINT8                   cout_oper;
463     BT_HDR                  *p_echo_tx_pkt;
464     BT_HDR                  *p_echo_rx_pkt;
465     tBTA_HL_STATUS          ci_put_echo_data_status;
466 }tBTA_HL_MDL_CB;
467 
468 typedef struct
469 {
470     tBTA_HL_MDL_CB          mdl[BTA_HL_NUM_MDLS_PER_MCL];
471     tBTA_HL_DELETE_MDL      delete_mdl;
472     BOOLEAN                 in_use;
473     tBTA_HL_CCH_STATE       cch_state;
474     UINT16                  req_ctrl_psm;
475     UINT16                  ctrl_psm;
476     UINT16                  data_psm;
477     BD_ADDR                 bd_addr;
478     UINT16                  cch_mtu;
479     UINT16                  sec_mask;
480     tBTA_HL_MCL_HANDLE      mcl_handle;
481     tSDP_DISCOVERY_DB       *p_db;         /* pointer to discovery database */
482     tSDP_DISC_CMPL_CB       *sdp_cback;
483     tBTA_HL_SDP_OPER        sdp_oper;
484     BOOLEAN                 close_pending;
485     UINT8                   sdp_mdl_idx;
486     tBTA_HL_SDP             sdp;
487     UINT8                   cch_oper;
488     BOOLEAN                 intentional_close;
489     BOOLEAN                 rsp_tout;
490     UINT8                   timer_oper;
491     BOOLEAN                 echo_test;
492     UINT8                   echo_mdl_idx;
493     UINT8                   cch_close_dch_oper;
494 }tBTA_HL_MCL_CB;
495 
496 typedef struct
497 {
498     tBTA_HL_MCL_CB       mcb[BTA_HL_NUM_MCLS]; /* application Control Blocks */
499     tBTA_HL_CBACK        *p_cback;            /* pointer to control callback function */
500     BOOLEAN              in_use;              /* this CB is in use*/
501     BOOLEAN              deregistering;
502     UINT8                app_id;
503     UINT32               sdp_handle;    /* SDP record handle */
504     tBTA_HL_SUP_FEATURE  sup_feature;
505     tBTA_HL_MDL_CFG      mdl_cfg[BTA_HL_NUM_MDL_CFGS];
506     tBTA_HL_DEVICE_TYPE  dev_type;
507     tBTA_HL_APP_HANDLE   app_handle;
508     UINT16               ctrl_psm;   /* L2CAP PSM for the MCAP control channel */
509     UINT16               data_psm;   /* L2CAP PSM for the MCAP data channel */
510     UINT16               sec_mask;   /* Security mask for BTM_SetSecurityLevel() */
511 
512     char                 srv_name[BTA_SERVICE_NAME_LEN +1];        /* service name to be used in the SDP; null terminated*/
513     char                 srv_desp[BTA_SERVICE_DESP_LEN +1];        /* service description to be used in the SDP; null terminated */
514     char                 provider_name[BTA_PROVIDER_NAME_LEN +1];   /* provide name to be used in the SDP; null terminated */
515 
516     tMCA_CTRL_CBACK      *p_mcap_cback;            /* pointer to MCAP callback function */
517     tMCA_DATA_CBACK      *p_data_cback;
518 }tBTA_HL_APP_CB;
519 
520 
521 typedef struct
522 {
523     BOOLEAN             in_use;
524     tBTA_HL_SDP_OPER    sdp_oper;
525     UINT8               app_idx;
526     UINT8               mcl_idx;
527     UINT8               mdl_idx;
528 }tBTA_HL_SDP_CB;
529 
530 typedef struct
531 {
532     BOOLEAN         in_use;
533     UINT8           app_idx;
534     UINT8           mcl_idx;
535 }tBTA_HL_TIMER_CB;
536 
537 typedef struct
538 {
539     tBTA_HL_APP_CB        acb[BTA_HL_NUM_APPS];      /* HL Control Blocks */
540     tBTA_HL_CTRL_CBACK    *p_ctrl_cback;            /* pointer to control callback function */
541     BOOLEAN               enable;
542     BOOLEAN               disabling;
543 
544     tBTA_HL_SDP_CB        scb[BTA_HL_NUM_SDP_CBACKS];
545     tBTA_HL_TIMER_CB      tcb[BTA_HL_NUM_TIMERS];
546     BOOLEAN               enable_random_psm;
547     tBTA_HL_ALLOCATE_PSM  *p_alloc_psm;
548 }tBTA_HL_CB;
549 
550 /******************************************************************************
551 **  Configuration Definitions
552 *******************************************************************************/
553 /* Configuration structure */
554 
555 /*****************************************************************************
556 **  Global data
557 *****************************************************************************/
558 
559 /* HL control block */
560 #if BTA_DYNAMIC_MEMORY == FALSE
561 extern tBTA_HL_CB  bta_hl_cb;
562 #else
563 extern tBTA_HL_CB *bta_hl_cb_ptr;
564     #define bta_hl_cb (*bta_hl_cb_ptr)
565 #endif
566 
567 #define BTA_HL_GET_CB_PTR() &(bta_hl_cb)
568 #define BTA_HL_GET_APP_CB_PTR(app_idx) &(bta_hl_cb.acb[(app_idx)])
569 #define BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx) &(bta_hl_cb.acb[(app_idx)].mcb[(mcl_idx)])
570 #define BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx) &(bta_hl_cb.acb[(app_idx)].mcb[(mcl_idx)].mdl[mdl_idx])
571 #define BTA_HL_GET_MDL_CFG_PTR(app_idx, item_idx) &(bta_hl_cb.acb[(app_idx)].mdl_cfg[(item_idx)])
572 #define BTA_HL_GET_ECHO_CFG_PTR(app_idx)  &(bta_hl_cb.acb[(app_idx)].sup_feature.echo_cfg)
573 #define BTA_HL_GET_MDEP_CFG_PTR(app_idx, mdep_cfg_idx)  &(bta_hl_cb.acb[(app_idx)].sup_feature.mdep[mdep_cfg_idx].mdep_cfg)
574 #define BTA_HL_GET_DATA_CFG_PTR(app_idx, mdep_cfg_idx, data_cfg_idx)  \
575            &(bta_hl_cb.acb[(app_idx)].sup_feature.mdep[mdep_cfg_idx].mdep_cfg.data_cfg[data_cfg_idx])
576 #define BTA_HL_GET_BUF_PTR(p_pkt) ((UINT8 *)((UINT8 *) (p_pkt+1) + p_pkt->offset))
577 
578 /*****************************************************************************
579 **  Function prototypes
580 *****************************************************************************/
581 
582 #ifdef __cplusplus
583 extern "C"
584 {
585 #endif
586     /* main */
587     extern BOOLEAN bta_hl_hdl_event(BT_HDR *p_msg);
588     /* sdp */
589     extern BOOLEAN bta_hl_fill_sup_feature_list( const tSDP_DISC_ATTR  *p_attr,
590                                                  tBTA_HL_SUP_FEATURE_LIST_ELEM *p_list);
591 
592     extern tBTA_HL_STATUS bta_hl_sdp_register (UINT8 app_idx);
593     extern tSDP_DISC_REC *bta_hl_find_sink_or_src_srv_class_in_db (const tSDP_DISCOVERY_DB *p_db,
594                                                                    const tSDP_DISC_REC *p_start_rec);
595 
596     /* action routines */
597     extern void bta_hl_dch_ci_get_tx_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
598                                           tBTA_HL_DATA *p_data);
599     extern void bta_hl_dch_ci_put_rx_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
600                                           tBTA_HL_DATA *p_data);
601     extern void bta_hl_dch_ci_get_echo_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
602                                             tBTA_HL_DATA *p_data);
603 
604     extern void bta_hl_dch_echo_test(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
605                                      tBTA_HL_DATA *p_data);
606     extern void bta_hl_dch_ci_put_echo_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
607                                             tBTA_HL_DATA *p_data);
608     extern void bta_hl_dch_send_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
609                                      tBTA_HL_DATA *p_data);
610     extern void bta_hl_dch_sdp_fail(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
611                                     tBTA_HL_DATA *p_data);
612     extern void bta_hl_dch_mca_cong_change(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
613                                            tBTA_HL_DATA *p_data);
614     extern void bta_hl_dch_mca_reconnect_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
615                                              tBTA_HL_DATA *p_data);
616     extern void bta_hl_dch_mca_reconnect_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
617                                              tBTA_HL_DATA *p_data);
618     extern void bta_hl_dch_mca_reconnect(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
619                                          tBTA_HL_DATA *p_data);
620     extern void bta_hl_dch_sdp_init(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
621                                     tBTA_HL_DATA *p_data);
622     extern void bta_hl_dch_close_echo_test(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
623                                            tBTA_HL_DATA *p_data);
624     extern void bta_hl_dch_create_rsp(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
625                                       tBTA_HL_DATA *p_data);
626     extern void bta_hl_dch_mca_rcv_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
627                                         tBTA_HL_DATA *p_data);
628     extern void bta_hl_dch_close_cmpl(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
629                                       tBTA_HL_DATA *p_data);
630     extern void bta_hl_dch_mca_close_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
631                                          tBTA_HL_DATA *p_data);
632     extern void bta_hl_dch_mca_close_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
633                                          tBTA_HL_DATA *p_data);
634     extern void bta_hl_dch_mca_close(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
635                                      tBTA_HL_DATA *p_data);
636     extern void bta_hl_dch_mca_delete_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
637                                           tBTA_HL_DATA *p_data);
638 
639     extern void bta_hl_dch_mca_delete_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
640                                           tBTA_HL_DATA *p_data);
641     extern void bta_hl_dch_mca_delete(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
642                                       tBTA_HL_DATA *p_data);
643     extern void bta_hl_dch_mca_abort_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
644                                          tBTA_HL_DATA *p_data);
645     extern void bta_hl_dch_mca_abort_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
646                                          tBTA_HL_DATA *p_data);
647     extern void bta_hl_dch_mca_abort(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
648                                      tBTA_HL_DATA *p_data);
649     extern void bta_hl_dch_mca_open_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
650                                         tBTA_HL_DATA *p_data);
651     extern void bta_hl_dch_mca_open_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
652                                         tBTA_HL_DATA *p_data);
653     extern void bta_hl_dch_mca_create_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
654                                           tBTA_HL_DATA *p_data);
655     extern void bta_hl_dch_mca_create_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
656                                           tBTA_HL_DATA *p_data);
657     extern void bta_hl_dch_mca_create(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
658                                       tBTA_HL_DATA *p_data);
659     extern void bta_hl_deallocate_spd_cback(UINT8 sdp_cback_idx);
660     extern tSDP_DISC_CMPL_CB *bta_hl_allocate_spd_cback(tBTA_HL_SDP_OPER sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
661                                                         UINT8 mdl_idx,
662                                                         UINT8 *p_sdp_cback_idx);
663     extern tBTA_HL_STATUS bta_hl_init_sdp(tBTA_HL_SDP_OPER sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
664                                           UINT8 mdl_idx);
665     extern void bta_hl_cch_sdp_init(UINT8 app_idx, UINT8 mcl_idx,  tBTA_HL_DATA *p_data);
666     extern void bta_hl_cch_mca_open(UINT8 app_idx, UINT8 mcl_idx,  tBTA_HL_DATA *p_data);
667     extern void bta_hl_cch_mca_close(UINT8 app_idx, UINT8 mcl_idx,  tBTA_HL_DATA *p_data);
668     extern void bta_hl_cch_close_cmpl(UINT8 app_idx, UINT8 mcl_idx,  tBTA_HL_DATA *p_data);
669     extern void bta_hl_cch_mca_disconnect(UINT8 app_idx, UINT8 mcl_idx,  tBTA_HL_DATA *p_data);
670     extern void bta_hl_cch_mca_rsp_tout(UINT8 app_idx, UINT8 mcl_idx,  tBTA_HL_DATA *p_data);
671     extern void bta_hl_cch_mca_connect(UINT8 app_idx, UINT8 mcl_idx,  tBTA_HL_DATA *p_data);
672 
673     /* State machine drivers  */
674     extern void bta_hl_cch_sm_execute(UINT8 inst_idx, UINT8 mcl_idx,
675                                       UINT16 event, tBTA_HL_DATA *p_data);
676     extern void bta_hl_dch_sm_execute(UINT8 inst_idx, UINT8 mcl_idx, UINT8 mdl_idx,
677                                       UINT16 event, tBTA_HL_DATA *p_data);
678     /* MCAP callback functions  */
679     extern void bta_hl_mcap_ctrl_cback(tMCA_HANDLE handle, tMCA_CL mcl, UINT8 event,
680                                        tMCA_CTRL *p_data);
681 
682     extern void bta_hl_mcap_data_cback(tMCA_DL mdl, BT_HDR *p_pkt);
683 
684     /* utility functions  */
685     extern BOOLEAN bta_hl_set_ctrl_psm_for_dch(UINT8 app_idx, UINT8 mcl_idx,
686                                                UINT8 mdl_idx, UINT16 ctrl_psm);
687     extern BOOLEAN bta_hl_find_sdp_idx_using_ctrl_psm(tBTA_HL_SDP *p_sdp,
688                                                       UINT16 ctrl_psm,
689                                                       UINT8 *p_sdp_idx);
690     extern UINT8 bta_hl_set_user_tx_pool_id(UINT16 max_tx_size);
691     extern UINT8 bta_hl_set_user_rx_pool_id(UINT16 mtu);
692     extern UINT8 bta_hl_set_tx_win_size(UINT16 mtu, UINT16 mps);
693     extern UINT16 bta_hl_set_mps(UINT16 mtu);
694     extern void bta_hl_clean_mdl_cb(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx);
695     extern BT_HDR * bta_hl_get_buf(UINT16 data_size);
696     extern BOOLEAN bta_hl_find_service_in_db( UINT8 app_idx, UINT8 mcl_idx,
697                                               UINT16 service_uuid,
698                                               tSDP_DISC_REC **pp_rec );
699     extern UINT16 bta_hl_get_service_uuids(UINT8 sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
700                                            UINT8 mdl_idx );
701     extern BOOLEAN bta_hl_find_echo_cfg_rsp(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdep_idx, UINT8 cfg,
702                                             UINT8 *p_cfg_rsp);
703     extern BOOLEAN bta_hl_validate_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
704                                        UINT8 cfg);
705     extern BOOLEAN bta_hl_find_cch_cb_indexes(tBTA_HL_DATA *p_msg,
706                                               UINT8 *p_app_idx,
707                                               UINT8  *p_mcl_idx);
708     extern BOOLEAN bta_hl_find_dch_cb_indexes(tBTA_HL_DATA *p_msg,
709                                               UINT8 *p_app_idx,
710                                               UINT8 *p_mcl_idx,
711                                               UINT8 *p_mdl_idx);
712     extern UINT16  bta_hl_allocate_mdl_id(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx );
713     extern BOOLEAN bta_hl_find_mdl_idx_using_handle(tBTA_HL_MDL_HANDLE mdl_handle,
714                                                     UINT8 *p_app_idx, UINT8 *p_mcl_idx,
715                                                     UINT8 *p_mdl_idx);
716     extern BOOLEAN bta_hl_find_mdl_idx(UINT8 app_idx, UINT8 mcl_idx, UINT16 mdl_id,
717                                        UINT8 *p_mdl_idx);
718     extern BOOLEAN bta_hl_find_an_active_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
719                                                  UINT8 *p_mdl_idx);
720     extern BOOLEAN bta_hl_find_dch_setup_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
721                                                  UINT8 *p_mdl_idx);
722     extern BOOLEAN bta_hl_find_an_in_use_mcl_idx(UINT8 app_idx,
723                                                  UINT8 *p_mcl_idx);
724     extern BOOLEAN bta_hl_find_an_in_use_app_idx(UINT8 *p_app_idx);
725     extern BOOLEAN bta_hl_find_app_idx(UINT8 app_id, UINT8 *p_app_idx);
726     extern BOOLEAN bta_hl_find_app_idx_using_handle(tBTA_HL_APP_HANDLE app_handle,
727                                                     UINT8 *p_app_idx);
728     extern BOOLEAN bta_hl_find_mcl_idx_using_handle( tBTA_HL_MCL_HANDLE mcl_handle,
729                                                      UINT8 *p_app_idx, UINT8 *p_mcl_idx);
730     extern BOOLEAN bta_hl_find_mcl_idx(UINT8 app_idx, BD_ADDR p_bd_addr, UINT8 *p_mcl_idx);
731     extern BOOLEAN bta_hl_is_the_first_reliable_existed(UINT8 app_idx, UINT8 mcl_idx );
732     extern BOOLEAN  bta_hl_find_non_active_mdl_cfg(UINT8 app_idx, UINT8 start_mdl_cfg_idx,
733                                                    UINT8 *p_mdl_cfg_idx);
734     extern BOOLEAN  bta_hl_find_avail_mdl_cfg_idx(UINT8 app_idx, UINT8 mcl_idx,
735                                                   UINT8 *p_mdl_cfg_idx);
736     extern BOOLEAN  bta_hl_find_mdl_cfg_idx(UINT8 app_idx, UINT8 mcl_idx,
737                                             tBTA_HL_MDL_ID mdl_id, UINT8 *p_mdl_cfg_idx);
738     extern BOOLEAN  bta_hl_get_cur_time(UINT8 app_idx, UINT8 *p_cur_time);
739     extern void bta_hl_sort_cfg_time_idx(UINT8 app_idx, UINT8 *a, UINT8 n);
740     extern void  bta_hl_compact_mdl_cfg_time(UINT8 app_idx);
741     extern BOOLEAN  bta_hl_is_mdl_exsit_in_mcl(UINT8 app_idx, BD_ADDR bd_addr,
742                                                tBTA_HL_MDL_ID mdl_id);
743     extern BOOLEAN  bta_hl_delete_mdl_cfg(UINT8 app_idx, BD_ADDR bd_addr,
744                                           tBTA_HL_MDL_ID mdl_id);
745     extern BOOLEAN  bta_hl_is_mdl_value_valid(tBTA_HL_MDL_ID mdl_id);
746     extern BOOLEAN bta_hl_find_mdep_cfg_idx(UINT8 app_idx,
747                                             tBTA_HL_MDEP_ID local_mdep_id, UINT8 *p_mdep_cfg_idx);
748     extern void bta_hl_find_rxtx_apdu_size(UINT8 app_idx, UINT8 mdep_cfg_idx,
749                                            UINT16 *p_rx_apu_size,
750                                            UINT16 *p_tx_apu_size);
751     extern BOOLEAN bta_hl_validate_peer_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
752                                             tBTA_HL_MDEP_ID peer_mdep_id,
753                                             tBTA_HL_MDEP_ROLE peer_mdep_role,
754                                             UINT8 sdp_idx);
755     extern tBTA_HL_STATUS bta_hl_chk_local_cfg(UINT8 app_idx, UINT8 mcl_idx,
756                                                UINT8 mdep_cfg_idx,
757                                                tBTA_HL_DCH_CFG local_cfg);
758 
759     extern BOOLEAN bta_hl_validate_reconnect_params(UINT8 app_idx, UINT8 mcl_idx,
760                                                     tBTA_HL_API_DCH_RECONNECT *p_reconnect,
761                                                     UINT8 *p_mdep_cfg_idx, UINT8 *p_mdl_cfg_idx);
762     extern BOOLEAN bta_hl_find_avail_mcl_idx(UINT8 app_idx, UINT8 *p_mcl_idx);
763     extern BOOLEAN bta_hl_find_avail_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
764                                              UINT8 *p_mdl_idx);
765     extern BOOLEAN bta_hl_is_a_duplicate_id(UINT8 app_id);
766     extern BOOLEAN bta_hl_find_avail_app_idx(UINT8 *p_idx);
767     extern tBTA_HL_STATUS bta_hl_app_registration(UINT8 app_idx);
768     extern void bta_hl_discard_data(UINT16 event, tBTA_HL_DATA *p_data);
769     extern void bta_hl_save_mdl_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx );
770     extern void bta_hl_set_dch_chan_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx, tBTA_HL_DATA *p_data);
771     extern BOOLEAN bta_hl_get_l2cap_cfg(tBTA_HL_MDL_HANDLE mdl_hnd, tBTA_HL_L2CAP_CFG_INFO *p_cfg);
772     extern BOOLEAN bta_hl_validate_chan_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx);
773     extern BOOLEAN bta_hl_is_cong_on(UINT8 app_id, BD_ADDR bd_addr, tBTA_HL_MDL_ID mdl_id);
774     extern void bta_hl_check_cch_close(UINT8 app_idx, UINT8 mcl_idx,
775                                        tBTA_HL_DATA *p_data, BOOLEAN check_dch_setup);
776     extern void bta_hl_clean_app(UINT8 app_idx);
777     extern void bta_hl_check_deregistration(UINT8 app_idx, tBTA_HL_DATA *p_data );
778     extern void bta_hl_check_disable(tBTA_HL_DATA *p_data );
779     extern void  bta_hl_build_abort_ind(tBTA_HL *p_evt_data,
780                                         tBTA_HL_APP_HANDLE app_handle,
781                                         tBTA_HL_MCL_HANDLE mcl_handle);
782     extern void  bta_hl_build_abort_cfm(tBTA_HL *p_evt_data,
783                                         tBTA_HL_APP_HANDLE app_handle,
784                                         tBTA_HL_MCL_HANDLE mcl_handle,
785                                         tBTA_HL_STATUS status);
786     extern void  bta_hl_build_dch_close_cfm(tBTA_HL *p_evt_data,
787                                             tBTA_HL_APP_HANDLE app_handle,
788                                             tBTA_HL_MCL_HANDLE mcl_handle,
789                                             tBTA_HL_MDL_HANDLE mdl_handle,
790                                             tBTA_HL_STATUS status);
791     extern void  bta_hl_build_dch_close_ind(tBTA_HL *p_evt_data,
792                                             tBTA_HL_APP_HANDLE app_handle,
793                                             tBTA_HL_MCL_HANDLE mcl_handle,
794                                             tBTA_HL_MDL_HANDLE mdl_handle,
795                                             BOOLEAN intentional);
796     extern void  bta_hl_build_send_data_cfm(tBTA_HL *p_evt_data,
797                                             tBTA_HL_APP_HANDLE app_handle,
798                                             tBTA_HL_MCL_HANDLE mcl_handle,
799                                             tBTA_HL_MDL_HANDLE mdl_handle,
800                                             tBTA_HL_STATUS status );
801     extern void  bta_hl_build_rcv_data_ind(tBTA_HL *p_evt_data,
802                                            tBTA_HL_APP_HANDLE app_handle,
803                                            tBTA_HL_MCL_HANDLE mcl_handle,
804                                            tBTA_HL_MDL_HANDLE mdl_handle);
805     extern void  bta_hl_build_cch_open_cfm(tBTA_HL *p_evt_data,
806                                            tBTA_HL_APP_HANDLE app_handle,
807                                            tBTA_HL_MCL_HANDLE mcl_handle,
808                                            BD_ADDR bd_addr,
809                                            tBTA_HL_STATUS status );
810     extern void  bta_hl_build_cch_open_ind(tBTA_HL *p_evt_data,
811                                            tBTA_HL_APP_HANDLE app_handle,
812                                            tBTA_HL_MCL_HANDLE mcl_handle,
813                                            BD_ADDR bd_addr);
814     extern void  bta_hl_build_cch_close_cfm(tBTA_HL *p_evt_data,
815                                             tBTA_HL_APP_HANDLE app_handle,
816                                             tBTA_HL_MCL_HANDLE mcl_handle,
817                                             tBTA_HL_STATUS status );
818     extern void   bta_hl_build_cch_close_ind(tBTA_HL *p_evt_data,
819                                              tBTA_HL_APP_HANDLE app_handle,
820                                              tBTA_HL_MCL_HANDLE mcl_handle,
821                                              BOOLEAN intentional);
822 
823     extern void  bta_hl_build_dch_open_cfm(tBTA_HL *p_evt_data,
824                                            tBTA_HL_APP_HANDLE app_handle,
825                                            tBTA_HL_MCL_HANDLE mcl_handle,
826                                            tBTA_HL_MDL_HANDLE mdl_handle,
827                                            tBTA_HL_MDEP_ID local_mdep_id,
828                                            tBTA_HL_MDL_ID mdl_id,
829                                            tBTA_HL_DCH_MODE dch_mode,
830                                            BOOLEAN first_reliable,
831                                            UINT16 mtu,
832                                            tBTA_HL_STATUS status);
833 
834     extern void  bta_hl_build_delete_mdl_cfm(tBTA_HL *p_evt_data,
835                                              tBTA_HL_APP_HANDLE app_handle,
836                                              tBTA_HL_MCL_HANDLE mcl_handle,
837                                              tBTA_HL_MDL_ID mdl_id,
838                                              tBTA_HL_STATUS status);
839     extern void  bta_hl_build_echo_test_cfm(tBTA_HL *p_evt_data,
840                                             tBTA_HL_APP_HANDLE app_handle,
841                                             tBTA_HL_MCL_HANDLE mcl_handle,
842                                             tBTA_HL_STATUS status );
843     extern void  bta_hl_build_sdp_query_cfm(tBTA_HL *p_evt_data,
844                                             tBTA_HL_APP_HANDLE app_handle,
845                                             BD_ADDR bd_addr,
846                                             tBTA_HL_SDP *p_sdp,
847                                             tBTA_HL_STATUS status);
848 
849 #if (BTA_HL_DEBUG == TRUE)
850     extern  char *bta_hl_status_code(tBTA_HL_STATUS status);
851     extern char *bta_hl_evt_code(tBTA_HL_INT_EVT evt_code);
852 #endif
853 #ifdef __cplusplus
854 }
855 #endif
856 #endif /* BTA_MSE_INT_H */
857 
858 
859