Mistake on this page?
Report an issue in GitHub or email us
wsf_trace.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file wsf_trace.h
4  *
5  * \brief Trace message interface.
6  *
7  * Copyright (c) 2009-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 #ifndef WSF_TRACE_H
25 #define WSF_TRACE_H
26 
27 #include <stdarg.h>
28 
29 #if MBED_CONF_CORDIO_TRACE_HCI_PACKETS
30 #include "mbed_wsf_trace.h"
31 #endif
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /*! \addtogroup WSF_TRACE_API
38  * \{ */
39 
40 /**************************************************************************************************
41  Macros
42 **************************************************************************************************/
43 
44 #ifndef WSF_TRACE_ENABLED
45 /*! \brief Trace enable flag (default is disabled, override with compile-time directive). */
46 #define WSF_TRACE_ENABLED FALSE
47 #endif
48 
49 #ifndef WSF_TOKEN_ENABLED
50 /*! \brief Tokenized tracing enable flag (default is disabled, override with compile-time directive). */
51 #define WSF_TOKEN_ENABLED FALSE
52 #endif
53 
54 #ifndef LL_TRACE_ENABLED
55 /*! \brief Trace enabled for controller */
56 #define LL_TRACE_ENABLED FALSE
57 #endif
58 
59 #ifndef AUD_TRACE_ENABLED
60 /*! \brief Trace enabled for audio subsystem */
61 #define AUD_TRACE_ENABLED FALSE
62 #endif
63 
64 /**************************************************************************************************
65  Data Types
66 **************************************************************************************************/
67 
68 /*! \brief Token event handler. */
69 typedef bool_t (*WsfTraceHandler_t)(const uint8_t *pBuf, uint32_t len);
70 
71 /*! \brief BT4 Platform trace callback. */
72 typedef void (*WsfBt4TraceCback_t)(const char *pStr, va_list args);
73 
74 /**************************************************************************************************
75  Function Prototypes
76 **************************************************************************************************/
77 
78 /*************************************************************************************************/
79 /*!
80  * \brief Output tokenized message.
81  *
82  * \param tok Token
83  * \param var Variable
84  */
85 /*************************************************************************************************/
86 void WsfToken(uint32_t tok, uint32_t var);
87 
88 /*************************************************************************************************/
89 /*!
90  * \brief Enable trace messages.
91  *
92  * \param enable TRUE to enable, FALSE to disable
93  */
94 /*************************************************************************************************/
95 void WsfTraceEnable(bool_t enable);
96 
97 /*************************************************************************************************/
98 /*!
99  * \brief Output trace message.
100  *
101  * \param pStr Format string
102  * Addition parameters variable arguments to the format string.
103  */
104 /*************************************************************************************************/
105 void WsfTrace(const char *pStr, ...);
106 
107 /*************************************************************************************************/
108 /*!
109  * \brief Register trace handler.
110  *
111  * \param traceCback Token event handler.
112  *
113  * This routine registers a token callback. This callback is called when the next token event
114  * is ready to be written to the I/O.
115  */
116 /*************************************************************************************************/
118 
119 /*************************************************************************************************/
120 /*!
121  * \brief Register BT4 platform trace callback function.
122  *
123  * \param cback Callback function
124  */
125 /*************************************************************************************************/
127 
128 /*************************************************************************************************/
129 /*!
130  * \brief Service the trace ring buffer.
131  *
132  * \return TRUE if trace messages pending, FALSE otherwise.
133  *
134  * This routine is called in the main loop for a "push" type trace systems.
135  */
136 /*************************************************************************************************/
137 bool_t WsfTokenService(void);
138 
139 /**************************************************************************************************
140  Macros
141 **************************************************************************************************/
142 
143 #ifdef TOKEN_GENERATION
144 
145 #define WSF_TOKEN(subsys, stat, msg) \
146  __WSF_TOKEN_DEFINE_( \
147  /* token: */ MODULE_ID, __LINE__, \
148  /* origin: */ __FILE__, subsys, \
149  /* message: */ stat, msg)
150 
151 #define WSF_TRACE0(subsys, stat, msg) WSF_TOKEN(subsys, stat, msg)
152 #define WSF_TRACE1(subsys, stat, msg, var1) WSF_TOKEN(subsys, stat, msg)
153 #define WSF_TRACE2(subsys, stat, msg, var1, var2) WSF_TOKEN(subsys, stat, msg)
154 #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) WSF_TOKEN(subsys, stat, msg)
155 
156 #elif WSF_TOKEN_ENABLED == TRUE
157 
158 /** \name Trace macros
159  *
160  */
161 /**@{*/
162 #define WSF_TRACE0(subsys, stat, msg) \
163  WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, 0)
164 #define WSF_TRACE1(subsys, stat, msg, var1) \
165  WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, (uint32_t)(var1))
166 #define WSF_TRACE2(subsys, stat, msg, var1, var2) \
167  WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, (uint32_t)(((var2) << 16) | ((var1) & 0xFFFF)))
168 #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) \
169  WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, (uint32_t)((((var3) & 0xFFFF) << 16) | (((var2) & 0xFF) << 8) | ((var1) & 0xFF)))
170 /**@}*/
171 
172 #elif WSF_TRACE_ENABLED == TRUE
173 
174 /** \name Trace macros
175  *
176  */
177 /**@{*/
178 #define WSF_TRACE0(subsys, stat, msg) \
179  WsfTrace(msg)
180 #define WSF_TRACE1(subsys, stat, msg, var1) \
181  WsfTrace(msg, var1)
182 #define WSF_TRACE2(subsys, stat, msg, var1, var2) \
183  WsfTrace(msg, var1, var2)
184 #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) \
185  WsfTrace(msg, var1, var2, var3)
186 #define WSF_TRACE4(subsys, stat, msg, var1, var2, var3, var4) \
187  WsfTrace(msg, var1, var2, var3, var4)
188 #define WSF_TRACE5(subsys, stat, msg, var1, var2, var3, var4, var5) \
189  WsfTrace(msg, var1, var2, var3, var4, var5)
190 #define WSF_TRACE6(subsys, stat, msg, var1, var2, var3, var4, var5, var6) \
191  WsfTrace(msg, var1, var2, var3, var4, var5, var6)
192 #define WSF_TRACE7(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7) \
193  WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7)
194 #define WSF_TRACE8(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8) \
195  WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8)
196 #define WSF_TRACE9(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) \
197  WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9)
198 #define WSF_TRACE12(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) \
199  WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
200 /**@}*/
201 
202 #else
203 
204 /** \name Trace macros
205  *
206  */
207 /**@{*/
208 #define WSF_TRACE0(subsys, stat, msg)
209 #define WSF_TRACE1(subsys, stat, msg, var1)
210 #define WSF_TRACE2(subsys, stat, msg, var1, var2)
211 #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3)
212 #define WSF_TRACE4(subsys, stat, msg, var1, var2, var3, var4)
213 #define WSF_TRACE5(subsys, stat, msg, var1, var2, var3, var4, var5)
214 #define WSF_TRACE6(subsys, stat, msg, var1, var2, var3, var4, var5, var6)
215 #define WSF_TRACE7(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7)
216 #define WSF_TRACE8(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8)
217 #define WSF_TRACE9(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9)
218 #define WSF_TRACE12(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
219 /**@}*/
220 #endif
221 
222 /*! \brief 0 argument WSF info trace. */
223 #define WSF_TRACE_INFO0(msg)
224 /*! \brief 1 argument WSF info trace. */
225 #define WSF_TRACE_INFO1(msg, var1)
226 /*! \brief 2 argument WSF info trace. */
227 #define WSF_TRACE_INFO2(msg, var1, var2)
228 /*! \brief 3 argument WSF info trace. */
229 #define WSF_TRACE_INFO3(msg, var1, var2, var3)
230 /*! \brief 0 argument WSF warning trace. */
231 #define WSF_TRACE_WARN0(msg) WSF_TRACE0("WSF", "WARN", msg)
232 /*! \brief 1 argument WSF warning trace. */
233 #define WSF_TRACE_WARN1(msg, var1) WSF_TRACE1("WSF", "WARN", msg, var1)
234 /*! \brief 2 argument WSF warning trace. */
235 #define WSF_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("WSF", "WARN", msg, var1, var2)
236 /*! \brief 3 argument WSF warning trace. */
237 #define WSF_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("WSF", "WARN", msg, var1, var2, var3)
238 /*! \brief 0 argument WSF error trace. */
239 #define WSF_TRACE_ERR0(msg) WSF_TRACE0("WSF", "ERR", msg)
240 /*! \brief 1 argument WSF error trace. */
241 #define WSF_TRACE_ERR1(msg, var1) WSF_TRACE1("WSF", "ERR", msg, var1)
242 /*! \brief 2 argument WSF error trace. */
243 #define WSF_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("WSF", "ERR", msg, var1, var2)
244 /*! \brief 3 argument WSF error trace. */
245 #define WSF_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("WSF", "ERR", msg, var1, var2, var3)
246 /*! \brief 0 argument WSF buffer allocation trace. */
247 #define WSF_TRACE_ALLOC0(msg)
248 /*! \brief 1 argument WSF buffer allocation trace. */
249 #define WSF_TRACE_ALLOC1(msg, var1)
250 /*! \brief 2 argument WSF buffer allocation trace. */
251 #define WSF_TRACE_ALLOC2(msg, var1, var2)
252 /*! \brief 3 argument WSF buffer allocation trace. */
253 #define WSF_TRACE_ALLOC3(msg, var1, var2, var3)
254 /*! \brief 0 argument WSF buffer free trace. */
255 #define WSF_TRACE_FREE0(msg)
256 /*! \brief 1 argument WSF buffer free trace. */
257 #define WSF_TRACE_FREE1(msg, var1)
258 /*! \brief 2 argument WSF buffer free trace. */
259 #define WSF_TRACE_FREE2(msg, var1, var2)
260 /*! \brief 3 argument WSF buffer free trace. */
261 #define WSF_TRACE_FREE3(msg, var1, var2, var3)
262 /*! \brief 0 argument WSF message trace. */
263 #define WSF_TRACE_MSG0(msg)
264 /*! \brief 1 argument WSF message trace. */
265 #define WSF_TRACE_MSG1(msg, var1)
266 /*! \brief 2 argument WSF message trace. */
267 #define WSF_TRACE_MSG2(msg, var1, var2)
268 /*! \brief 3 argument WSF message trace. */
269 #define WSF_TRACE_MSG3(msg, var1, var2, var3)
270 
271 /*! \brief 0 argument HCI info trace. */
272 #define HCI_TRACE_INFO0(msg) WSF_TRACE0("HCI", "INFO", msg)
273 /*! \brief 1 argument HCI info trace. */
274 #define HCI_TRACE_INFO1(msg, var1) WSF_TRACE1("HCI", "INFO", msg, var1)
275 /*! \brief 2 argument HCI info trace. */
276 #define HCI_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("HCI", "INFO", msg, var1, var2)
277 /*! \brief 3 argument HCI info trace. */
278 #define HCI_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("HCI", "INFO", msg, var1, var2, var3)
279 /*! \brief 0 argument HCI warning trace. */
280 #define HCI_TRACE_WARN0(msg) WSF_TRACE0("HCI", "WARN", msg)
281 /*! \brief 1 argument HCI warning trace. */
282 #define HCI_TRACE_WARN1(msg, var1) WSF_TRACE1("HCI", "WARN", msg, var1)
283 /*! \brief 2 argument HCI warning trace. */
284 #define HCI_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("HCI", "WARN", msg, var1, var2)
285 /*! \brief 3 argument HCI warning trace. */
286 #define HCI_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("HCI", "WARN", msg, var1, var2, var3)
287 /*! \brief 0 argument HCI error trace. */
288 #define HCI_TRACE_ERR0(msg) WSF_TRACE0("HCI", "ERR", msg)
289 /*! \brief 1 argument HCI error trace. */
290 #define HCI_TRACE_ERR1(msg, var1) WSF_TRACE1("HCI", "ERR", msg, var1)
291 /*! \brief 2 argument HCI error trace. */
292 #define HCI_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("HCI", "ERR", msg, var1, var2)
293 /*! \brief 3 argument HCI error trace. */
294 #define HCI_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("HCI", "ERR", msg, var1, var2, var3)
295 
296 #if !MBED_CONF_CORDIO_TRACE_HCI_PACKETS
297 /*! \brief HCI PDUMP on command. */
298 #define HCI_PDUMP_CMD(len, pBuf)
299 /*! \brief HCI PDUMP on event. */
300 #define HCI_PDUMP_EVT(len, pBuf)
301 /*! \brief HCI PDUMP on transmitted ACL message. */
302 #define HCI_PDUMP_TX_ACL(len, pBuf)
303 /*! \brief HCI PDUMP on Received ACL message. */
304 #define HCI_PDUMP_RX_ACL(len, pBuf)
305 /*! \brief HCI PDUMP on transmitted ISO message. */
306 #define HCI_PDUMP_TX_ISO(len, pBuf)
307 /*! \brief HCI PDUMP on Received ISO message. */
308 #define HCI_PDUMP_RX_ISO(len, pBuf)
309 #endif // !MBED_CONF_CORDIO_TRACE_HCI_PACKETS
310 
311 /*! \brief 0 argument DM info trace. */
312 #define DM_TRACE_INFO0(msg) WSF_TRACE0("DM", "INFO", msg)
313 /*! \brief 1 argument DM info trace. */
314 #define DM_TRACE_INFO1(msg, var1) WSF_TRACE1("DM", "INFO", msg, var1)
315 /*! \brief 2 argument DM info trace. */
316 #define DM_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("DM", "INFO", msg, var1, var2)
317 /*! \brief 3 argument DM info trace. */
318 #define DM_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("DM", "INFO", msg, var1, var2, var3)
319 /*! \brief 0 argument DM warning trace. */
320 #define DM_TRACE_WARN0(msg) WSF_TRACE0("DM", "WARN", msg)
321 /*! \brief 1 argument DM warning trace. */
322 #define DM_TRACE_WARN1(msg, var1) WSF_TRACE1("DM", "WARN", msg, var1)
323 /*! \brief 2 argument DM warning trace. */
324 #define DM_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("DM", "WARN", msg, var1, var2)
325 /*! \brief 3 argument DM warning trace. */
326 #define DM_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("DM", "WARN", msg, var1, var2, var3)
327 /*! \brief 0 argument DM error trace. */
328 #define DM_TRACE_ERR0(msg) WSF_TRACE0("DM", "ERR", msg)
329 /*! \brief 1 argument DM error trace. */
330 #define DM_TRACE_ERR1(msg, var1) WSF_TRACE1("DM", "ERR", msg, var1)
331 /*! \brief 2 argument DM error trace. */
332 #define DM_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("DM", "ERR", msg, var1, var2)
333 /*! \brief 3 argument DM error trace. */
334 #define DM_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("DM", "ERR", msg, var1, var2, var3)
335 /*! \brief 0 argument DM buffer allocation trace. */
336 #define DM_TRACE_ALLOC0(msg) WSF_TRACE0("DM", "ALLOC", msg)
337 /*! \brief 1 argument DM buffer allocation trace. */
338 #define DM_TRACE_ALLOC1(msg, var1) WSF_TRACE1("DM", "ALLOC", msg, var1)
339 /*! \brief 2 argument DM buffer allocation trace. */
340 #define DM_TRACE_ALLOC2(msg, var1, var2) WSF_TRACE2("DM", "ALLOC", msg, var1, var2)
341 /*! \brief 3 argument DM buffer allocation trace. */
342 #define DM_TRACE_ALLOC3(msg, var1, var2, var3) WSF_TRACE3("DM", "ALLOC", msg, var1, var2, var3)
343 /*! \brief 0 argument DM buffer free trace. */
344 #define DM_TRACE_FREE0(msg) WSF_TRACE0("DM", "FREE", msg)
345 /*! \brief 1 argument DM buffer free trace. */
346 #define DM_TRACE_FREE1(msg, var1) WSF_TRACE1("DM", "FREE", msg, var1)
347 /*! \brief 2 argument DM buffer free trace. */
348 #define DM_TRACE_FREE2(msg, var1, var2) WSF_TRACE2("DM", "FREE", msg, var1, var2)
349 /*! \brief 3 argument DM buffer free trace. */
350 #define DM_TRACE_FREE3(msg, var1, var2, var3) WSF_TRACE3("DM", "FREE", msg, var1, var2, var3)
351 
352 /*! \brief 0 argument L2C info trace. */
353 #define L2C_TRACE_INFO0(msg) WSF_TRACE0("L2C", "INFO", msg)
354 /*! \brief 1 argument L2C info trace. */
355 #define L2C_TRACE_INFO1(msg, var1) WSF_TRACE1("L2C", "INFO", msg, var1)
356 /*! \brief 2 argument L2C info trace. */
357 #define L2C_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("L2C", "INFO", msg, var1, var2)
358 /*! \brief 3 argument L2C info trace. */
359 #define L2C_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("L2C", "INFO", msg, var1, var2, var3)
360 /*! \brief 0 argument L2C warning trace. */
361 #define L2C_TRACE_WARN0(msg) WSF_TRACE0("L2C", "WARN", msg)
362 /*! \brief 1 argument L2C warning trace. */
363 #define L2C_TRACE_WARN1(msg, var1) WSF_TRACE1("L2C", "WARN", msg, var1)
364 /*! \brief 2 argument L2C warning trace. */
365 #define L2C_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("L2C", "WARN", msg, var1, var2)
366 /*! \brief 3 argument L2C warning trace. */
367 #define L2C_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("L2C", "WARN", msg, var1, var2, var3)
368 /*! \brief 0 argument L2C error trace. */
369 #define L2C_TRACE_ERR0(msg) WSF_TRACE0("L2C", "ERR", msg)
370 /*! \brief 1 argument L2C error trace. */
371 #define L2C_TRACE_ERR1(msg, var1) WSF_TRACE1("L2C", "ERR", msg, var1)
372 /*! \brief 2 argument L2C error trace. */
373 #define L2C_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("L2C", "ERR", msg, var1, var2)
374 /*! \brief 3 argument L2C error trace. */
375 #define L2C_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("L2C", "ERR", msg, var1, var2, var3)
376 
377 /*! \brief 0 argument ATT info trace. */
378 #define ATT_TRACE_INFO0(msg) WSF_TRACE0("ATT", "INFO", msg)
379 /*! \brief 1 argument ATT info trace. */
380 #define ATT_TRACE_INFO1(msg, var1) WSF_TRACE1("ATT", "INFO", msg, var1)
381 /*! \brief 2 argument ATT info trace. */
382 #define ATT_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("ATT", "INFO", msg, var1, var2)
383 /*! \brief 3 argument ATT info trace. */
384 #define ATT_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("ATT", "INFO", msg, var1, var2, var3)
385 /*! \brief 0 argument ATT warning trace. */
386 #define ATT_TRACE_WARN0(msg) WSF_TRACE0("ATT", "WARN", msg)
387 /*! \brief 1 argument ATT warning trace. */
388 #define ATT_TRACE_WARN1(msg, var1) WSF_TRACE1("ATT", "WARN", msg, var1)
389 /*! \brief 2 argument ATT warning trace. */
390 #define ATT_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("ATT", "WARN", msg, var1, var2)
391 /*! \brief 3 argument ATT warning trace. */
392 #define ATT_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("ATT", "WARN", msg, var1, var2, var3)
393 /*! \brief 0 argument ATT error trace. */
394 #define ATT_TRACE_ERR0(msg) WSF_TRACE0("ATT", "ERR", msg)
395 /*! \brief 1 argument ATT error trace. */
396 #define ATT_TRACE_ERR1(msg, var1) WSF_TRACE1("ATT", "ERR", msg, var1)
397 /*! \brief 2 argument ATT error trace. */
398 #define ATT_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("ATT", "ERR", msg, var1, var2)
399 /*! \brief 3 argument ATT error trace. */
400 #define ATT_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("ATT", "ERR", msg, var1, var2, var3)
401 
402 /*! \brief 0 argument EATT info trace. */
403 #define EATT_TRACE_INFO0(msg) WSF_TRACE0("EATT", "INFO", msg)
404 /*! \brief 1 argument EATT info trace. */
405 #define EATT_TRACE_INFO1(msg, var1) WSF_TRACE1("EATT", "INFO", msg, var1)
406 /*! \brief 2 argument EATT info trace. */
407 #define EATT_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("EATT", "INFO", msg, var1, var2)
408 /*! \brief 3 argument EATT info trace. */
409 #define EATT_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("EATT", "INFO", msg, var1, var2, var3)
410 /*! \brief 0 argument EATT warning trace. */
411 #define EATT_TRACE_WARN0(msg) WSF_TRACE0("EATT", "WARN", msg)
412 /*! \brief 1 argument EATT warning trace. */
413 #define EATT_TRACE_WARN1(msg, var1) WSF_TRACE1("EATT", "WARN", msg, var1)
414 /*! \brief 2 argument EATT warning trace. */
415 #define EATT_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("EATT", "WARN", msg, var1, var2)
416 /*! \brief 3 argument EATT warning trace. */
417 #define EATT_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("EATT", "WARN", msg, var1, var2, var3)
418 /*! \brief 0 argument EATT error trace. */
419 #define EATT_TRACE_ERR0(msg) WSF_TRACE0("EATT", "ERR", msg)
420 /*! \brief 1 argument EATT error trace. */
421 #define EATT_TRACE_ERR1(msg, var1) WSF_TRACE1("EATT", "ERR", msg, var1)
422 /*! \brief 2 argument EATT error trace. */
423 #define EATT_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("EATT", "ERR", msg, var1, var2)
424 /*! \brief 3 argument EATT error trace. */
425 #define EATT_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("EATT", "ERR", msg, var1, var2, var3)
426 
427 /*! \brief 0 argument SMP info trace. */
428 #define SMP_TRACE_INFO0(msg) WSF_TRACE0("SMP", "INFO", msg)
429 /*! \brief 1 argument SMP info trace. */
430 #define SMP_TRACE_INFO1(msg, var1) WSF_TRACE1("SMP", "INFO", msg, var1)
431 /*! \brief 2 argument SMP info trace. */
432 #define SMP_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("SMP", "INFO", msg, var1, var2)
433 /*! \brief 3 argument SMP info trace. */
434 #define SMP_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("SMP", "INFO", msg, var1, var2, var3)
435 /*! \brief 0 argument SMP warning trace. */
436 #define SMP_TRACE_WARN0(msg) WSF_TRACE0("SMP", "WARN", msg)
437 /*! \brief 1 argument SMP warning trace. */
438 #define SMP_TRACE_WARN1(msg, var1) WSF_TRACE1("SMP", "WARN", msg, var1)
439 /*! \brief 2 argument SMP warning trace. */
440 #define SMP_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("SMP", "WARN", msg, var1, var2)
441 /*! \brief 3 argument SMP warning trace. */
442 #define SMP_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("SMP", "WARN", msg, var1, var2, var3)
443 /*! \brief 0 argument SMP error trace. */
444 #define SMP_TRACE_ERR0(msg) WSF_TRACE0("SMP", "ERR", msg)
445 /*! \brief 1 argument SMP error trace. */
446 #define SMP_TRACE_ERR1(msg, var1) WSF_TRACE1("SMP", "ERR", msg, var1)
447 /*! \brief 2 argument SMP error trace. */
448 #define SMP_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("SMP", "ERR", msg, var1, var2)
449 /*! \brief 3 argument SMP error trace. */
450 #define SMP_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("SMP", "ERR", msg, var1, var2, var3)
451 
452 /*! \brief 0 argument App info trace. */
453 #define APP_TRACE_INFO0(msg) WSF_TRACE0("APP", "INFO", msg)
454 /*! \brief 1 argument App info trace. */
455 #define APP_TRACE_INFO1(msg, var1) WSF_TRACE1("APP", "INFO", msg, var1)
456 /*! \brief 2 argument App info trace. */
457 #define APP_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("APP", "INFO", msg, var1, var2)
458 /*! \brief 3 argument App info trace. */
459 #define APP_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("APP", "INFO", msg, var1, var2, var3)
460 /*! \brief 4 argument App info trace. */
461 #define APP_TRACE_INFO4(msg, var1, var2, var3, var4) \
462  WSF_TRACE4(INFO, APP, msg, var1, var2, var3, var4)
463 /*! \brief 5 argument App info trace. */
464 #define APP_TRACE_INFO5(msg, var1, var2, var3, var4, var5) \
465  WSF_TRACE5(INFO, APP, msg, var1, var2, var3, var4, var5)
466 /*! \brief 6 argument App info trace. */
467 #define APP_TRACE_INFO6(msg, var1, var2, var3, var4, var5, var6) \
468  WSF_TRACE6(INFO, APP, msg, var1, var2, var3, var4, var5, var6)
469 /*! \brief 7 argument App info trace. */
470 #define APP_TRACE_INFO7(msg, var1, var2, var3, var4, var5, var6, var7) \
471  WSF_TRACE7(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7)
472 /*! \brief 8 argument App info trace. */
473 #define APP_TRACE_INFO8(msg, var1, var2, var3, var4, var5, var6, var7, var8) \
474  WSF_TRACE8(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8)
475 /*! \brief 9 argument App info trace. */
476 #define APP_TRACE_INFO9(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) \
477  WSF_TRACE9(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9)
478 /*! \brief 12 argument App info trace. */
479 #define APP_TRACE_INFO12(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) \
480  WSF_TRACE12(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
481 /*! \brief 0 argument App warning trace. */
482 #define APP_TRACE_WARN0(msg) WSF_TRACE0("APP", "WARN", msg)
483 /*! \brief 1 argument App warning trace. */
484 #define APP_TRACE_WARN1(msg, var1) WSF_TRACE1("APP", "WARN", msg, var1)
485 /*! \brief 2 argument App warning trace. */
486 #define APP_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("APP", "WARN", msg, var1, var2)
487 /*! \brief 3 argument App warning trace. */
488 #define APP_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("APP", "WARN", msg, var1, var2, var3)
489 /*! \brief 0 argument App error trace. */
490 #define APP_TRACE_ERR0(msg) WSF_TRACE0("APP", "ERR", msg)
491 /*! \brief 1 argument App error trace. */
492 #define APP_TRACE_ERR1(msg, var1) WSF_TRACE1("APP", "ERR", msg, var1)
493 /*! \brief 2 argument App error trace. */
494 #define APP_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("APP", "ERR", msg, var1, var2)
495 /*! \brief 3 argument App error trace. */
496 #define APP_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("APP", "ERR", msg, var1, var2, var3)
497 
498 /*! \brief 0 argument LL info trace. */
499 #if (LL_TRACE_ENABLED == TRUE)
500 #define LL_TRACE_INFO0(msg) WSF_TRACE0("LL", "INFO", msg)
501 /*! \brief 1 argument LL info trace. */
502 #define LL_TRACE_INFO1(msg, var1) WSF_TRACE1("LL", "INFO", msg, var1)
503 /*! \brief 2 argument LL info trace. */
504 #define LL_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("LL", "INFO", msg, var1, var2)
505 /*! \brief 3 argument LL info trace. */
506 #define LL_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("LL", "INFO", msg, var1, var2, var3)
507 /*! \brief 0 argument LL warning trace. */
508 #define LL_TRACE_WARN0(msg) WSF_TRACE0("LL", "WARN", msg)
509 /*! \brief 1 argument LL warning trace. */
510 #define LL_TRACE_WARN1(msg, var1) WSF_TRACE1("LL", "WARN", msg, var1)
511 /*! \brief 2 argument LL warning trace. */
512 #define LL_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("LL", "WARN", msg, var1, var2)
513 /*! \brief 3 argument LL warning trace. */
514 #define LL_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("LL", "WARN", msg, var1, var2, var3)
515 /*! \brief 0 argument LL error trace. */
516 #define LL_TRACE_ERR0(msg) WSF_TRACE0("LL", "ERR", msg)
517 /*! \brief 1 argument LL error trace. */
518 #define LL_TRACE_ERR1(msg, var1) WSF_TRACE1("LL", "ERR", msg, var1)
519 /*! \brief 2 argument LL error trace. */
520 #define LL_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("LL", "ERR", msg, var1, var2)
521 /*! \brief 3 argument LL error trace. */
522 #define LL_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("LL", "ERR", msg, var1, var2, var3)
523 
524 /*! \brief 0 argument BBP warning trace. */
525 #define BBP_TRACE_INFO0(msg) WSF_TRACE0("BBP", "INFO", msg)
526 /*! \brief 1 argument BBP warning trace. */
527 #define BBP_TRACE_INFO1(msg, var1) WSF_TRACE1("BBP", "INFO", msg, var1)
528 /*! \brief 2 argument BBP warning trace. */
529 #define BBP_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("BBP", "INFO", msg, var1, var2)
530 /*! \brief 3 argument BBP info trace. */
531 #define BBP_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("BBP", "INFO", msg, var1, var2, var3)
532 /*! \brief 0 argument BBP warning trace. */
533 #define BBP_TRACE_WARN0(msg) WSF_TRACE0("BBP", "WARN", msg)
534 /*! \brief 1 argument BBP warning trace. */
535 #define BBP_TRACE_WARN1(msg, var1) WSF_TRACE1("BBP", "WARN", msg, var1)
536 /*! \brief 2 argument BBP warning trace. */
537 #define BBP_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("BBP", "WARN", msg, var1, var2)
538 /*! \brief 3 argument BBP warning trace. */
539 #define BBP_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("BBP", "WARN", msg, var1, var2, var3)
540 /*! \brief 0 argument BBP error trace. */
541 #define BBP_TRACE_ERR0(msg) WSF_TRACE0("BBP", "ERR", msg)
542 /*! \brief 1 argument BBP error trace. */
543 #define BBP_TRACE_ERR1(msg, var1) WSF_TRACE1("BBP", "ERR", msg, var1)
544 /*! \brief 2 argument BBP error trace. */
545 #define BBP_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("BBP", "ERR", msg, var1, var2)
546 /*! \brief 3 argument BBP error trace. */
547 #define BBP_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("BBP", "ERR", msg, var1, var2, var3)
548 #else /* LL_TRACE_ENABLED */
549 #define LL_TRACE_INFO0(msg)
550 /*! \brief 1 argument LL info trace. */
551 #define LL_TRACE_INFO1(msg, var1)
552 /*! \brief 2 argument LL info trace. */
553 #define LL_TRACE_INFO2(msg, var1, var2)
554 /*! \brief 3 argument LL info trace. */
555 #define LL_TRACE_INFO3(msg, var1, var2, var3)
556 /*! \brief 0 argument LL warning trace. */
557 #define LL_TRACE_WARN0(msg)
558 /*! \brief 1 argument LL warning trace. */
559 #define LL_TRACE_WARN1(msg, var1)
560 /*! \brief 2 argument LL warning trace. */
561 #define LL_TRACE_WARN2(msg, var1, var2)
562 /*! \brief 3 argument LL warning trace. */
563 #define LL_TRACE_WARN3(msg, var1, var2, var3)
564 /*! \brief 0 argument LL error trace. */
565 #define LL_TRACE_ERR0(msg)
566 /*! \brief 1 argument LL error trace. */
567 #define LL_TRACE_ERR1(msg, var1)
568 /*! \brief 2 argument LL error trace. */
569 #define LL_TRACE_ERR2(msg, var1, var2)
570 /*! \brief 3 argument LL error trace. */
571 #define LL_TRACE_ERR3(msg, var1, var2, var3)
572 
573 /*! \brief 0 argument BBP warning trace. */
574 #define BBP_TRACE_INFO0(msg)
575 /*! \brief 1 argument BBP warning trace. */
576 #define BBP_TRACE_INFO1(msg, var1)
577 /*! \brief 2 argument BBP warning trace. */
578 #define BBP_TRACE_INFO2(msg, var1, var2)
579 /*! \brief 3 argument BBP info trace. */
580 #define BBP_TRACE_INFO3(msg, var1, var2, var3)
581 /*! \brief 0 argument BBP warning trace. */
582 #define BBP_TRACE_WARN0(msg)
583 /*! \brief 1 argument BBP warning trace. */
584 #define BBP_TRACE_WARN1(msg, var1)
585 /*! \brief 2 argument BBP warning trace. */
586 #define BBP_TRACE_WARN2(msg, var1, var2)
587 /*! \brief 3 argument BBP warning trace. */
588 #define BBP_TRACE_WARN3(msg, var1, var2, var3)
589 /*! \brief 0 argument BBP error trace. */
590 #define BBP_TRACE_ERR0(msg)
591 /*! \brief 1 argument BBP error trace. */
592 #define BBP_TRACE_ERR1(msg, var1)
593 /*! \brief 2 argument BBP error trace. */
594 #define BBP_TRACE_ERR2(msg, var1, var2)
595 /*! \brief 3 argument BBP error trace. */
596 #define BBP_TRACE_ERR3(msg, var1, var2, var3)
597 #endif /* LL_TRACE_ENABLED */
598 
599 #if (AUD_TRACE_ENABLED == TRUE)
600 /*! \brief 0 argument AUD info trace. */
601 #define AUD_TRACE_INFO0(msg) WSF_TRACE0("AUD", "INFO", msg)
602 /*! \brief 1 argument AUD info trace. */
603 #define AUD_TRACE_INFO1(msg, var1) WSF_TRACE1("AUD", "INFO", msg, var1)
604 /*! \brief 2 argument AUD info trace. */
605 #define AUD_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("AUD", "INFO", msg, var1, var2)
606 /*! \brief 3 argument AUD info trace. */
607 #define AUD_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("AUD", "INFO", msg, var1, var2, var3)
608 /*! \brief 0 argument AUD warning trace. */
609 #define AUD_TRACE_WARN0(msg) WSF_TRACE0("AUD", "WARN", msg)
610 /*! \brief 1 argument AUD warning trace. */
611 #define AUD_TRACE_WARN1(msg, var1) WSF_TRACE1("AUD", "WARN", msg, var1)
612 /*! \brief 2 argument AUD warning trace. */
613 #define AUD_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("AUD", "WARN", msg, var1, var2)
614 /*! \brief 3 argument AUD warning trace. */
615 #define AUD_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("AUD", "WARN", msg, var1, var2, var3)
616 /*! \brief 0 argument AUD error trace. */
617 #define AUD_TRACE_ERR0(msg) WSF_TRACE0("AUD", "ERR", msg)
618 /*! \brief 1 argument AUD error trace. */
619 #define AUD_TRACE_ERR1(msg, var1) WSF_TRACE1("AUD", "ERR", msg, var1)
620 /*! \brief 2 argument AUD error trace. */
621 #define AUD_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("AUD", "ERR", msg, var1, var2)
622 /*! \brief 3 argument AUD error trace. */
623 #define AUD_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("AUD", "ERR", msg, var1, var2, var3)
624 #else /* AUD_TRACE_ENABLED */
625 /*! \brief 0 argument AUD info trace. */
626 #define AUD_TRACE_INFO0(msg)
627 /*! \brief 1 argument AUD info trace. */
628 #define AUD_TRACE_INFO1(msg, var1)
629 /*! \brief 2 argument AUD info trace. */
630 #define AUD_TRACE_INFO2(msg, var1, var2)
631 /*! \brief 3 argument AUD info trace. */
632 #define AUD_TRACE_INFO3(msg, var1, var2, var3)
633 /*! \brief 0 argument AUD warning trace. */
634 #define AUD_TRACE_WARN0(msg)
635 /*! \brief 1 argument AUD warning trace. */
636 #define AUD_TRACE_WARN1(msg, var1)
637 /*! \brief 2 argument AUD warning trace. */
638 #define AUD_TRACE_WARN2(msg, var1, var2)
639 /*! \brief 3 argument AUD warning trace. */
640 #define AUD_TRACE_WARN3(msg, var1, var2, var3)
641 /*! \brief 0 argument AUD error trace. */
642 #define AUD_TRACE_ERR0(msg)
643 /*! \brief 1 argument AUD error trace. */
644 #define AUD_TRACE_ERR1(msg, var1)
645 /*! \brief 2 argument AUD error trace. */
646 #define AUD_TRACE_ERR2(msg, var1, var2)
647 /*! \brief 3 argument AUD error trace. */
648 #define AUD_TRACE_ERR3(msg, var1, var2, var3)
649 #endif /* AUD_TRACE_ENABLED */
650 
651 /*! \brief 0 argument MESH info trace. */
652 #define MESH_TRACE_INFO0(msg) WSF_TRACE0("MESH", "INFO", msg)
653 /*! \brief 1 argument MESH info trace. */
654 #define MESH_TRACE_INFO1(msg, var1) WSF_TRACE1("MESH", "INFO", msg, var1)
655 /*! \brief 2 argument MESH info trace. */
656 #define MESH_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("MESH", "INFO", msg, var1, var2)
657 /*! \brief 3 argument MESH info trace. */
658 #define MESH_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("MESH", "INFO", msg, var1, var2, var3)
659 /*! \brief 0 argument MESH warning trace. */
660 #define MESH_TRACE_WARN0(msg) WSF_TRACE0("MESH", "WARN", msg)
661 /*! \brief 1 argument MESH warning trace. */
662 #define MESH_TRACE_WARN1(msg, var1) WSF_TRACE1("MESH", "WARN", msg, var1)
663 /*! \brief 2 argument MESH warning trace. */
664 #define MESH_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("MESH", "WARN", msg, var1, var2)
665 /*! \brief 3 argument MESH warning trace. */
666 #define MESH_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("MESH", "WARN", msg, var1, var2, var3)
667 /*! \brief 0 argument MESH error trace. */
668 #define MESH_TRACE_ERR0(msg) WSF_TRACE0("MESH", "ERR", msg)
669 /*! \brief 1 argument MESH error trace. */
670 #define MESH_TRACE_ERR1(msg, var1) WSF_TRACE1("MESH", "ERR", msg, var1)
671 /*! \brief 2 argument MESH error trace. */
672 #define MESH_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("MESH", "ERR", msg, var1, var2)
673 /*! \brief 3 argument MESH error trace. */
674 #define MESH_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("MESH", "ERR", msg, var1, var2, var3)
675 
676 /*! \brief 0 argument MMDL info trace. */
677 #define MMDL_TRACE_INFO0(msg) WSF_TRACE0("MMDL", "INFO", msg)
678 /*! \brief 1 argument MMDL info trace. */
679 #define MMDL_TRACE_INFO1(msg, var1) WSF_TRACE1("MMDL", "INFO", msg, var1)
680 /*! \brief 2 argument MMDL info trace. */
681 #define MMDL_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("MMDL", "INFO", msg, var1, var2)
682 /*! \brief 3 argument MMDL info trace. */
683 #define MMDL_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "INFO", msg, var1, var2, var3)
684 /*! \brief 0 argument MMDL warning trace. */
685 #define MMDL_TRACE_WARN0(msg) WSF_TRACE0("MMDL", "WARN", msg)
686 /*! \brief 1 argument MMDL warning trace. */
687 #define MMDL_TRACE_WARN1(msg, var1) WSF_TRACE1("MMDL", "WARN", msg, var1)
688 /*! \brief 2 argument MMDL warning trace. */
689 #define MMDL_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("MMDL", "WARN", msg, var1, var2)
690 /*! \brief 3 argument MMDL warning trace. */
691 #define MMDL_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "WARN", msg, var1, var2, var3)
692 /*! \brief 0 argument MMDL error trace. */
693 #define MMDL_TRACE_ERR0(msg) WSF_TRACE0("MMDL", "ERR", msg)
694 /*! \brief 1 argument MMDL error trace. */
695 #define MMDL_TRACE_ERR1(msg, var1) WSF_TRACE1("MMDL", "ERR", msg, var1)
696 /*! \brief 2 argument MMDL error trace. */
697 #define MMDL_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("MMDL", "ERR", msg, var1, var2)
698 /*! \brief 3 argument MMDL error trace. */
699 #define MMDL_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "ERR", msg, var1, var2, var3)
700 
701 /*! \brief Enable LL trace. */
702 #if (WSF_TRACE_ENABLED == TRUE) || (WSF_TOKEN_ENABLED == TRUE)
703 #define LL_TRACE_ENABLE(ena) WsfTraceEnable(ena)
704 #else
705 #define LL_TRACE_ENABLE(ena)
706 #endif
707 
708 /*! \} */ /* WSF_TRACE_API */
709 
710 #ifdef __cplusplus
711 };
712 #endif
713 
714 #endif /* WSF_TRACE_H */
void WsfTraceEnable(bool_t enable)
Enable trace messages.
void(* WsfBt4TraceCback_t)(const char *pStr, va_list args)
BT4 Platform trace callback.
Definition: wsf_trace.h:72
void WsfToken(uint32_t tok, uint32_t var)
Output tokenized message.
bool_t(* WsfTraceHandler_t)(const uint8_t *pBuf, uint32_t len)
Token event handler.
Definition: wsf_trace.h:69
void WsfTraceRegisterHandler(WsfTraceHandler_t traceCback)
Register trace handler.
void WsfTrace(const char *pStr,...)
Output trace message.
bool_t WsfTokenService(void)
Service the trace ring buffer.
void WsfTraceRegister(WsfBt4TraceCback_t cback)
Register BT4 platform trace callback function.
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.