mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Communication: Add missing CAN error types
This commit is contained in:
committed by
Kyle Schwarz
parent
a22791c9e0
commit
c5ba2d8d32
@@ -0,0 +1,40 @@
|
||||
#ifndef __CANERRORMESSAGE_H_
|
||||
#define __CANERRORMESSAGE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
enum class CANErrorCode : uint8_t
|
||||
{
|
||||
NoError = 0,
|
||||
StuffError = 1,
|
||||
FormError = 2,
|
||||
AckError = 3,
|
||||
Bit1Error = 4,
|
||||
Bit0Error = 5,
|
||||
CRCError = 6,
|
||||
NoChange = 7
|
||||
};
|
||||
class CANErrorMessage : public Message {
|
||||
public:
|
||||
CANErrorMessage() : Message(Type::CANError) {}
|
||||
Network network;
|
||||
uint8_t transmitErrorCount;
|
||||
uint8_t receiveErrorCount;
|
||||
bool busOff;
|
||||
bool errorPassive;
|
||||
bool errorWarn;
|
||||
CANErrorCode dataErrorCode;
|
||||
CANErrorCode errorCode;
|
||||
};
|
||||
|
||||
using CANErrorCountMessage = CANErrorMessage;
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user