MT2523 API Reference  LinkIt SDK v4
bt_system.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __BT_SYSTEM_H__
36 #define __BT_SYSTEM_H__
37 
38 #include "bt_platform.h"
39 #include "bt_type.h"
40 
41 BT_EXTERN_C_BEGIN
42 
100 /* -------------- The buffer size of a single control block. --------------------- */
101 #define BT_CONTROL_BLOCK_SIZE_OF_TIMER (20)
102 #define BT_CONTROL_BLOCK_SIZE_OF_LE_CONNECTION (100)
103 #define BT_CONTROL_BLOCK_SIZE_OF_EDR_CONNECTION (56)
104 #define BT_CONTROL_BLOCK_SIZE_OF_RFCOMM (48)
105 #define BT_CONTROL_BLOCK_SIZE_OF_HFP (76)
106 #define BT_CONTROL_BLOCK_SIZE_OF_AVRCP (44)
107 #define BT_CONTROL_BLOCK_SIZE_OF_A2DP_SEP (16)
108 #define BT_CONTROL_BLOCK_SIZE_OF_A2DP (132)
109 #define BT_CONTROL_BLOCK_SIZE_OF_PBAPC (100)
110 #define BT_CONTROL_BLOCK_SIZE_OF_SPP (44)
111 #define BT_CONTROL_BLOCK_SIZE_OF_AWS (100)
112 #define BT_CONTROL_BLOCK_SIZE_OF_GATT (32)
117 typedef enum {
132 
137 typedef enum {
141 
142 #define BT_MEMORY_TX_BUFFER_AVAILABLE_IND (BT_MODULE_MM | 0x00010000)
158 typedef struct {
159  uint32_t size;
161 
172 void bt_memory_init_packet(bt_memory_packet_t type, char *buf, uint32_t size);
180 void bt_memory_init_control_block(bt_memory_control_block_t type, char *buf, uint32_t size);
181 
252 #define BT_PANIC (BT_MODULE_SYSTEM | 0x0003)
258 #define BT_PANIC_SOURCE_HOST 0
259 #define BT_PANIC_SOURCE_CONTROLLER 1
275 typedef struct {
276  uint8_t source;
277 } bt_panic_t;
278 
330 #define BT_POWER_ON_CNF (BT_MODULE_SYSTEM | 0x0001)
331 #define BT_POWER_OFF_CNF (BT_MODULE_SYSTEM | 0x0002)
346 typedef struct {
349 
366 bt_status_t bt_power_on(bt_bd_addr_ptr_t public_addr, bt_bd_addr_ptr_t random_addr);
367 
376 
385 
391 BT_EXTERN_C_END
392 
393 #endif
394 
AVRCP.
Definition: bt_system.h:122
const bt_bd_addr_t local_public_addr
The local public address of the device.
Definition: bt_system.h:347
A2DP.
Definition: bt_system.h:125
RFCOMM.
Definition: bt_system.h:121
void bt_memory_init_control_block(bt_memory_control_block_t type, char *buf, uint32_t size)
This function initializes a control block buffer for the Bluetooth stack.
bt_status_t bt_power_on(bt_bd_addr_ptr_t public_addr, bt_bd_addr_ptr_t random_addr)
This function powers on the Bluetooth.
uint32_t size
The size of available TX buffer in bytes.
Definition: bt_system.h:159
uint8_t const * bt_bd_addr_ptr_t
A pointer to the bt_bd_addr_t.
Definition: bt_type.h:181
BR/EDR connection.
Definition: bt_system.h:120
uint8_t source
The source for the panic, such as BT_PANIC_SOURCE_HOST or BT_PANIC_SOURCE_CONTROLLER.
Definition: bt_system.h:276
bt_memory_control_block_t
Bluetooth memory control block types.
Definition: bt_system.h:117
GATT.
Definition: bt_system.h:129
Bluetooth LE connection.
Definition: bt_system.h:119
TX buffer availability indication.
Definition: bt_system.h:158
SPP.
Definition: bt_system.h:127
bt_status_t bt_power_off(void)
This function powers off the Bluetooth.
uint32_t bt_msg_type_t
Define the message type.
Definition: bt_type.h:130
PBAPC.
Definition: bt_system.h:123
AWS.
Definition: bt_system.h:128
the Bluetooth panic event parameter.
Definition: bt_system.h:275
HFP.
Definition: bt_system.h:126
Timer.
Definition: bt_system.h:118
uint8_t bt_bd_addr_t[6]
Address type, defined in Bluetooth core specification version 4.2.
Definition: bt_type.h:180
RX packet buffer.
Definition: bt_system.h:139
int32_t bt_status_t
Define the status type, returned from the APIs, and defined as BT_STATUS_XXX.
Definition: bt_type.h:173
A2DP SEP.
Definition: bt_system.h:124
bt_status_t bt_app_event_callback(bt_msg_type_t msg, bt_status_t status, void *buf)
This function is a static callback for the application to listen to the event.
Power on confirmation structure.
Definition: bt_system.h:346
void bt_memory_init_packet(bt_memory_packet_t type, char *buf, uint32_t size)
This function initializes a TX/RX packet buffer for the Bluetooth stack.
bt_memory_packet_t
Bluetooth memory buffer types for the Memory Management module.
Definition: bt_system.h:137
The total number of memory control block types.
Definition: bt_system.h:130
TX packet buffer.
Definition: bt_system.h:138