Struct Message

Struct Documentation

struct Message

CAN message with message counter, CRC byte and signals.

Public Functions

template<typename FrameData>
void encode(FrameData &frame)

Encode signals into frame bits.

Parameters:

frame – Frame byte array

template<typename FrameData>
void validate(FrameData &frame)

Validate frame by setting CRC and increasing message counter.

Parameters:

frame – Frame byte array

template<typename FrameData>
bool decode(const FrameData &frame)

Decode frame bits into signals.

Parameters:

frame – Frame byte array

template<typename FrameData>
bool valid(const FrameData &frame)

Check frame by comparing CRC and message counter difference.

Parameters:

frame – Frame byte array

Public Members

std::string name
uint8_t length = {8}
uint8_t crc_index = {7}
MessageCounter message_counter
std::unordered_map<std::string, Signal> signals