Mistake on this page?
Report an issue in GitHub or email us
bb_ble_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief BLE baseband interface file.
6  *
7  * Copyright (c) 2013-2019 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019-2020 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 
25 #ifndef BB_BLE_API_H
26 #define BB_BLE_API_H
27 
28 #include "wsf_types.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /*! \addtogroup BB_API_BLE
35  * \{ */
36 
37 /**************************************************************************************************
38  Data Types
39 **************************************************************************************************/
40 
41 /*! \brief Advertising packet statistics. */
42 typedef struct
43 {
44  uint32_t txAdv; /*!< Number of sent advertising packets. */
45  uint32_t rxReq; /*!< Number of successfully received advertising requests. */
46  uint32_t rxReqCrc; /*!< Number of received advertising requests with CRC errors. */
47  uint32_t rxReqTimeout; /*!< Number of timed out received advertising requests (receive timeout). */
48  uint32_t txRsp; /*!< Number of sent response packets. */
49  uint32_t errAdv; /*!< Number of advertising transaction errors. */
50  uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */
51  uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */
52  uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */
53  uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */
55 
56 /*! \brief Auxiliary advertising packet statistics. */
57 typedef struct
58 {
59  uint32_t txAdv; /*!< Number of sent advertising packets. */
60  uint32_t rxReq; /*!< Number of successfully received advertising requests. */
61  uint32_t rxReqCrc; /*!< Number of received advertising requests with CRC errors. */
62  uint32_t rxReqTimeout; /*!< Number of timed out received advertising requests (receive timeout). */
63  uint32_t txRsp; /*!< Number of sent response packets. */
64  uint32_t txChain; /*!< Number of sent chain packets. */
65  uint32_t errAdv; /*!< Number of advertising transaction errors. */
66  uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */
67  uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */
68  uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */
69  uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */
71 
72 /*! \brief Scan packet statistics. */
73 typedef struct
74 {
75  uint32_t rxAdv; /*!< Number of successfully received advertising packets. */
76  uint32_t rxAdvCrc; /*!< Number of received advertising packets with CRC errors. */
77  uint32_t rxAdvTimeout; /*!< Number of timed out advertising packets (receive timeout). */
78  uint32_t txReq; /*!< Number of sent advertising requests. */
79  uint32_t rxRsp; /*!< Number of successfully received advertising response packets. */
80  uint32_t rxRspCrc; /*!< Number of received advertising response packets with CRC errors. */
81  uint32_t rxRspTimeout; /*!< Number of timed out advertising response packets (receive timeout). */
82  uint32_t errScan; /*!< Number of scan transaction errors. */
83  uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */
84  uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */
85  uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */
86  uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */
88 
89 /*! \brief Scan packet statistics. */
90 typedef struct
91 {
92  uint32_t rxAdv; /*!< Number of successfully received advertising packets. */
93  uint32_t rxAdvCrc; /*!< Number of received advertising packets with CRC errors. */
94  uint32_t rxAdvTimeout; /*!< Number of timed out advertising packets (receive timeout). */
95  uint32_t txReq; /*!< Number of sent advertising requests. */
96  uint32_t rxRsp; /*!< Number of successfully received advertising response packets. */
97  uint32_t rxRspCrc; /*!< Number of received advertising response packets with CRC errors. */
98  uint32_t rxRspTimeout; /*!< Number of timed out advertising response packets (receive timeout). */
99  uint32_t rxChain; /*!< Number of successfully received chain packets. */
100  uint32_t rxChainCrc; /*!< Number of received chain packets with CRC errors. */
101  uint32_t rxChainTimeout; /*!< Number of timed out chain packets (receive timeout). */
102  uint32_t errScan; /*!< Number of scan transaction errors. */
103  uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */
104  uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */
105  uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */
106  uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */
108 
109 /*! \brief Periodic scan packet statistics. */
110 typedef struct
111 {
112  uint32_t rxAdv; /*!< Number of successfully received advertising packets. */
113  uint32_t rxAdvCrc; /*!< Number of received advertising packets with CRC errors. */
114  uint32_t rxAdvTimeout; /*!< Number of timed out advertising packets (receive timeout). */
115  uint32_t rxChain; /*!< Number of successfully received chain packets. */
116  uint32_t rxChainCrc; /*!< Number of received chain packets with CRC errors. */
117  uint32_t rxChainTimeout; /*!< Number of timed out chain packets (receive timeout). */
118  uint32_t errScan; /*!< Number of scan transaction errors. */
119  uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */
120  uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */
121  uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */
122  uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */
124 
125 /*! \brief Data packet statistics. */
126 typedef struct
127 {
128  uint32_t rxData; /*!< Number of successfully received data packets. */
129  uint32_t rxDataCrc; /*!< Number of received data packets with CRC errors. */
130  uint32_t rxDataTimeout; /*!< Number of timed out data packets (receive timeout). */
131  uint32_t txData; /*!< Number of sent data packets. */
132  uint32_t errData; /*!< Number of data transaction errors. */
133  uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */
134  uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */
135  uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */
136  uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */
138 
139 /*! \brief PDU filtering statistics. */
140 typedef struct
141 {
142  uint16_t failPduTypeFilt; /*!< Number of PDUs failing PDU type filter. */
143  uint16_t passPduTypeFilt; /*!< Number of PDUs passing PDU type filter. */
144  uint16_t failWlFilt; /*!< Number of PDUs failing whitelist filter. */
145  uint16_t passWlFilt; /*!< Number of PDUs passing whitelist filter. */
146  uint16_t failPeerAddrMatch; /*!< Number of PDUS failing peer address match. */
147  uint16_t passPeerAddrMatch; /*!< Number of PDUs passing peer address match. */
148  uint16_t failLocalAddrMatch; /*!< Number of PDUS failing local address match. */
149  uint16_t passLocalAddrMatch; /*!< Number of PDUs passing local address match. */
150  uint16_t failPeerRpaVerify; /*!< Number of peer RPAs failing verification. */
151  uint16_t passPeerRpaVerify; /*!< Number of peer RPAs passing verification. */
152  uint16_t failLocalRpaVerify; /*!< Number of local RPAs failing verification. */
153  uint16_t passLocalRpaVerify; /*!< Number of local RPAs passing verification. */
154  uint16_t failPeerPrivAddrReq; /*!< Number of peer addresses failing requirement to be RPAs. */
155  uint16_t failLocalPrivAddrReq; /*!< Number of local addresses failing requirement to be RPAs. */
156  uint16_t failPeerAddrResReq; /*!< Number of PDUs failing required peer address resolution. */
157  uint16_t passPeerAddrResOpt; /*!< Number of PDUs passing optional peer address resolution. */
158  uint16_t passLocalAddrResOpt; /*!< Number of PDUs passing optional local address resolution. */
159  uint16_t peerResAddrPend; /*!< Number of peer address resolutions pended. */
160  uint16_t localResAddrPend; /*!< Number of local address resolutions pended. */
162 
163 /**************************************************************************************************
164  Function Declarations
165 **************************************************************************************************/
166 
167 /*************************************************************************************************/
168 /*!
169  * \brief Initialize the BLE BB.
170  *
171  * Initialize baseband resources.
172  */
173 /*************************************************************************************************/
174 void BbBleInit(void);
175 
176 /*************************************************************************************************/
177 /*!
178  * \brief Initialize for scanning master operations.
179  *
180  * Update the operation table with scanning master operations routines.
181  */
182 /*************************************************************************************************/
183 void BbBleScanMasterInit(void);
184 
185 /*************************************************************************************************/
186 /*!
187  * \brief Initialize for auxiliary scanning master operations.
188  *
189  * Update the operation table with auxiliary scanning master operations routines.
190  */
191 /*************************************************************************************************/
192 void BbBleAuxScanMasterInit(void);
193 
194 /*************************************************************************************************/
195 /*!
196  * \brief Initialize for periodic scanning master operations.
197  *
198  * Update the operation table with periodic scanning master operations routines.
199  */
200 /*************************************************************************************************/
201 void BbBlePerScanMasterInit(void);
202 
203 /*************************************************************************************************/
204 /*!
205  * \brief Initialize for connectable master operations.
206  *
207  * Update the operation table with connectable master operations routines.
208  */
209 /*************************************************************************************************/
210 void BbBleConnMasterInit(void);
211 
212 /*************************************************************************************************/
213 /*!
214  * \brief Initialize for advertising slave operations.
215  *
216  * Update the operation table with advertising slave operations routines.
217  */
218 /*************************************************************************************************/
219 void BbBleAdvSlaveInit(void);
220 
221 /*************************************************************************************************/
222 /*!
223  * \brief Initialize for auxiliary advertising slave operations.
224  *
225  * Update the operation table with auxiliary advertising slave operations routines.
226  */
227 /*************************************************************************************************/
228 void BbBleAuxAdvSlaveInit(void);
229 
230 /*************************************************************************************************/
231 /*!
232  * \brief Initialize for connectable slave operations.
233  *
234  * Update the operation table with connectable slave operations routines.
235  */
236 /*************************************************************************************************/
237 void BbBleConnSlaveInit(void);
238 
239 /*************************************************************************************************/
240 /*!
241  * \brief Initialize for test operations.
242  *
243  * Update the operation table with test operations routines.
244  */
245 /*************************************************************************************************/
246 void BbBleTestInit(void);
247 
248 /*************************************************************************************************/
249 /*!
250  * \brief Initialize white list.
251  *
252  * \param numEntries Number of white list entries to provide.
253  * \param pFreeMem Pointer to free memory.
254  * \param freeMemSize Size of pFreeMem.
255  *
256  * \return Amount of free memory consumed.
257  *
258  * This function initializes the white list.
259  *
260  * \note This function must be called once before initializing the LL.
261  */
262 /*************************************************************************************************/
263 uint16_t BbBleInitWhiteList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize);
264 
265 /*************************************************************************************************/
266 /*!
267  * \brief Initialize resolving list.
268  *
269  * \param numEntries Number of resolving list entries to provide.
270  * \param pFreeMem Pointer to free memory.
271  * \param freeMemSize Size of pFreeMem.
272  *
273  * \return Amount of free memory consumed.
274  *
275  * This function initializes the resolving list.
276  *
277  * \note This function must be called once before initializing the LL.
278  */
279 /*************************************************************************************************/
280 uint16_t BbBleInitResolvingList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize);
281 
282 /*************************************************************************************************/
283 /*!
284  * \brief Initialize periodic list.
285  *
286  * \param numEntries Number of periodic list entries to provide.
287  * \param pFreeMem Pointer to free memory.
288  * \param freeMemSize Size of pFreeMem.
289  *
290  * \return Amount of free memory consumed.
291  *
292  * This function initializes the periodic list.
293  *
294  * \note This function must be called once before initializing the LL.
295  */
296 /*************************************************************************************************/
297 uint16_t BbBleInitPeriodicList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize);
298 
299 /*************************************************************************************************/
300 /*!
301  * \brief Get advertising packet statistics.
302  *
303  * \param pStats Advertising statistics.
304  */
305 /*************************************************************************************************/
307 
308 /*************************************************************************************************/
309 /*!
310  * \brief Get scan packet statistics.
311  *
312  * \param pStats Scan statistics.
313  */
314 /*************************************************************************************************/
316 
317 /*************************************************************************************************/
318 /*!
319  * \brief Get auxiliary advertising packet statistics.
320  *
321  * \param pStats Auxiliary advertising statistics.
322  */
323 /*************************************************************************************************/
325 
326 /*************************************************************************************************/
327 /*!
328  * \brief Get auxiliary scan packet statistics.
329  *
330  * \param pStats Auxiliary scan statistics.
331  */
332 /*************************************************************************************************/
334 
335 /*************************************************************************************************/
336 /*!
337  * \brief Get periodic scan packet statistics.
338  *
339  * \param pStats Periodic scan statistics.
340  */
341 /*************************************************************************************************/
343 
344 /*************************************************************************************************/
345 /*!
346  * \brief Get connection packet statistics.
347  *
348  * \param pStats Connection data statistics.
349  */
350 /*************************************************************************************************/
352 
353 /*************************************************************************************************/
354 /*!
355  * \brief Get test mode packet statistics.
356  *
357  * \param pStats Test data statistics.
358  */
359 /*************************************************************************************************/
361 
362 /*************************************************************************************************/
363 /*!
364  * \brief Get PDU filter statistics.
365  *
366  * \param pStats PDU filter statistics.
367  */
368 /*************************************************************************************************/
370 
371 /*************************************************************************************************/
372 /*!
373  * \brief Initialize for connected isochronous stream master operations.
374  *
375  * Update the operation table with CIS master operations routines.
376  */
377 /*************************************************************************************************/
378 void BbBleCisMasterInit(void);
379 
380 /*************************************************************************************************/
381 /*!
382  * \brief Initialize for connected isochronous stream slave operations.
383  *
384  * Update the operation table with CIS slave operations routines.
385  */
386 /*************************************************************************************************/
387 void BbBleCisSlaveInit(void);
388 
389 /*************************************************************************************************/
390 /*!
391  * \brief Initialize for Broadcast isochronous stream master operations.
392  *
393  * Update the operation table with CIS master operations routines.
394  */
395 /*************************************************************************************************/
396 void BbBleBisMasterInit(void);
397 
398 /*************************************************************************************************/
399 /*!
400  * \brief Initialize for Broadcast isochronous stream slave operations.
401  *
402  * Update the operation table with CIS slave operations routines.
403  */
404 /*************************************************************************************************/
405 void BbBleBisSlaveInit(void);
406 
407 /*************************************************************************************************/
408 /*!
409  * \brief Get CIS packet statistics.
410  *
411  * \param pStats CIS data statistics.
412  */
413 /*************************************************************************************************/
415 
416 /*! \} */ /* BB_API_BLE */
417 
418 #ifdef __cplusplus
419 };
420 #endif
421 
422 #endif /* BB_BLE_API_H */
void BbBleScanMasterInit(void)
Initialize for scanning master operations.
uint32_t rxAdvTimeout
Definition: bb_ble_api.h:77
uint16_t passLocalAddrResOpt
Definition: bb_ble_api.h:158
uint16_t BbBleInitWhiteList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize)
Initialize white list.
uint16_t passLocalAddrMatch
Definition: bb_ble_api.h:149
void BbBleCisSlaveInit(void)
Initialize for connected isochronous stream slave operations.
uint16_t passPeerAddrResOpt
Definition: bb_ble_api.h:157
uint16_t rxSetupUsec
Definition: bb_ble_api.h:133
uint16_t rxSetupUsec
Definition: bb_ble_api.h:83
uint16_t peerResAddrPend
Definition: bb_ble_api.h:159
uint16_t localResAddrPend
Definition: bb_ble_api.h:160
uint16_t failPeerAddrMatch
Definition: bb_ble_api.h:146
void BbBleGetAuxScanStats(BbBleAuxScanPktStats_t *pStats)
Get auxiliary scan packet statistics.
uint16_t passPduTypeFilt
Definition: bb_ble_api.h:143
uint16_t BbBleInitPeriodicList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize)
Initialize periodic list.
uint16_t failLocalPrivAddrReq
Definition: bb_ble_api.h:155
void BbBleCisMasterInit(void)
Initialize for connected isochronous stream master operations.
uint16_t failPeerAddrResReq
Definition: bb_ble_api.h:156
uint16_t passPeerAddrMatch
Definition: bb_ble_api.h:147
uint16_t failLocalRpaVerify
Definition: bb_ble_api.h:152
uint32_t rxReqCrc
Definition: bb_ble_api.h:46
PDU filtering statistics.
Definition: bb_ble_api.h:140
void BbBleGetScanStats(BbBleScanPktStats_t *pStats)
Get scan packet statistics.
void BbBleGetTestStats(BbBleDataPktStats_t *pStats)
Get test mode packet statistics.
Advertising packet statistics.
Definition: bb_ble_api.h:42
void BbBleGetPerScanStats(BbBlePerScanPktStats_t *pStats)
Get periodic scan packet statistics.
uint16_t txIsrUsec
Definition: bb_ble_api.h:53
void BbBleAuxAdvSlaveInit(void)
Initialize for auxiliary advertising slave operations.
uint16_t failLocalAddrMatch
Definition: bb_ble_api.h:148
Scan packet statistics.
Definition: bb_ble_api.h:90
uint16_t rxIsrUsec
Definition: bb_ble_api.h:85
void BbBleConnMasterInit(void)
Initialize for connectable master operations.
uint32_t rxReqTimeout
Definition: bb_ble_api.h:47
void BbBleGetCisStats(BbBleDataPktStats_t *pStats)
Get CIS packet statistics.
Platform-independent data types.
uint32_t rxRspTimeout
Definition: bb_ble_api.h:81
void BbBleGetPduFiltStats(BbBlePduFiltStats_t *pStats)
Get PDU filter statistics.
uint16_t failPeerRpaVerify
Definition: bb_ble_api.h:150
void BbBleBisMasterInit(void)
Initialize for Broadcast isochronous stream master operations.
uint32_t rxDataTimeout
Definition: bb_ble_api.h:130
Auxiliary advertising packet statistics.
Definition: bb_ble_api.h:57
uint16_t txSetupUsec
Definition: bb_ble_api.h:51
uint16_t txIsrUsec
Definition: bb_ble_api.h:86
void BbBlePerScanMasterInit(void)
Initialize for periodic scanning master operations.
void BbBleGetAuxAdvStats(BbBleAuxAdvPktStats_t *pStats)
Get auxiliary advertising packet statistics.
uint16_t failPduTypeFilt
Definition: bb_ble_api.h:142
uint16_t txSetupUsec
Definition: bb_ble_api.h:84
uint16_t failPeerPrivAddrReq
Definition: bb_ble_api.h:154
uint16_t BbBleInitResolvingList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize)
Initialize resolving list.
void BbBleInit(void)
Initialize the BLE BB.
void BbBleTestInit(void)
Initialize for test operations.
uint16_t passLocalRpaVerify
Definition: bb_ble_api.h:153
Data packet statistics.
Definition: bb_ble_api.h:126
void BbBleAuxScanMasterInit(void)
Initialize for auxiliary scanning master operations.
void BbBleBisSlaveInit(void)
Initialize for Broadcast isochronous stream slave operations.
Scan packet statistics.
Definition: bb_ble_api.h:73
uint16_t passPeerRpaVerify
Definition: bb_ble_api.h:151
uint16_t txSetupUsec
Definition: bb_ble_api.h:134
uint16_t rxIsrUsec
Definition: bb_ble_api.h:52
void BbBleGetAdvStats(BbBleAdvPktStats_t *pStats)
Get advertising packet statistics.
void BbBleAdvSlaveInit(void)
Initialize for advertising slave operations.
uint16_t rxSetupUsec
Definition: bb_ble_api.h:50
void BbBleGetConnStats(BbBleDataPktStats_t *pStats)
Get connection packet statistics.
Periodic scan packet statistics.
Definition: bb_ble_api.h:110
void BbBleConnSlaveInit(void)
Initialize for connectable slave operations.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.