1 /****************************************************************************** 2 * 3 * Copyright (C) 2000-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 module contains the routines that initialize the stack components. 22 * It must be called before the BTU task is started. 23 * 24 ******************************************************************************/ 25 26 #include <string.h> 27 #include "bt_target.h" 28 29 #ifndef BTA_INCLUDED 30 #define BTA_INCLUDED FALSE 31 #endif 32 33 #include "bte.h" 34 35 /* Include initialization functions definitions */ 36 #include "port_api.h" 37 38 #if (BNEP_INCLUDED == TRUE) 39 #include "bnep_api.h" 40 #endif 41 42 #include "gap_api.h" 43 44 #if (PAN_INCLUDED == TRUE) 45 #include "pan_api.h" 46 #endif 47 48 #include "avrc_api.h" 49 50 #if (A2D_INCLUDED == TRUE) 51 #include "a2dp_api.h" 52 #endif 53 54 #if (HID_HOST_INCLUDED == TRUE) 55 #include "hidh_api.h" 56 #endif 57 58 #if (MCA_INCLUDED == TRUE) 59 #include "mca_api.h" 60 #endif 61 62 #include "gatt_api.h" 63 #include "smp_api.h" 64 65 /***************************************************************************** 66 * F U N C T I O N S * 67 *****************************************************************************/ 68 69 /***************************************************************************** 70 * 71 * Function BTE_InitStack 72 * 73 * Description Initialize control block memory for each component. 74 * 75 * Note: The core stack components must be called 76 * before creating the BTU Task. The rest of the 77 * components can be initialized at a later time if desired 78 * as long as the component's init function is called 79 * before accessing any of its functions. 80 * 81 * Returns void 82 * 83 *****************************************************************************/ BTE_InitStack(void)84void BTE_InitStack(void) { 85 /* Initialize the optional stack components */ 86 RFCOMM_Init(); 87 88 /************************** 89 * BNEP and its profiles ** 90 **************************/ 91 #if (BNEP_INCLUDED == TRUE) 92 BNEP_Init(); 93 94 #if (PAN_INCLUDED == TRUE) 95 PAN_Init(); 96 #endif /* PAN */ 97 #endif /* BNEP Included */ 98 99 /************************** 100 * AVDT and its profiles ** 101 **************************/ 102 #if (A2D_INCLUDED == TRUE) 103 A2DP_Init(); 104 #endif /* AADP */ 105 106 AVRC_Init(); 107 108 /*********** 109 * Others ** 110 ***********/ 111 GAP_Init(); 112 113 #if (HID_HOST_INCLUDED == TRUE) 114 HID_HostInit(); 115 #endif 116 117 #if (MCA_INCLUDED == TRUE) 118 MCA_Init(); 119 #endif 120 } 121