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)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
| Name | Description |
|---|---|
event | Live event. |
output | Destination. May be NULL when the body is empty or for a size query with capacity 0. |
capacity | Size of output in bytes. |
required | Receives 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.