Updated: October 28, 2024 |
Status of the sensor device
#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;
The uint16_t extra argument contains the sensor_eventkey_t associated with the buffer queue that overflowed.
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.
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.
This error prevents the sensor from streaming any more data. After recovery occurs, a SENSOR_STATUS_STREAMING_ACTIVE indication will be given.
For more information, see sensor_interim_data.h.
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.
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.
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.
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.
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.