Go to the documentation of this file.
6 #include <ethercattype.h>
49 op = EC_STATE_OPERATIONAL,
81 explicit operator bool() =
delete;
92 return "EC_STATE_NONE";
94 return "EC_STATE_INIT";
96 return "EC_STATE_PRE_OP";
98 return "EC_STATE_BOOT";
100 return "EC_STATE_SAFE_OP";
102 return "EC_STATE_OPERATIONAL";
103 case Value::safeOpError:
104 return "EC_STATE_SAFE_OP + EC_STATE_ERROR";
106 return "UNKNOWN_STATE";
112 stream << rhs.
c_str();
120 fromUInt16(std::uint16_t state)
126 case EC_STATE_PRE_OP:
130 case EC_STATE_SAFE_OP:
131 return Value::safeOp;
132 case EC_STATE_OPERATIONAL:
134 case EC_STATE_SAFE_OP + EC_STATE_ERROR:
135 return Value::safeOpError;
137 return Value::invalid;
constexpr const char * c_str() const
constexpr EtherCATState(std::uint16_t state)
Construct a new EtherCATState from a std::uint16_t (e.g.
This class is a wrapper around an enum containing the different EtherCAT states.
constexpr EtherCATState(Value state)
Construct a new EtherCATState from another EtherCATState.
@ invalid
State is not valid, e.g. if a request for reading the actual bus state failed.
@ safeOpError
Safe-operational state after an error has happend.
Value
The EtherCAT state enum.
@ preOp
Pre-operational state.
friend std::ostream & operator<<(std::ostream &stream, const EtherCATState &rhs)
@ safeOp
Safe-operational state.
@ init
Initial state after switch a EtherCAT slave on.