pdcomm_opcua_buffer_copy
Function
Copies the bytes of a buffer handle.
int32_t pdcomm_opcua_buffer_copy(pdcomm_opcua_handle buffer, uint8_t *output, size_t capacity, size_t *required)Works for every buffer: a response, a discovery result, a local address or a DataValue. Pass a null output and zero capacity to query the size. The bytes have no terminator.
Parameters
| Name | Description |
|---|---|
buffer | Buffer handle. |
output | Destination, or null when capacity is zero. |
capacity | Size of output in bytes. |
required | Receives the complete size in bytes; must not be null. |
Returns
#PDCOMM_OPCUA_OK, #PDCOMM_OPCUA_BUFFER_TOO_SMALL (the output is unchanged), #PDCOMM_OPCUA_INVALID_INPUT or #PDCOMM_OPCUA_INVALID_HANDLE.
Notes
- Buffers are immutable; copy them from any thread.