sensor_return_buffer()

Updated: April 19, 2023

Return the memory for a data buffer that was retrieved

Synopsis:

#include <sensor/sensor_api.h>
sensor_error_t sensor_return_buffer(sensor_handle_t handle,
                                    sensor_buffer_t *buffer)

Arguments:

handle
The handle that's returned from calling sensor_open().
buffer
A pointer to the buffer to free.

Library:

libsensor

Description:

Calling this function is required to return the memory for any buffers retrieved through a call to sensor_get_buffer(). It is also required for data callbacks that return false to indicate that their received buffer must be released later.

Returns:

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