1 /****************************************************************************** 2 * 3 * Copyright (C) 1999-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 file contains the main Bluetooth Upper Layer definitions. The Broadcom 22 * implementations of L2CAP RFCOMM, SDP and the BTIf run as one GKI task. The 23 * btu_task switches between them. 24 * 25 ******************************************************************************/ 26 27 #ifndef BTU_H 28 #define BTU_H 29 30 #include "bt_target.h" 31 #include "bt_common.h" 32 #include "osi/include/alarm.h" 33 34 // HACK(zachoverflow): temporary dark magic 35 #define BTU_POST_TO_TASK_NO_GOOD_HORRIBLE_HACK 0x1700 // didn't look used in bt_types...here goes nothing 36 typedef struct { 37 void (*callback)(BT_HDR *); 38 } post_to_task_hack_t; 39 40 typedef struct { 41 void (*callback)(BT_HDR *); 42 BT_HDR *response; 43 void *context; 44 } command_complete_hack_t; 45 46 typedef struct { 47 void (*callback)(BT_HDR *); 48 uint8_t status; 49 BT_HDR *command; 50 void *context; 51 } command_status_hack_t; 52 53 54 #ifdef __cplusplus 55 extern "C" { 56 #endif 57 58 /* Global BTU data */ 59 extern uint8_t btu_trace_level; 60 61 extern const BD_ADDR BT_BD_ANY; 62 63 /* Functions provided by btu_task.c 64 ************************************ 65 */ 66 67 #if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE) 68 extern void btu_check_bt_sleep (void); 69 #endif 70 71 /* Functions provided by btu_hcif.c 72 ************************************ 73 */ 74 extern void btu_hcif_process_event (UINT8 controller_id, BT_HDR *p_buf); 75 extern void btu_hcif_send_cmd (UINT8 controller_id, BT_HDR *p_msg); 76 77 /* Functions provided by btu_core.c 78 ************************************ 79 */ 80 extern void btu_init_core(void); 81 extern void btu_free_core(void); 82 83 void BTU_StartUp(void); 84 void BTU_ShutDown(void); 85 86 #ifdef __cplusplus 87 } 88 #endif 89 90 #endif 91