blob: 7addb18e7fee19d333a3726d244690fe26ca02a3 [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
Jakub Pawlowski5b790fe2017-09-18 09:00:20 -07003 * Copyright 2000-2012 Broadcom Corporation
The Android Open Source Project5738f832012-12-12 16:00:35 -08004 *
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 *
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -070021 * This module contains the routines that initialize the stack components.
The Android Open Source Project5738f832012-12-12 16:00:35 -080022 * It must be called before the BTU task is started.
23 *
24 ******************************************************************************/
25
The Android Open Source Project5738f832012-12-12 16:00:35 -080026#include <string.h>
Myles Watson911d1ae2016-11-28 16:44:40 -080027#include "bt_target.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080028
Pavlin Radoslavovb2a292b2016-10-14 19:34:48 -070029#include "bte.h"
30
The Android Open Source Project5738f832012-12-12 16:00:35 -080031/* Include initialization functions definitions */
The Android Open Source Project5738f832012-12-12 16:00:35 -080032#include "port_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080033
Marie Janssend19e0782016-07-15 12:48:27 -070034#if (BNEP_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080035#include "bnep_api.h"
36#endif
37
The Android Open Source Project5738f832012-12-12 16:00:35 -080038#include "gap_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080039
Marie Janssend19e0782016-07-15 12:48:27 -070040#if (PAN_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080041#include "pan_api.h"
42#endif
43
The Android Open Source Project5738f832012-12-12 16:00:35 -080044#include "avrc_api.h"
Pavlin Radoslavovf66f4e92016-10-14 15:14:37 -070045#include "a2dp_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080046
Marie Janssend19e0782016-07-15 12:48:27 -070047#if (HID_HOST_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080048#include "hidh_api.h"
49#endif
50
The Android Open Source Project5738f832012-12-12 16:00:35 -080051#include "gatt_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080052#include "smp_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080053
The Android Open Source Project5738f832012-12-12 16:00:35 -080054/*****************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -080055 * F U N C T I O N S *
56 *****************************************************************************/
The Android Open Source Project5738f832012-12-12 16:00:35 -080057
58/*****************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -080059 *
60 * Function BTE_InitStack
61 *
62 * Description Initialize control block memory for each component.
63 *
64 * Note: The core stack components must be called
65 * before creating the BTU Task. The rest of the
66 * components can be initialized at a later time if desired
67 * as long as the component's init function is called
68 * before accessing any of its functions.
69 *
70 * Returns void
71 *
72 *****************************************************************************/
Myles Watson911d1ae2016-11-28 16:44:40 -080073void BTE_InitStack(void) {
74 /* Initialize the optional stack components */
75 RFCOMM_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -080076
The Android Open Source Project5738f832012-12-12 16:00:35 -080077/**************************
Myles Watsonee96a3c2016-11-23 14:49:54 -080078 * BNEP and its profiles **
79 **************************/
Marie Janssend19e0782016-07-15 12:48:27 -070080#if (BNEP_INCLUDED == TRUE)
Myles Watson911d1ae2016-11-28 16:44:40 -080081 BNEP_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -080082
Marie Janssend19e0782016-07-15 12:48:27 -070083#if (PAN_INCLUDED == TRUE)
Myles Watson911d1ae2016-11-28 16:44:40 -080084 PAN_Init();
85#endif /* PAN */
86#endif /* BNEP Included */
The Android Open Source Project5738f832012-12-12 16:00:35 -080087
88/**************************
Myles Watsonee96a3c2016-11-23 14:49:54 -080089 * AVDT and its profiles **
90 **************************/
Myles Watson911d1ae2016-11-28 16:44:40 -080091 A2DP_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -080092
Myles Watson911d1ae2016-11-28 16:44:40 -080093 AVRC_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -080094
Myles Watson911d1ae2016-11-28 16:44:40 -080095 /***********
96 * Others **
97 ***********/
98 GAP_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -080099
Marie Janssend19e0782016-07-15 12:48:27 -0700100#if (HID_HOST_INCLUDED == TRUE)
Myles Watson911d1ae2016-11-28 16:44:40 -0800101 HID_HostInit();
The Android Open Source Project5738f832012-12-12 16:00:35 -0800102#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800103}