IoT::CAN

class CANEndpoint

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

virtual ~CANEndpoint();

Destroys the CANEndpoint.

Member Functions

addFilter virtual

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

virtual std::string device() const = 0;

Returns the interface device name (e.g., "can0").

enableEvents virtual

virtual void enableEvents(
    bool enable = true
) = 0;

Enables or disables events for received CAN frames.

enableFD virtual

virtual void enableFD(
    bool enable = true
) = 0;

Enables or disables support for CAN-FD frames.

eventsEnabled virtual

virtual bool eventsEnabled() const = 0;

Returns true if events for received CAN frames are enabled, otherwise false.

fdEnabled virtual

virtual bool fdEnabled() const = 0;

Returns true if CAN-FD frames are enabled, otherwise false.

fdSupported virtual

virtual bool fdSupported() const = 0;

Returns true if the implementation supports CAN-FD, otherwise false.

getFilter virtual

virtual std::vector < Filter > getFilter() const = 0;

Returns the current filter.

getFilterMode virtual

virtual FilterMode getFilterMode() const = 0;

Returns the filter mode.

removeFilter virtual

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

virtual void sendCANFDFrame(
    const CANFDFrame & frame
) = 0;

Transmits the given CAN-FD frame.

sendCANFrame virtual

virtual void sendCANFrame(
    const CANFrame & frame
) = 0;

Transmits the given CAN frame.

sendFrame virtual

virtual void sendFrame(
    const CANFDFrame & frame,
    FrameType type = CAN_FRAME_AUTO
) = 0;

Transmit the given frame as CAN or CAN-FD frame, depending on type.

setFilter virtual

virtual void setFilter(
    const std::vector < Filter > & filter
) = 0;

Sets a frame filter for CAN messages.

setFilterMode virtual

virtual void setFilterMode(
    FilterMode mode
) = 0;

Sets the filter mode (defaults to CAN_FILTER_MODE_OR).

Variables

frameReceived

Poco::BasicEvent < const CANFDFrame > frameReceived;

Fired when an CAN or CAN-FD frame has been received.

Securely control IoT edge devices from anywhere   Connect a Device