Skip to content
Start free evaluation

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)

Declared in: #include <pdcomm/opcua/pdcomm_opcua.h>

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

NameDescription
bufferBuffer handle.
outputDestination, or null when capacity is zero.
capacitySize of output in bytes.
requiredReceives 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.