1 /******************************************************************************
2  *
3  *  Copyright 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 <base/callback.h>
31 #include <base/location.h>
32 #include <base/threading/thread.h>
33 #include "bt_common.h"
34 #include "bt_target.h"
35 #include "osi/include/alarm.h"
36 
37 /* Global BTU data */
38 extern uint8_t btu_trace_level;
39 
40 /* Functions provided by btu_hcif.cc
41  ***********************************
42 */
43 void btu_hcif_process_event(uint8_t controller_id, BT_HDR* p_buf);
44 void btu_hcif_send_cmd(uint8_t controller_id, BT_HDR* p_msg);
45 void btu_hcif_send_cmd_with_cb(const tracked_objects::Location& posted_from,
46                                uint16_t opcode, uint8_t* params,
47                                uint8_t params_len,
48                                base::Callback<void(uint8_t*, uint16_t)> cb);
49 
50 /* Functions provided by btu_init.cc
51  ***********************************
52 */
53 void btu_init_core(void);
54 void btu_free_core(void);
55 
56 /* Functions provided by btu_task.cc
57  ***********************************
58 */
59 base::MessageLoop* get_message_loop();
60 
61 void BTU_StartUp(void);
62 void BTU_ShutDown(void);
63 
64 #endif
65