sensor_enable_event()

Register a sigevent to be signalled when an event occurs

Synopsis:

#include <sensor/sensor_api.h>
sensor_error_t sensor_enable_event(sensor_handle_t handle,
                                   sensor_event_t event,
                                   sensor_eventmode_t mode,
                                   sensor_eventkey_t *key,
                                   struct sigevent *sigev)

Arguments:

handle
The handle that's returned from calling sensor_open().
event
The event with sensor data to use.
mode
The mode of the callback (read-only or read-write).
key
This argument is populated with unique key associated with the event.
sigev
The sigevent to signal when the event occurs

Library:

libsensor

Description:

The mode is ignored for status events. For more information, see the note in sensor_register_data_callback() for limitations for the data events.

Returns:

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