24#ifndef LELY_IO2_CAN_ERR_HPP_
25#define LELY_IO2_CAN_ERR_HPP_
64operator~(CanError rhs) {
65 return static_cast<CanError
>(~static_cast<int>(rhs));
69operator&(CanError lhs, CanError rhs) {
70 return static_cast<CanError
>(
static_cast<int>(lhs) &
static_cast<int>(rhs));
74operator^(CanError lhs, CanError rhs) {
75 return static_cast<CanError>(
static_cast<int>(lhs) ^
static_cast<int>(rhs));
79operator|(CanError lhs, CanError rhs) {
80 return static_cast<CanError>(
static_cast<int>(lhs) |
static_cast<int>(rhs));
84operator&=(CanError& lhs, CanError rhs) {
85 return lhs = lhs & rhs;
89operator^=(CanError& lhs, CanError rhs) {
90 return lhs = lhs ^ rhs;
94operator|=(CanError& lhs, CanError rhs) {
95 return lhs = lhs | rhs;
@ CAN_ERROR_FORM
A form error.
@ CAN_ERROR_BIT
A single bit error.
@ CAN_ERROR_STUFF
A bit stuffing error.
@ CAN_ERROR_ACK
An acknowledgment error.
@ CAN_ERROR_CRC
A CRC sequence error.
@ CAN_ERROR_OTHER
One or more other errors.
@ CAN_STATE_BUSOFF
The bus off state (TX/RX error count >= 256).
@ CAN_STATE_SLEEPING
The device is in sleep mode.
@ CAN_STATE_PASSIVE
The error passive state (TX/RX error count < 256).
@ CAN_STATE_STOPPED
The device is stopped.
@ CAN_STATE_ACTIVE
The error active state (TX/RX error count < 128).
CanError
The error flags of a CAN bus, which are not mutually exclusive.
@ OTHER
One or more other errors.
@ ACK
An acknowledgment error.
@ CRC
A CRC sequence error.
@ STUFF
A bit stuffing error.
CanState
The states of a CAN node, depending on the TX/RX error count.
@ STOPPED
The device is stopped.
@ ACTIVE
The error active state (TX/RX error count < 128).
@ BUSOFF
The bus off state (TX/RX error count >= 256).
@ SLEEPING
The device is in sleep mode.
@ PASSIVE
The error passive state (TX/RX error count < 256).
This header file is part of the I/O library; it contains CAN bus error definitions.