Class Frame

Class Documentation

class Frame

Class for a frame of the CAN bus protocol, see https://en.wikipedia.org/wiki/CAN_bus This class replaces the Linux SocketCAN frame struct in order to be more portable.

Public Functions

constexpr Frame(std::uint32_t const can_id, std::array<std::uint8_t, 8> const &data) noexcept
Frame() = delete

Class constructor.

Parameters:
  • can_id[in] The CAN id of the message

  • data[in] The data to be transmitted to the CAN node

Frame(Frame const&) = default
Frame &operator=(Frame const&) = default
Frame(Frame&&) = default
Frame &operator=(Frame&&) = default
constexpr std::uint32_t getId() const noexcept

Getter for the frame CAN id.

Returns:

The destination frame id of the CAN frame

constexpr std::array<std::uint8_t, 8> const &getData() const noexcept

Getter for data to be transmitted to CAN node.

Returns:

The data to be transmitted to the CAN node

Protected Attributes

std::uint32_t can_id_
std::array<std::uint8_t, 8> data_