dmi_decoder_get_binary

Synopsis

#include <opendmi/decoder.h>

bool dmi_decoder_get_binary(
        dmi_decoder_t *decoder,
        size_t         length,
        dmi_binary_t  *value);

Description

The dmi_decoder_get_binary function refers to length bytes of the structure at the current position and advances the cursor.

The bytes belong to the buffer the structure has been decoded from and stay valid for as long as it holds them, which is how a structure carries whatever data the framework does not decode without holding a copy of it.

Parameters

decoder

Decoder to read from.

length

Number of the bytes to refer to, may be zero.

value

Binary data descriptor.

Return value

true on success, false if there are not enough bytes remaining, or on error.

Errors

DMI_ERROR_ARGUMENT_NULL

value is nullptr.