EduArt Sensor Ring Library 4.0.0
Loading...
Searching...
No Matches
DeviceState.hpp File Reference

Unified device state enum covering lifecycle and runtime health. More...

#include <ostream>
#include <string>
#include "sensorring/platform/SensorringExport.hpp"
Include dependency graph for DeviceState.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  eduart::sensorring::device::DeviceState {
  Undefined , Initialized , Idle , Ok ,
  ReceiveError , ProcessError , Error , Shutdown
}
 Unified lifecycle and runtime state of a device. More...

Functions

SENSORRING_EXPORT std::string eduart::sensorring::device::toString (DeviceState state) noexcept
 Convert a DeviceState value to its string representation.
SENSORRING_EXPORT std::ostream & eduart::sensorring::device::operator<< (std::ostream &os, DeviceState state) noexcept
 Output stream operator for DeviceState.

Detailed Description

Unified device state enum covering lifecycle and runtime health.

Author
EduArt Robotik GmbH
Date
2025-02-09

Enumeration Type Documentation

◆ DeviceState

Unified lifecycle and runtime state of a device.

Covers both the device lifecycle (Undefined → Initialized → Idle → Shutdown) and runtime health (Ok, ReceiveError, ProcessError, Error).

Enumerator
Undefined 

Initial state; device not yet configured.

Initialized 

Device has been configured but not yet started.

Idle 

Device is running but not actively measuring.

Ok 

Device is measuring and data is valid.

ReceiveError 

A CAN receive error was detected.

ProcessError 

An error occurred while processing received data.

Error 

General unrecoverable device error.

Shutdown 

Device has been shut down and should not be used.

Function Documentation

◆ operator<<()

SENSORRING_EXPORT std::ostream & eduart::sensorring::device::operator<< ( std::ostream & os,
DeviceState state )
noexcept

Output stream operator for DeviceState.

Parameters
[in]osOutput stream to write to.
[in]stateThe state to print.
Returns
The stream with the state name written out.

◆ toString()

SENSORRING_EXPORT std::string eduart::sensorring::device::toString ( DeviceState state)
noexcept

Convert a DeviceState value to its string representation.

Parameters
[in]stateThe state to convert.
Returns
Name of the state as a string.