1 /*
2 * Percepio Trace Recorder for Tracealyzer v4.6.6
3 * Copyright 2021 Percepio AB
4 * www.percepio.com
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8 
9 /**
10  * @file
11  *
12  * @brief Public trace string APIs.
13  */
14 
15 #ifndef TRC_STRING_H
16 #define TRC_STRING_H
17 
18 #if (TRC_USE_TRACEALYZER_RECORDER == 1)
19 
20 #if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
21 
22 #include <trcTypes.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /**
29  * @defgroup trace_string_apis Trace String APIs
30  * @ingroup trace_recorder_apis
31  * @{
32  */
33 
34 /**
35  * @brief Registers a trace string.
36  *
37  * This routine registers a strings in the recorder, e.g. for names of user
38  * event channels.
39  *
40  * Example:
41  *	 TraceStringHandle_t myEventHandle;
42  *	 xTraceStringRegister("MyUserEvent", &myEventHandle);
43  *	 ...
44  *	 xTracePrintF(myEventHandle, "My value is: %d", myValue);
45  *
46  * @param[in] szString String.
47  * @param[out] pString Pointer to uninitialized trace string.
48  *
49  * @retval TRC_FAIL Failure
50  * @retval TRC_SUCCESS Success
51  */
52 traceResult xTraceStringRegister(const char *szString, TraceStringHandle_t* pString);
53 
54 /**
55  * @brief Registers a trace string.
56  *
57  * @deprecated Remains for backward compability with pre v4.6 versions
58  * of the recorder.
59  *
60  * @param[in] name Name.
61  *
62  * @return TraceStringHandle_t
63  */
64 TraceStringHandle_t xTraceRegisterString(const char *name);
65 
66 /** @} */
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */
73 
74 #endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */
75 
76 #endif /* TRC_STRING_H */
77