11#ifndef CAN_IDENTIFIER_HPP
12#define CAN_IDENTIFIER_HPP
59 std::uint8_t destinationAddress,
60 std::uint8_t sourceAddress);
A utility class that allows easy interpretation of a 32 bit CAN identifier.
static constexpr std::uint32_t DESTINATION_SPECIFIC_PGN_MASK
Destination specific PGNs mask the destination out of the PGN itself.
static constexpr std::uint32_t IDENTIFIER_TYPE_BIT_MASK
This bit denotes if the frame is standard or extended format.
static constexpr std::uint32_t UNDEFINED_PARAMETER_GROUP_NUMBER
A fake PGN used internally to denote a NULL PGN.
CANPriority
Defines all the CAN frame priorities that can be encoded in a frame ID.
@ PriorityHighest0
Highest CAN priority.
@ Priority3
Priority highest - 3 (Control messages priority)
@ Priority1
Priority highest - 1.
@ Priority4
Priority highest - 4.
@ PriorityLowest7
The lowest priority.
@ Priority2
Priority highest - 2.
@ PriorityDefault6
The default priority.
@ Priority5
Priority highest - 5.
static constexpr std::uint8_t NULL_ADDRESS
The NULL CAN address as defined by ISO11783.
std::uint32_t get_identifier() const
Returns the raw encoded ID of the CAN identifier.
std::uint8_t get_source_address() const
Returns the source address of the frame encoded in the identifier.
~CANIdentifier()=default
Destructor for the CANIdentifier.
CANPriority get_priority() const
Returns the priority of the frame encoded in the identifier.
CANIdentifier(std::uint32_t rawIdentifierData)
Constructor for a CAN Identifier class based on a raw 32 bit ID.
std::uint32_t get_parameter_group_number() const
Returns the PGN encoded in the identifier.
static constexpr std::uint8_t PARAMTER_GROUP_NUMBER_OFFSET
PGN is offset 8 bits into the ID.
static constexpr std::uint8_t PRIORITY_DATA_BIT_OFFSET
Priority is offset 26 bits into the ID.
static constexpr std::uint8_t GLOBAL_ADDRESS
The broadcast CAN address.
static constexpr std::uint32_t BROADCAST_PGN_MASK
Broadcast PGNs don't mask off the bits used for destination in the PGN.
Type get_identifier_type() const
Returns the identifier type (standard vs extended)
static constexpr std::uint32_t PDU2_FORMAT_MASK
Mask that denotes the ID as being PDU2 format.
Type
Defines if a frame is a standard (11 bit) or extended (29 bit) ID frame.
@ Standard
Frame is an 11bit ID standard (legacy) message with no PGN and highest priority.
@ Extended
Frame is a modern 29 bit ID CAN frame.
bool get_is_valid() const
Returns if the ID is valid based on some range checking.
std::uint32_t m_RawIdentifier
The raw encoded 29 bit ID.
std::uint8_t get_destination_address() const
Returns the destination address of the frame encoded in the identifier.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...