sensor_devstatus_t

Updated: April 19, 2023

Status of the sensor device

Synopsis:

#include <sensor/sensor_api.h>
typedef enum {
    SENSOR_STATUS_IDLE = 0,
    SENSOR_STATUS_DISCONNECTED,
    SENSOR_STATUS_CONNECTED,
    SENSOR_STATUS_STREAMING = 5,
    SENSOR_STATUS_RECORDING_ERROR,
    SENSOR_STATUS_NOSPACE_ERROR = 8,
    SENSOR_STATUS_QUEUE_OVERFLOW = 20,
    SENSOR_STATUS_STREAMING_ACTIVE = 27,
    SENSOR_STATUS_BUFFER_UNDERFLOW,
    SENSOR_STATUS_STREAMING_ERROR,
    SENSOR_STATUS_BUFFER_AVAILABLE,
    SENSOR_STATUS_PUBLISHER_DISCONNECTED,
    SENSOR_STATUS_DELAYED_START_FAILURE,
    SENSOR_STATUS_DELAYED_STOP_FAILURE,
    SENSOR_STATUS_PHYSICAL_REMOVAL = 34
} sensor_devstatus_t;

Data:

SENSOR_STATUS_IDLE
The sensor is idle with no users connected to it.
SENSOR_STATUS_DISCONNECTED
The application has disconnected from the sensor.
SENSOR_STATUS_CONNECTED
An application has connected to the sensor.
SENSOR_STATUS_STREAMING
The sensor has started streaming.
SENSOR_STATUS_RECORDING_ERROR
The recording has stopped due to an error encountered.
SENSOR_STATUS_NOSPACE_ERROR
The recording has stopped because there's no more disk space available.
SENSOR_STATUS_QUEUE_OVERFLOW
A buffer was dropped internally because the application is unable to process a callback in time or an internal error occurred.

The uint16_t extra argument contains the sensor_eventkey_t associated with the buffer queue that overflowed.

SENSOR_STATUS_STREAMING_ACTIVE
Streaming is active and working properly.

This is sent initially after entering SENSOR_STATUS_STREAMING to indicate that we have received our first stream buffer. This status is also sent after recovery from an error such as SENSOR_STATUS_BUFFER_UNDERFLOW or SENSOR_STATUS_STREAMING_ERROR to indicate that streaming is back to working as expected.

SENSOR_STATUS_BUFFER_UNDERFLOW
The stream is out of buffers and can't stream any further buffers until a buffer is freed.

After recovery occurs, a SENSOR_STATUS_STREAMING_ACTIVE indication is given. Typically, this status occurs if a user is holding on to more buffers than the number of user buffers specified in the configuration.

SENSOR_STATUS_STREAMING_ERROR
An unexpected error was encountered while streaming.

This error prevents the sensor from streaming any more data. After recovery occurs, a SENSOR_STATUS_STREAMING_ACTIVE indication will be given.

SENSOR_STATUS_BUFFER_AVAILABLE
For sensor interim data, this indicates that a buffer for the publisher is now available by calling sensor_interim_data_alloc().

For more information, see sensor_interim_data.h.

SENSOR_STATUS_PUBLISHER_DISCONNECTED
For sensor interim data, this indicates to the subscriber that the publisher has disconnected.

No new buffers will be published. After having processed any pending buffers, the subscriber should close its handle as soon as possible after having received this status event.

SENSOR_STATUS_DELAYED_START_FAILURE
An error was encountered while doing a delayed stream start.

This can occur if you call sensor_start() with a non-NULL time parameter and a failure is encountered while trying to start streaming the sensor at the desired time. The result of this error is that streaming of the sensor was not started successfully.

SENSOR_STATUS_DELAYED_STOP_FAILURE
An error was encountered while doing a delayed stream stop.

This can occur if you call sensor_stop() with a non-NULL time parameter and a failure is encountered while trying to stop streaming the sensor at the desired time. The result of this error is that streaming of the sensor is still active.

SENSOR_STATUS_PHYSICAL_REMOVAL
The device has been physically disconnected from the platform.

The application should immediately call sensor_close() on the sensor_handle_t received from sensor_open(). After the application calls sensor_close(), it may wait for the sensor to be reconnected. The sensor will be returned from a call to sensor_get_supported_sensors(), at which point the application can call sensor_open() again.

Library:

libsensor

Description:

These values are delivered to your status callback functions whenever the state of the sensor changes. You can also call sensor_get_status_details() to get the state information.