sensor_register_status_callback()

Updated: April 19, 2023

Register a status callback for an event

Synopsis:

#include <sensor/sensor_api.h>
sensor_error_t sensor_register_status_callback(sensor_handle_t handle,
                                               sensor_event_t event,
                                               sensor_status_callback_t callback,
                                               void *arg)

Arguments:

handle
The handle that's returned from calling sensor_open().
event
The event of interest for the callback, as a sensor_event_t value.
callback
The callback function to call when the status event occurs, as a sensor_status_callback_t value.
arg
The user argument to use as part of the callback.

Library:

libsensor

Description:

This function registers a status callback for the specified event. Status events are only delivered when a change is observed.

Returns:

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