13 #ifndef TRC_STREAM_PORT_H
14 #define TRC_STREAM_PORT_H
18 #include <trcStreamPortConfig.h>
24 #define TRC_USE_INTERNAL_BUFFER (TRC_CFG_STREAM_PORT_USE_INTERNAL_BUFFER)
31 #define TRC_STREAM_PORT_BUFFER_SIZE ((((TRC_CFG_STREAM_PORT_BUFFER_SIZE) + sizeof(TraceUnsignedBaseType_t) - 1) / sizeof(TraceUnsignedBaseType_t)) * sizeof(TraceUnsignedBaseType_t))
35 #if (TRC_USE_INTERNAL_BUFFER)
36 uint8_t buffer[(TRC_STREAM_PORT_BUFFER_SIZE)];
38 TraceUnsignedBaseType_t buffer[1];
42 int32_t prvTraceTcpWrite(
void* pvData, uint32_t uiSize, int32_t* piBytesWritten);
44 int32_t prvTraceTcpRead(
void* pvData, uint32_t uiSize, int32_t* piBytesRead);
48 #define xTraceStreamPortAllocate(uiSize, ppvData) ((void)(uiSize), xTraceStaticBufferGet(ppvData))
50 #if (TRC_USE_INTERNAL_BUFFER == 1)
52 #define xTraceStreamPortCommit xTraceInternalEventBufferPush
55 #define xTraceStreamPortCommit xTraceStreamPortWriteData
58 #define xTraceStreamPortWriteData(pvData, uiSize, piBytesWritten) (prvTraceTcpWrite(pvData, uiSize, piBytesWritten) == 0 ? TRC_SUCCESS : TRC_FAIL)
60 #define xTraceStreamPortReadData(pvData, uiSize, piBytesRead) (prvTraceTcpRead(pvData, uiSize, piBytesRead) == 0 ? TRC_SUCCESS : TRC_FAIL)
62 #define xTraceStreamPortOnEnable(uiStartOption) ((void)(uiStartOption), TRC_SUCCESS)
64 #define xTraceStreamPortOnDisable() (TRC_SUCCESS)
66 #define xTraceStreamPortOnTraceBegin() (TRC_SUCCESS)
68 traceResult xTraceStreamPortOnTraceEnd(
void);