File Information
Library: IoT/CAN
Package: CANEndpoint
Header: IoT/CAN/CANEndpoint.h
Description
The CANEndpoint is used to receive and send CAN and CAN-FD frames.
Member Summary
Member Functions: addFilter, device, enableEvents, enableFD, eventsEnabled, fdEnabled, fdSupported, getFilter, getFilterMode, removeFilter, sendCANFDFrame, sendCANFrame, sendFrame, setFilter, setFilterMode
Types Aliases
Ptr
using Ptr = Poco::SharedPtr < CANEndpoint >;
Constructors
CANEndpoint
CANEndpoint();
Creates the CANEndpoint.
Destructor
~CANEndpoint
virtual ~CANEndpoint();
Destroys the CANEndpoint.
Member Functions
addFilter
virtual bool addFilter(
const Filter & filter
) = 0;
Adds a filter element to the frame filter.
Returns true if the filter was added, or false if the filter was already present.
device
virtual std::string device() const = 0;
Returns the interface device name (e.g., "can0").
enableEvents
virtual void enableEvents(
bool enable = true
) = 0;
Enables or disables events for received CAN frames.
enableFD
virtual void enableFD(
bool enable = true
) = 0;
Enables or disables support for CAN-FD frames.
eventsEnabled
virtual bool eventsEnabled() const = 0;
Returns true if events for received CAN frames are enabled, otherwise false.
fdEnabled
virtual bool fdEnabled() const = 0;
Returns true if CAN-FD frames are enabled, otherwise false.
fdSupported
virtual bool fdSupported() const = 0;
Returns true if the implementation supports CAN-FD, otherwise false.
getFilter
virtual std::vector < Filter > getFilter() const = 0;
Returns the current filter.
getFilterMode
virtual FilterMode getFilterMode() const = 0;
Returns the filter mode.
removeFilter
virtual bool removeFilter(
const Filter & filter
) = 0;
Removes the given filter element.
Returns true if the filter was removed, or false if no such filter was set.
sendCANFDFrame
virtual void sendCANFDFrame(
const CANFDFrame & frame
) = 0;
Transmits the given CAN-FD frame.
sendCANFrame
virtual void sendCANFrame(
const CANFrame & frame
) = 0;
Transmits the given CAN frame.
sendFrame
virtual void sendFrame(
const CANFDFrame & frame,
FrameType type = CAN_FRAME_AUTO
) = 0;
setFilter
virtual void setFilter(
const std::vector < Filter > & filter
) = 0;
Sets a frame filter for CAN messages.
setFilterMode
virtual void setFilterMode(
FilterMode mode
) = 0;
Sets the filter mode (defaults to CAN_FILTER_MODE_OR).
Variables
frameReceived
Poco::BasicEvent < const CANFDFrame > frameReceived;