ble.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file ble.h
5 *
6 * @brief include all ble sdk header files
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup BLE
40 * @{
41 */
42
43 /**
44 @addtogroup BLE_COMMEN BLE Common
45 @{
46 @brief BLE Common interface.
47 */
48
49 #ifndef __BLE_H__
50 #define __BLE_H__
51
52 #include "ble_att.h"
53 #include "ble_error.h"
54 #include "ble_gapc.h"
55 #include "ble_gapm.h"
56 #include "ble_gatt.h"
57 #include "ble_gattc.h"
58 #include "ble_gatts.h"
59 #include "ble_l2cap.h"
60 #include "ble_prf.h"
61 #include "ble_sec.h"
62 #include "ble_event.h"
63 #include <stdio.h>
64
65 /** @addtogroup BLE_COMMEN_ENUM Enumerations
66 * @{
67 */
68
69 /**
70 * @brief RF TX mode.
71 */
72 typedef enum
73 {
74 BLE_RF_TX_MODE_INVALID = 0,
75 BLE_RF_TX_MODE_LP_MODE = 1,
76 BLE_RF_TX_MODE_HP_MODE = 2,
77 } ble_rf_tx_mode_t;
78
79 /**
80 * @brief RF TX type.
81 */
82 typedef enum
83 {
84 BLE_RF_TEST_TYPE_MODEM = 0,
85 BLE_RF_TEST_TYPE_SINGLE_CARRIER = 1,
86 } ble_rf_test_type_t;
87
88 /**
89 * @brief The resistance value (ohm) of the RF match circuit.
90 */
91 typedef enum
92 {
93 BLE_RF_5TH_MATCH_CIRCUIT = 0,
94 BLE_RF_3TH_MATCH_CIRCUIT = 1,
95 } ble_rf_match_circuit_t;
96
97 /**
98 ****************************************************************************************
99 * @brief Call back definition of the function that can handle result of an AES based algorithm
100 *
101 * @param[in] status Execution status
102 * @param[in] aes_res 16 bytes block result
103 * @param[in] src_info Information provided by requester
104 ****************************************************************************************
105 */
106 typedef void (*aes_result_cb) (uint8_t status, const uint8_t* aes_res, uint32_t src_info);
107
108 /**@brief Receive controller pachet callback type. */
109 typedef void (*ble_hci_host_recv_cb_t)(uint8_t *p_data, uint16_t length);
110
111 /** @} */
112
113 /** @addtogroup BLE_COMMEN_STRUCTURES Structures
114 * @{
115 */
116
117 /**@brief The table contains the pointers to four arrays which are used
118 * as heap memory by BLE stack in ROM. The size of four arrays depends on
119 * the number of connections and the number of attributes of profiles. */
120 typedef struct
121 {
122 uint32_t *env_ret; /**< Pointer to the array for environment heap */
123 uint32_t *db_ret; /**< Pointer to the array for ATT DB heap */
124 uint32_t *msg_ret; /**< Pointer to the array for message heap */
125 uint32_t *non_ret; /**< Pointer to the array for non-retention heap */
126 uint32_t env_ret_size; /**< The size of the array for environment heap */
127 uint32_t db_ret_size; /**< The size of the array for ATT DB heap */
128 uint32_t msg_ret_size; /**< The size of the array for message heap */
129 uint32_t non_ret_size; /**< The size of the array for non-retention heap */
130 uint8_t *prf_buf; /**< Pointer to the array for profile heap */
131 uint32_t buf_size; /**< The size of the array for profile heap */
132 uint8_t *bm_buf; /**< Pointer to the array for bond manager heap */
133 uint32_t bm_size; /**< The size of the array for bond manager heap */
134 uint8_t *conn_buf; /**< Pointer to the array for connection heap */
135 uint32_t conn_size; /**< The size of the array for connection heap */
136
137 uint16_t em_ble_act_num; /**< The number of ble maxium activities */
138 uint16_t em_ble_ral_num; /**< The number of ble maxium resolvable address list */
139 uint16_t em_ble_adv_buf_nb_tx; /**< The number of advertising data buffers */
140 uint16_t em_ble_adv_frag_nb_tx; /**< The number of advertising or scan response data fragments in extended advertising PDU chain */
141 uint16_t em_common_offset; /**< Start offset of the common EM part */
142 uint32_t ram_size; /**< ram size */
143 } stack_heaps_table_t;
144
145 /**@brief BLE HCI RX Channel (Host send packet to controller). */
146 typedef struct
147 {
148 uint8_t *p_channel; /**< Pointer to buffer for controller receive cache. */
149 uint16_t cache_size; /**< Size of the cache buffer. */
150 } ble_hci_rx_channel_t;
151
152 /**@brief Extended LLCP. */
153 struct ble_ext_llcp_cb_func_t
154 {
155 void (*llc_ext_llcp_proc_error_cb) (uint8_t link_id, uint8_t error_type, void* param); /**< Handler of Extended llcp procedure error. */
156 void (*llc_ext_llcp_req_proc_done_cb) (uint8_t link_id, uint8_t status, uint8_t ext_opcode, uint8_t *per_param); /**< Report the Extended llcp procedure done. */
157 uint8_t (*llc_ext_llcp_req_handler_cb) (uint8_t link_id, uint8_t *req_param, uint8_t *rsp_param); /**< Handle the Extended llcp request. */
158 };
159
160 typedef struct dbg_ble_llcp_info_entry_s
161 {
162 uint8_t record_index;
163 uint8_t direct; /**< 1-tx, 0-rx. */
164 uint8_t pdu[22]; /**<the same as spec. */
165 } dbg_ble_llcp_info_entry_t;
166
167 /** @} */
168
169 /** @addtogroup BLE_COMMEN_FUNCTIONS Functions
170 * @{ */
171 /**
172 *****************************************************************************************
173 * @brief Initialize BLE Stack.
174 *
175 * @param[in] evt_handler: Pointer to the ble event handler.
176 * @param[in] p_heaps_table: Pointer to the BLE stack heaps table.
177 *****************************************************************************************
178 */
179 void ble_stack_init(ble_evt_handler_t evt_handler, stack_heaps_table_t *p_heaps_table);
180
181 /**
182 *****************************************************************************************
183 * @brief Initialize BLE Stack controller.
184 *
185 * @param[in] p_heaps_table: Pointer to the BLE stack heaps table.
186 *
187 * @note: This function should be called if only as a controller.
188 *****************************************************************************************
189 */
190 void ble_stack_controller_init(stack_heaps_table_t *p_heaps_table);
191
192 /**
193 *****************************************************************************************
194 * @brief Initialize common patch function in BLE Stack controller.
195 *
196 * @note: This function should be called if only as a controller.
197 *****************************************************************************************
198 */
199 void ble_common_env_init_for_controller(void);
200
201 /**
202 *****************************************************************************************
203 * @brief Initialize ble hci adapter module.
204 *
205 * @param[in] p_rx_channel: Pointer to hci adapter rx channel
206 * @param[in] host_recv_cb: Callback to receive controller packet.
207 *
208 * @return Result of initializing.
209 *****************************************************************************************
210 */
211 sdk_err_t ble_hci_init(ble_hci_rx_channel_t *p_rx_channel, ble_hci_host_recv_cb_t host_recv_cb);
212
213 /**
214 *****************************************************************************************
215 * @brief BLE HCI adapter host send packet.
216 *
217 * @param[in] p_data: Pointer to packet data.
218 * @param[in] length: Length of packet data.
219 *
220 * @return Result of send.
221 *****************************************************************************************
222 */
223 sdk_err_t ble_hci_host_packet_send(uint8_t *p_data, uint16_t length);
224
225 /**
226 *****************************************************************************************
227 * @brief Get surplus space of controller receive channel.
228 *
229 * @return Result of get.
230 *****************************************************************************************
231 */
232 uint16_t ble_hci_rx_channel_surplus_space_get(void);
233
234 /**
235 *****************************************************************************************
236 * @brief Register BLE idle time notification callback function.
237 *
238 * @param[in] callback: function pointer of BLE idle time notification function.
239 * @note hs: the idle time of BLE in half slot (312.5us).
240 * Callback will be called by BLE ISR to notify the rest idle time if there are some BLE activities.
241 * It should be realized as simlpe as you can.
242 * It's not suitable for ISO activities.
243 *****************************************************************************************
244 */
245 void ble_idle_time_notify_cb_register(void (*callback)(uint32_t hs));
246
247 /**
248 *****************************************************************************************
249 * @brief Register BLE activity start notification callback function.
250 *
251 * @param[in] callback: function pointer of BLE activity start notification function.
252 * @note e_role: the role of activity, @ref ble_gap_actv_role_t for possible roles.
253 * index: The index parameter is interpreted by role.
254 * If role is @ref BLE_GAP_ACTIVITY_ROLE_ADV, it's the index of Advertising.
255 * If role is @ref BLE_GAP_ACTIVITY_ROLE_CON, it's the index of Connection.
256 * For all other roles, it should be ignored.
257 * Callback will be called by BLE ISR when the BLE activity starts every time.
258 * It should be realized as simlpe as you can. You'd better to define it in the RAM space
259 * It's not suitable for ISO activities.
260 *****************************************************************************************
261 */
262 void ble_activity_start_notify_cb_register(void (*callback)(ble_gap_actv_role_t e_role, uint8_t index));
263
264 /**
265 *****************************************************************************************
266 * @brief Register BLE activity end notification callback function.
267 *
268 * @param[in] callback: function pointer of BLE activity end notification function.
269 * @note e_role: the role of activity, refer to @ref ble_gap_actv_role_t for possible roles.
270 * index: The index parameter is interpreted by role.
271 * If role is @ref BLE_GAP_ACTIVITY_ROLE_ADV, it's the index of Advertising.
272 * If role is @ref BLE_GAP_ACTIVITY_ROLE_CON, it's the index of Connection.
273 * For all other roles, it should be ignored.
274 * Callback will be called by BLE ISR when the BLE activity ends every time.
275 * It should be realized as simlpe as you can. You'd better to define it in the RAM space
276 * It's not suitable for ISO activities.
277 *****************************************************************************************
278 */
279 void ble_activity_end_notify_cb_register(void (*callback)(ble_gap_actv_role_t e_role, uint8_t index));
280
281 /**
282 *****************************************************************************************
283 * @brief Change the RF TX mode of LP or HP.
284 *
285 * @param[in] rf_tx_mode: Refer to @ref ble_rf_tx_mode_t.
286 *
287 * @note This function should be called before BLE stack init.
288 *
289 * @return SDK_SUCCESS: Successfully set tx mode.
290 * SDK_ERR_DISALLOWED: Failed to set tx mode.
291 *****************************************************************************************
292 */
293 void ble_rf_tx_mode_set(ble_rf_tx_mode_t rf_tx_mode);
294
295 /**
296 *****************************************************************************************
297 * @brief Get the RF TX mode of LP or ULP.
298 *
299 * @return Refer to @ref ble_rf_tx_mode_t.
300 *
301 *****************************************************************************************
302 */
303 ble_rf_tx_mode_t ble_rf_tx_mode_get(void);
304
305 /**
306 *****************************************************************************************
307 * @brief custom the advertising frequency
308 *
309 * @param[in] ch37_mhz: channel 37 frequency[2360, 2520]MHz
310 * @param[in] ch38_mhz: channel 38 frequency[2360, 2520]MHz
311 * @param[in] ch39_mhz: channel 39 frequency[2360, 2520]MHz
312 * Others: invalid.
313 * @return SDK_SUCCESS: success.
314 Others: fail
315 *****************************************************************************************
316 */
317 sdk_err_t adv_rf_phy_freq_modify(uint16_t ch37_mhz, uint16_t ch38_mhz, uint16_t ch39_mhz);
318
319 /**
320 *****************************************************************************************
321 * @brief Start a extended llcp procedure.
322 * @param[in] conn_idx: function pointer of BLE activity end notification function.
323 * @param[in] param: Pointer to a param which intializer supply.
324 * @param[in] ext_opcode: Extended llcp opcode.
325 * @return The result of this function.
326 *****************************************************************************************
327 */
328 uint8_t ble_ext_llcp_send(uint16_t conn_idx, uint8_t *param, uint8_t ext_opcode);
329
330 /**
331 *****************************************************************************************
332 * @brief Registered the extended llcp procedure callback.
333 * @param[in] func: @ref ble_ext_llcp_cb_func_t.
334 * @return The result of this function.
335 *****************************************************************************************
336 */
337 uint8_t ble_ext_llcp_cb_reg(struct ble_ext_llcp_cb_func_t *func);
338
339 /**
340 *****************************************************************************************
341 * @brief Perform an AES encryption - result within callback
342 * @param[in] key Key used for the encryption
343 * @param[in] val Value to encrypt using AES
344 * @param[in] res_cb Function that will handle the AES based result (16 bytes)
345 * @param[in] src_info Information used retrieve requester
346 * @return void.
347 *****************************************************************************************
348 */
349 void ble_aes_encrypt(const uint8_t *key, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info);
350
351 /**
352 *****************************************************************************************
353 * @brief Perform an AES dencryption - result within callback
354 * @param[in] key Key used for the dencryption
355 * @param[in] val Value to decrypt using AES
356 * @param[in] res_cb Function that will handle the AES based result (16 bytes)
357 * @param[in] src_info Information used retrieve requester
358 * @return void.
359 *****************************************************************************************
360 */
361 void ble_aes_decrypt(const uint8_t *key, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info);
362
363 /**
364 *****************************************************************************************
365 * @brief Perform an AES ecb encryption - result within callback
366 * @param[in] key Key used for the encryption
367 * @param[in] val Value to encrypt using AES
368 * @param[in] res_cb Function that will handle the AES based result (16 bytes)
369 * @param[in] src_info Information used retrieve requester
370 * @return void.
371 *****************************************************************************************
372 */
373 void ble_aes_ecb_encrypt(const uint8_t *key, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info);
374
375 /**
376 *****************************************************************************************
377 * @brief Perform an AES ecb dencryption - result within callback
378 * @param[in] key Key used for the dencryption
379 * @param[in] val Value to decrypt using AES
380 * @param[in] res_cb Function that will handle the AES based result (16 bytes)
381 * @param[in] src_info Information used retrieve requester
382 * @return void.
383 *****************************************************************************************
384 */
385 void ble_aes_ecb_decrypt(const uint8_t *key, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info);
386
387 /**
388 *****************************************************************************************
389 * @brief Perform an AES cbc encryption - result within callback
390 * @param[in] key Key used for the encryption
391 * @param[in] iv IV used for the cbc encryption.only first block need to be present, continue block shall be null.
392 * @param[in] val Value to encrypt using AES
393 * @param[in] res_cb Function that will handle the AES based result (16 bytes)
394 * @param[in] src_info Information used retrieve requester
395 * @return void.
396 *****************************************************************************************
397 */
398 void ble_aes_cbc_encrypt(const uint8_t *key, const uint8_t *iv, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info);
399
400 /**
401 *****************************************************************************************
402 * @brief Perform an AES cbc dencryption - result within callback
403 * @param[in] key Key used for the decryption
404 * @param[in] iv IV used for the cbc decryption.only first block need to be present, continue block shall be null.
405 * @param[in] val Value to decrypt using AES
406 * @param[in] res_cb Function that will handle the AES based result (16 bytes)
407 * @param[in] src_info Information used retrieve requester
408 * @return void.
409 *****************************************************************************************
410 */
411 void ble_aes_cbc_decrypt(const uint8_t *key, const uint8_t *iv, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info);
412
413 /**
414 *****************************************************************************************
415 * @brief Start dtm tx test.
416 *
417 * @note TX modem test need to enable macro DTM_TEST_V4_CMD_ENABLE
418 * TX single carrier test need to enable macro DTM_TEST_PRIVATE_CMD_ENABLE
419 * @param[in] tx_channel TX channel, range: 0x00 to 0x27.
420 * @param[in] data_len Packet payload length.
421 * @param[in] pkt_type Packet payload type, range: 0x00 to 0x07.
422 * 0x00: Repeated "11111111100000111101"
423 * 0x01: Repeated "11110000"
424 * 0x02: Repeated "10101010"
425 * 0x03: PRBS15 sequence
426 * 0x04: Repeated "11111111"
427 * 0x05: Repeated "00000000"
428 * 0x06: Repeated "00001111"
429 * 0x07: Repeated "01010101"
430 * @param[in] tx_phy TX phy, @ref ble_gap_phy_type_t.
431 * @param[in] test_type Test type, @ref ble_rf_test_type_t.
432 * @param[in] tx_power Tx power, unit(dBm).
433 * BLE_RF_TX_MODE_SPA_MODE support value:[-20, -16, -10, -8, -5, 0, 1, 2, 3, 4, 5]
434 * BLE_RF_TX_MODE_HPA_MODE support value:[-10, -5, 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
435 *
436 * @return void.
437 *****************************************************************************************
438 */
439 void ble_dtm_tx_test_start(uint8_t tx_channel, uint8_t data_len, uint8_t pkt_type, uint8_t tx_phy, uint8_t test_type, int8_t tx_power);
440
441 /**
442 *****************************************************************************************
443 * @brief Start dtm rx test.
444 *
445 * @note RX test need to enable macro DTM_TEST_V2_CMD_ENABLE
446 *
447 * @param[in] rx_channel RX channel, range: 0x00 to 0x27.
448 * @param[in] rx_phy RX phy, @ref ble_gap_phy_type_t.
449 *
450 * @return void.
451 *****************************************************************************************
452 */
453 void ble_dtm_rx_test_start(uint8_t rx_channel, uint8_t rx_phy);
454
455 /**
456 *****************************************************************************************
457 * @brief End dtm tx test.
458 * @param[in] test_type Test type, @ref ble_rf_test_type_t.
459 *
460 * @return void.
461 *****************************************************************************************
462 */
463 void ble_dtm_tx_test_end(uint8_t test_type);
464
465 /**
466 *****************************************************************************************
467 * @brief End dtm rx test.
468 *
469 * @return void.
470 *****************************************************************************************
471 */
472 void ble_dtm_rx_test_end(void);
473
474 /**
475 *****************************************************************************************
476 * @brief register llcp debug info buffer
477 * @param[in] conidx: connection index
478 * @param[in] p_entry_buf: the buffer used to store the llcp infomation
479 * @param[in] entry_num: entry number in the buffer
480 * @return The result of this function.
481 *****************************************************************************************
482 */
483 uint8_t dbg_ble_stack_llcp_info_buf_register(uint8_t conidx, dbg_ble_llcp_info_entry_t *p_entry_buf, uint8_t entry_num);
484
485 /** @} */
486 #endif
487 /** @} */
488 /** @} */
489
ble_hci_host_recv_cb_t
void(* ble_hci_host_recv_cb_t)(uint8_t *p_data, uint16_t length)
Receive controller pachet callback type.
Definition: ble.h:109
dbg_ble_stack_llcp_info_buf_register
uint8_t dbg_ble_stack_llcp_info_buf_register(uint8_t conidx, dbg_ble_llcp_info_entry_t *p_entry_buf, uint8_t entry_num)
register llcp debug info buffer
ble_dtm_tx_test_start
void ble_dtm_tx_test_start(uint8_t tx_channel, uint8_t data_len, uint8_t pkt_type, uint8_t tx_phy, uint8_t test_type, int8_t tx_power)
Start dtm tx test.
dbg_ble_llcp_info_entry_s::record_index
uint8_t record_index
Definition: ble.h:162
ble_stack_init
void ble_stack_init(ble_evt_handler_t evt_handler, stack_heaps_table_t *p_heaps_table)
Initialize BLE Stack.
stack_heaps_table_t::em_ble_ral_num
uint16_t em_ble_ral_num
Definition: ble.h:138
BLE_RF_3TH_MATCH_CIRCUIT
@ BLE_RF_3TH_MATCH_CIRCUIT
Definition: ble.h:94
ble_hci_init
sdk_err_t ble_hci_init(ble_hci_rx_channel_t *p_rx_channel, ble_hci_host_recv_cb_t host_recv_cb)
Initialize ble hci adapter module.
ble_hci_host_packet_send
sdk_err_t ble_hci_host_packet_send(uint8_t *p_data, uint16_t length)
BLE HCI adapter host send packet.
dbg_ble_llcp_info_entry_t
struct dbg_ble_llcp_info_entry_s dbg_ble_llcp_info_entry_t
ble_hci_rx_channel_t::p_channel
uint8_t * p_channel
Definition: ble.h:148
stack_heaps_table_t::prf_buf
uint8_t * prf_buf
Definition: ble.h:130
ble_hci_rx_channel_t::cache_size
uint16_t cache_size
Definition: ble.h:149
ble_ext_llcp_cb_func_t
Extended LLCP.
Definition: ble.h:154
ble_rf_test_type_t
ble_rf_test_type_t
RF TX type.
Definition: ble.h:83
stack_heaps_table_t::db_ret_size
uint32_t db_ret_size
Definition: ble.h:127
stack_heaps_table_t::env_ret_size
uint32_t env_ret_size
Definition: ble.h:126
ble_gatts.h
BLE GATTS API.
ble_rf_match_circuit_t
ble_rf_match_circuit_t
The resistance value (ohm) of the RF match circuit.
Definition: ble.h:92
ble_gap_actv_role_t
ble_gap_actv_role_t
Possible roles of the activity.
Definition: ble_gapm.h:550
stack_heaps_table_t::conn_size
uint32_t conn_size
Definition: ble.h:135
ble_ext_llcp_cb_func_t::llc_ext_llcp_proc_error_cb
void(* llc_ext_llcp_proc_error_cb)(uint8_t link_id, uint8_t error_type, void *param)
Definition: ble.h:155
stack_heaps_table_t::msg_ret
uint32_t * msg_ret
Definition: ble.h:124
ble_gatt.h
BLE GATT.
BLE_RF_TX_MODE_LP_MODE
@ BLE_RF_TX_MODE_LP_MODE
Definition: ble.h:75
ble_ext_llcp_send
uint8_t ble_ext_llcp_send(uint16_t conn_idx, uint8_t *param, uint8_t ext_opcode)
Start a extended llcp procedure.
BLE_RF_TX_MODE_INVALID
@ BLE_RF_TX_MODE_INVALID
Definition: ble.h:74
ble_l2cap.h
BLE L2CAP API.
ble_activity_start_notify_cb_register
void ble_activity_start_notify_cb_register(void(*callback)(ble_gap_actv_role_t e_role, uint8_t index))
Register BLE activity start notification callback function.
ble_sec.h
BLE SEC API.
BLE_RF_TEST_TYPE_SINGLE_CARRIER
@ BLE_RF_TEST_TYPE_SINGLE_CARRIER
Definition: ble.h:85
stack_heaps_table_t::bm_size
uint32_t bm_size
Definition: ble.h:133
ble_dtm_rx_test_start
void ble_dtm_rx_test_start(uint8_t rx_channel, uint8_t rx_phy)
Start dtm rx test.
ble_aes_encrypt
void ble_aes_encrypt(const uint8_t *key, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info)
Perform an AES encryption - result within callback.
ble_hci_rx_channel_t
BLE HCI RX Channel (Host send packet to controller).
Definition: ble.h:147
stack_heaps_table_t::bm_buf
uint8_t * bm_buf
Definition: ble.h:132
adv_rf_phy_freq_modify
sdk_err_t adv_rf_phy_freq_modify(uint16_t ch37_mhz, uint16_t ch38_mhz, uint16_t ch39_mhz)
custom the advertising frequency
ble_error.h
File that contains error codes.
ble_gapc.h
BLE GAPC API.
stack_heaps_table_t::em_ble_adv_buf_nb_tx
uint16_t em_ble_adv_buf_nb_tx
Definition: ble.h:139
BLE_RF_TEST_TYPE_MODEM
@ BLE_RF_TEST_TYPE_MODEM
Definition: ble.h:84
ble_aes_ecb_encrypt
void ble_aes_ecb_encrypt(const uint8_t *key, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info)
Perform an AES ecb encryption - result within callback.
ble_prf.h
BLE PRF API.
ble_hci_rx_channel_surplus_space_get
uint16_t ble_hci_rx_channel_surplus_space_get(void)
Get surplus space of controller receive channel.
stack_heaps_table_t::buf_size
uint32_t buf_size
Definition: ble.h:131
ble_dtm_rx_test_end
void ble_dtm_rx_test_end(void)
End dtm rx test.
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:290
stack_heaps_table_t::em_ble_act_num
uint16_t em_ble_act_num
Definition: ble.h:137
stack_heaps_table_t::ram_size
uint32_t ram_size
Definition: ble.h:142
ble_ext_llcp_cb_reg
uint8_t ble_ext_llcp_cb_reg(struct ble_ext_llcp_cb_func_t *func)
Registered the extended llcp procedure callback.
aes_result_cb
void(* aes_result_cb)(uint8_t status, const uint8_t *aes_res, uint32_t src_info)
Call back definition of the function that can handle result of an AES based algorithm.
Definition: ble.h:106
ble_aes_decrypt
void ble_aes_decrypt(const uint8_t *key, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info)
Perform an AES dencryption - result within callback.
ble_event.h
BLE event header files.
BLE_RF_5TH_MATCH_CIRCUIT
@ BLE_RF_5TH_MATCH_CIRCUIT
Definition: ble.h:93
stack_heaps_table_t::em_common_offset
uint16_t em_common_offset
Definition: ble.h:141
ble_rf_tx_mode_set
void ble_rf_tx_mode_set(ble_rf_tx_mode_t rf_tx_mode)
Change the RF TX mode of LP or HP.
dbg_ble_llcp_info_entry_s::pdu
uint8_t pdu[22]
Definition: ble.h:164
ble_rf_tx_mode_t
ble_rf_tx_mode_t
RF TX mode.
Definition: ble.h:73
ble_stack_controller_init
void ble_stack_controller_init(stack_heaps_table_t *p_heaps_table)
Initialize BLE Stack controller.
ble_aes_cbc_encrypt
void ble_aes_cbc_encrypt(const uint8_t *key, const uint8_t *iv, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info)
Perform an AES cbc encryption - result within callback.
ble_gapm.h
BLE GAPM API.
ble_ext_llcp_cb_func_t::llc_ext_llcp_req_proc_done_cb
void(* llc_ext_llcp_req_proc_done_cb)(uint8_t link_id, uint8_t status, uint8_t ext_opcode, uint8_t *per_param)
Definition: ble.h:156
ble_activity_end_notify_cb_register
void ble_activity_end_notify_cb_register(void(*callback)(ble_gap_actv_role_t e_role, uint8_t index))
Register BLE activity end notification callback function.
ble_common_env_init_for_controller
void ble_common_env_init_for_controller(void)
Initialize common patch function in BLE Stack controller.
stack_heaps_table_t::conn_buf
uint8_t * conn_buf
Definition: ble.h:134
ble_ext_llcp_cb_func_t::llc_ext_llcp_req_handler_cb
uint8_t(* llc_ext_llcp_req_handler_cb)(uint8_t link_id, uint8_t *req_param, uint8_t *rsp_param)
Definition: ble.h:157
stack_heaps_table_t::non_ret_size
uint32_t non_ret_size
Definition: ble.h:129
ble_att.h
Attribute Protocol.
stack_heaps_table_t::em_ble_adv_frag_nb_tx
uint16_t em_ble_adv_frag_nb_tx
Definition: ble.h:140
ble_idle_time_notify_cb_register
void ble_idle_time_notify_cb_register(void(*callback)(uint32_t hs))
Register BLE idle time notification callback function.
BLE_RF_TX_MODE_HP_MODE
@ BLE_RF_TX_MODE_HP_MODE
Definition: ble.h:76
dbg_ble_llcp_info_entry_s
Definition: ble.h:161
ble_evt_handler_t
void(* ble_evt_handler_t)(const ble_evt_t *p_evt)
The BLE event handler type.
Definition: ble_event.h:228
ble_gattc.h
BLE GATTC API.
dbg_ble_llcp_info_entry_s::direct
uint8_t direct
Definition: ble.h:163
stack_heaps_table_t::msg_ret_size
uint32_t msg_ret_size
Definition: ble.h:128
ble_rf_tx_mode_get
ble_rf_tx_mode_t ble_rf_tx_mode_get(void)
Get the RF TX mode of LP or ULP.
ble_aes_ecb_decrypt
void ble_aes_ecb_decrypt(const uint8_t *key, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info)
Perform an AES ecb dencryption - result within callback.
stack_heaps_table_t::non_ret
uint32_t * non_ret
Definition: ble.h:125
stack_heaps_table_t::env_ret
uint32_t * env_ret
Definition: ble.h:122
stack_heaps_table_t::db_ret
uint32_t * db_ret
Definition: ble.h:123
stack_heaps_table_t
The table contains the pointers to four arrays which are used as heap memory by BLE stack in ROM....
Definition: ble.h:121
ble_dtm_tx_test_end
void ble_dtm_tx_test_end(uint8_t test_type)
End dtm tx test.
ble_aes_cbc_decrypt
void ble_aes_cbc_decrypt(const uint8_t *key, const uint8_t *iv, const uint8_t *val, aes_result_cb res_cb, uint32_t src_info)
Perform an AES cbc dencryption - result within callback.