sensor_interim_data_alloc()

Updated: October 26, 2022

Allocate an empty buffer for publishing interim data

Synopsis:

#include <sensor/sensor_interim_data.h>
sensor_error_t sensor_interim_data_alloc(sensor_handle_t handle,
                                         sensor_buffer_t *buffer,
                                         bool block)

Arguments:

handle
The handle that's returned from calling sensor_interim_data_open().
buffer
On success, the memory pointed to by this argument gets filled with information about the buffer that was allocated.
block
Whether to block until a buffer becomes available.

Library:

libsensor

Description:

This function attempts to allocate an empty buffer to be used for publishing interim data. If the call is non-blocking, SENSOR_ENODATA is returned if no free buffers are available at the time. If the call is blocking, it won't return until a buffer is available.

Returns:

SENSOR_EOK when the function successfully completes, otherwise another sensor_error_t value that provides the reason that the call failed.