Public Member Functions

SCS::CanAeroMetadata Class Reference

Processing of information contained in the CAN Aerospace header. More...

#include <canaerometadata.h>

List of all members.

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

Detailed Description

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.

Author:
(c) 2008-2010 by Philipp Münzel
Version:
1.3

Constructor & Destructor Documentation

SCS::CanAeroMetadata::CanAeroMetadata ( can_Id_t  can_id,
uint8_t  node_id = SCS_NODE_ID 
)
Parameters:
can_idCAN identifier
id29whether identifier is 11 or 29 bit long
node_idsending node for normal operation data

Member Function Documentation

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.

Parameters:
new_codemessage code received
Returns:
true for expected code, false for packet loss which has triggered a log message
Note:
This function is indeed const because it cannot change the sorting order.
can_Id_t SCS::CanAeroMetadata::id ( ) const
Returns:
CAN with either 11 or 29 bit
uint8_t SCS::CanAeroMetadata::increaseMessageCode ( ) const
Returns:
new message code for the next outgoing message
Note:
This function is indeed const because it cannot change the sorting order.
AS_IDwidth SCS::CanAeroMetadata::isId29 ( ) const
Returns:
whether identifier is 11 or 29 bit long
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)

Note:
this is indeed const because it doesn't affect the sorting order

The documentation for this class was generated from the following file: