sensor_eventmode_t

Updated: April 19, 2023

Event buffering modes

Synopsis:

#include <sensor/sensor_api.h>
typedef enum {
    SENSOR_EVENTMODE_READONLY,
    SENSOR_EVENTMODE_READWRITE,
    SENSOR_EVENTMODE_READWRITE_EXCLUSIVE
} sensor_eventmode_t;

Data:

SENSOR_EVENTMODE_READONLY
Read-only access to the buffers.
SENSOR_EVENTMODE_READWRITE
Read-write access to the buffers.

When you use this mode, you can modify buffers prior to delivery to callback functions or read-only event consumers.

SENSOR_EVENTMODE_READWRITE_EXCLUSIVE
Exclusive read-write access to the buffers.

With this mode, the buffers are mapped read/write but the modified buffers are not shared with other event consumers.

Library:

libsensor

Description:

The event buffering mode dictates the behavior of the buffer argument of sensor_get_buffer() if using events. For callbacks, it affects the behavior of the buffers passed to them.