Updated: October 28, 2024 |
Callback function that receives data
#include <sensor/sensor_api.h>
typedef bool(* sensor_data_callback_t)(sensor_handle_t handle, sensor_buffer_t *buf, void *arg);
This callback function is invoked when data is available for the sensor event that you've registered for. Register a callback function of this type by calling sensor_register_data_callback().
Return true if you want the Sensor library to free the received buffer upon return of this function; return false if your application will free the buffer at a later time using sensor_return_buffer().