Processing of information contained in the CAN Aerospace header. More...
#include <canaerometadata.h>
Public Member Functions | |
CanAeroMetadata (can_Id_t can_id, uint8_t node_id=SCS_NODE_ID) | |
can_Id_t | id () const |
AS_IDwidth | isId29 () const |
uint8_t | increaseMessageCode () const |
bool | checkMessageCode (uint8_t new_code) const |
uint8_t | nodeId () const |
void | setNodeId (uint8_t node_id) const |
bool | operator< (const CanAeroMetadata &rhs) const |
Processing of information contained in the CAN Aerospace header.
Primary key is the CAN Id with either 11 or 29 bits. The node id identifies the sender of normal operation data. The message code for normal operation data is incremented with every transmission. It counts from 0 to 255 and then wraps around to 0 again. When incoming data is found to have inconsistent counting, a packet loss information is reported to the Logger, the packet is processed nontheless.
SCS::CanAeroMetadata::CanAeroMetadata | ( | can_Id_t | can_id, |
uint8_t | node_id = SCS_NODE_ID |
||
) |
can_id | CAN identifier |
id29 | whether identifier is 11 or 29 bit long |
node_id | sending node for normal operation data |
bool SCS::CanAeroMetadata::checkMessageCode | ( | uint8_t | new_code | ) | const |
Check if message code of incoming message is consistent, i.e. it is incremented by one from the previously stored code.
new_code | message code received |
can_Id_t SCS::CanAeroMetadata::id | ( | ) | const |
uint8_t SCS::CanAeroMetadata::increaseMessageCode | ( | ) | const |
AS_IDwidth SCS::CanAeroMetadata::isId29 | ( | ) | const |
uint8_t SCS::CanAeroMetadata::nodeId | ( | ) | const |
node id of the transmitting node
bool SCS::CanAeroMetadata::operator< | ( | const CanAeroMetadata & | rhs | ) | const |
To be used as key in sets or maps, CAN data are sorted according to their id. The id remains const over the lifetime of an instance.
void SCS::CanAeroMetadata::setNodeId | ( | uint8_t | node_id | ) | const |
change node id (after re-assigning of node-ids)