Percepio Trace Recorder v4.11.0
Loading...
Searching...
No Matches
trcStreamPort.h
1/*
2 * Trace Recorder for Tracealyzer v4.11.0
3 * Copyright 2025 Percepio AB
4 * www.percepio.com
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 *
8 * The interface definitions for trace streaming ("stream ports").
9 * This "stream port" sets up the recorder to use UDP as streaming channel.
10 * The example is for lwIP.
11 */
12
13#ifndef TRC_STREAM_PORT_H
14#define TRC_STREAM_PORT_H
15
16#include <stdint.h>
17#include <trcTypes.h>
18#include <trcStreamPortConfig.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24typedef struct TraceStreamPortBuffer /* Aligned */
25{
26 TraceUnsignedBaseType_t dummy;
27} TraceStreamPortBuffer_t;
28
29#define TRC_STREAM_PORT_MULTISTREAM_SUPPORT
30
31int32_t prvTraceUdpWrite(void* pvData, uint32_t uiSize, uint32_t uiChannel, int32_t* piBytesWritten);
32
33int32_t prvTraceUdpRead(void* pvData, uint32_t uiSize, int32_t* piBytesRead);
34
35traceResult xTraceStreamPortInitialize(TraceStreamPortBuffer_t* pxBuffer);
36
37#define xTraceStreamPortWriteData(pvData, uiSize, uiChannel, piBytesWritten) (prvTraceUdpWrite(pvData, uiSize, uiChannel, piBytesWritten) == 0 ? TRC_SUCCESS : TRC_FAIL)
38
39#define xTraceStreamPortReadData(pvData, uiSize, piBytesRead) (prvTraceUdpRead(pvData, uiSize, piBytesRead) == 0 ? TRC_SUCCESS : TRC_FAIL)
40
41#define xTraceStreamPortOnEnable(uiStartOption) ((void)(uiStartOption), TRC_SUCCESS)
42
43#define xTraceStreamPortOnDisable() (TRC_SUCCESS)
44
45#define xTraceStreamPortOnTraceBegin() (TRC_SUCCESS)
46
47traceResult xTraceStreamPortOnTraceEnd(void);
48
49#ifdef __cplusplus
50}
51#endif
52
53#endif /* TRC_STREAM_PORT_H */
54
A structure representing the trace stream port buffer.
Definition trcStreamPort.h:71