Class RawCanInterface

Inheritance Relationships

Base Type

Class Documentation

class RawCanInterface : public hi_can::FilteredCanInterface

Inheritance diagram for hi_can::RawCanInterface:

Collaboration diagram for hi_can::RawCanInterface:

Public Functions

RawCanInterface(const std::string &interface_name = "any")

Instantiates a new RawCanInterface.

Parameters:
const std::string &interface_name = "any"

The interface name (can0, vcan1, etc) to use

RawCanInterface(const RawCanInterface &other)
RawCanInterface(RawCanInterface &&other) noexcept
RawCanInterface &operator=(RawCanInterface other)
virtual void transmit(const Packet &packet) override

Transmits a packet on the CAN bus.

Parameters:
const Packet &packet

Packet to transmit

virtual std::optional<Packet> receive(bool blocking = false) override

Pulls the next packet from the CAN bus buffer.

Parameters:
bool blocking = false

Whether to block until a packet is received

Returns:

The next packet in the buffer, or std::nullopt if the buffer is empty

virtual RawCanInterface &add_filter(const addressing::filter_t &address) override

Add a filter to the interface.

Returns:

Itself for chaining

virtual RawCanInterface &remove_filter(const addressing::filter_t &address) override

Remove a filter from the interface.

Returns:

Itself for chaining

Friends

inline friend void swap(RawCanInterface &first, RawCanInterface &second) noexcept