AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | List of all members
isobus::CANHardwarePlugin Class Referenceabstract

An abstract base class for a CAN driver. More...

#include <can_hardware_plugin.hpp>

Inheritance diagram for isobus::CANHardwarePlugin:
[legend]

Public Member Functions

virtual bool get_is_valid () const =0
 Returns if the driver is ready and in a good state.
 
virtual void close ()=0
 Disconnects the driver from the hardware.
 
virtual void open ()=0
 Connects the driver to the hardware. This will be called to initialize the driver and connect it to the hardware.
 
virtual bool read_frame (isobus::CANMessageFrame &canFrame)=0
 Reads one frame from the bus synchronously.
 
virtual bool write_frame (const isobus::CANMessageFrame &canFrame)=0
 Writes a frame to the bus (synchronous)
 

Detailed Description

An abstract base class for a CAN driver.

Definition at line 21 of file can_hardware_plugin.hpp.

Member Function Documentation

◆ close()

virtual void isobus::CANHardwarePlugin::close ( )
pure virtual

◆ get_is_valid()

virtual bool isobus::CANHardwarePlugin::get_is_valid ( ) const
pure virtual

Returns if the driver is ready and in a good state.

This should return false until open is called, and after close is called, or if anything happens that causes the driver to be invalid, like the hardware is disconnected.

Returns
true if the driver is good/connected, false if the driver is not usable

Implemented in isobus::FlexCANT4Plugin, isobus::InnoMakerUSB2CANWindowsPlugin, isobus::MacCANPCANPlugin, isobus::MCP2515CANInterface, isobus::PCANBasicWindowsPlugin, isobus::SocketCANInterface, isobus::SocketCANdNetworkInterface, isobus::SysTecWindowsPlugin, isobus::TouCANPlugin, and isobus::VirtualCANPlugin.

◆ open()

virtual void isobus::CANHardwarePlugin::open ( )
pure virtual

◆ read_frame()

virtual bool isobus::CANHardwarePlugin::read_frame ( isobus::CANMessageFrame & canFrame)
pure virtual

Reads one frame from the bus synchronously.

Parameters
[in,out]canFrameThe CAN frame that was read
Returns
true if a CAN frame was read, otherwise false

Implemented in isobus::FlexCANT4Plugin, isobus::InnoMakerUSB2CANWindowsPlugin, isobus::MacCANPCANPlugin, isobus::MCP2515CANInterface, isobus::PCANBasicWindowsPlugin, isobus::SocketCANInterface, isobus::SysTecWindowsPlugin, isobus::TouCANPlugin, and isobus::VirtualCANPlugin.

◆ write_frame()

virtual bool isobus::CANHardwarePlugin::write_frame ( const isobus::CANMessageFrame & canFrame)
pure virtual

Writes a frame to the bus (synchronous)

Parameters
[in]canFrameThe frame to write to the bus
Returns
true if the frame was written, otherwise false

Implemented in isobus::FlexCANT4Plugin, isobus::InnoMakerUSB2CANWindowsPlugin, isobus::MacCANPCANPlugin, isobus::MCP2515CANInterface, isobus::PCANBasicWindowsPlugin, isobus::SocketCANInterface, isobus::SysTecWindowsPlugin, isobus::TouCANPlugin, and isobus::VirtualCANPlugin.


The documentation for this class was generated from the following file: