15 m_RawIdentifier(rawIdentifierData)
22 std::uint8_t destinationAddress,
23 std::uint8_t sourceAddress) :
47 const std::uint8_t EXTENDED_IDENTIFIER_MASK = 0x07;
69 const std::uint32_t STANDARD_ID_11_BIT_SIZE = 0x7FF;
103 const std::uint8_t ADDRESS_BITS_SIZE = 0xFF;
104 const std::uint8_t ADDRESS_DATA_OFFSET = 8;
111 retVal = ((
m_RawIdentifier >> ADDRESS_DATA_OFFSET) & ADDRESS_BITS_SIZE);
118 const std::uint8_t ADDRESS_BITS_SIZE = 0xFF;
130 const std::uint32_t EXTENDED_ID_29_BIT_SIZE = 0x1FFFFFFF;
131 const std::uint32_t STANDARD_ID_11_BIT_SIZE = 0x7FF;
A representation of a classical CAN identifier with utility functions for ectracting values that are ...
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.
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.
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...