Updated: October 28, 2024 |
Retrieve the next available data packet
#include <sensor/external_sensor_api.h>
typedef int(* get_packet_func_t)(void *handle, void *bufferIn, sensor_flags_t *flags, void **bufferOut, int64_t *timestamp);
This is the main interface between the upper layer thread and the sensor. This one operation both enqueues empty buffers for use by the sensor (e.g., to pipeline), and expects to receive filled buffers from the sensor. If the sensor's hardware requires pipelining, it's expected that this function doesn't return any new data packet until enough empty buffers have been supplied.
This function call is blocking when the sensor is fully pipelined.
SENSOR_EOK when the function successfully completes; otherwise another sensor_error_t value that provides the reason that the call failed.