Skip to content
Start free evaluation

pdcomm_secs1_event_body

Function

Copies the body of an inbound event.

PdcommStatus pdcomm_secs1_event_body(const PdcommSecs1Event *event, uint8_t *output, size_t capacity, size_t *required)

Declared in: #include <pdcomm_secs1.h>

Other event kinds have an empty body. The copy is atomic: a short buffer is left untouched. Pass NULL and a capacity of zero to query the size.

Parameters

NameDescription
eventLive event.
outputDestination. May be NULL when the body is empty or for a size query with capacity 0.
capacitySize of output in bytes.
requiredReceives the body length. Must not be NULL.

Returns

#PDCOMM_OK when the body was copied; #PDCOMM_BUFFER_TOO_SMALL when capacity is smaller than *required (output untouched); #PDCOMM_INVALID_ARGUMENT when event or required is NULL (*required is not written), or output is NULL for a nonempty body with sufficient capacity.

Notes

  • Thread safety: may run concurrently with other reads of the same event on any thread; destruction must be synchronized.