pdcomm_secs_payload
Function
Copies the raw payload bytes of a primitive item.
PdcommStatus pdcomm_secs_payload(const PdcommSecsItem *handle, uint8_t *output, size_t capacity, size_t *required)Numeric elements are returned big-endian, exactly as on the wire. A List has no payload.
Parameters
| Name | Description |
|---|---|
handle | Live primitive item. |
output | Destination. May be NULL when the payload is empty or for a size query with capacity 0. |
capacity | Size of output in bytes. |
required | Receives the payload length. It stays 0 when handle is NULL or a List. Must not be NULL. |
Returns
#PDCOMM_OK when the payload was copied; #PDCOMM_BUFFER_TOO_SMALL when capacity is smaller than *required (output untouched); #PDCOMM_INVALID_ARGUMENT when required or handle is NULL, handle is a List, or output is NULL for a nonempty payload with sufficient capacity; #PDCOMM_INTERNAL_ERROR when a panic was contained.
Notes
- Thread safety: read calls on the same item may run concurrently; destruction must be synchronized with them.