AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
An abstract base class for a CAN driver. More...
#include <can_hardware_plugin.hpp>
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) | |
An abstract base class for a CAN driver.
Definition at line 21 of file can_hardware_plugin.hpp.
|
pure virtual |
Disconnects the driver from the hardware.
Implemented in isobus::FlexCANT4Plugin, isobus::InnoMakerUSB2CANWindowsPlugin, isobus::MacCANPCANPlugin, isobus::MCP2515CANInterface, isobus::PCANBasicWindowsPlugin, isobus::SocketCANInterface, isobus::SocketCANdNetworkInterface, isobus::SysTecWindowsPlugin, isobus::TouCANPlugin, and isobus::VirtualCANPlugin.
|
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.
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.
|
pure virtual |
Connects the driver to the hardware. This will be called to initialize the driver and connect it to the hardware.
Implemented in isobus::FlexCANT4Plugin, isobus::InnoMakerUSB2CANWindowsPlugin, isobus::MacCANPCANPlugin, isobus::MCP2515CANInterface, isobus::PCANBasicWindowsPlugin, isobus::SocketCANInterface, isobus::SocketCANdNetworkInterface, isobus::SysTecWindowsPlugin, isobus::TouCANPlugin, and isobus::VirtualCANPlugin.
|
pure virtual |
Reads one frame from the bus synchronously.
[in,out] | canFrame | The CAN frame that was read |
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.
|
pure virtual |
Writes a frame to the bus (synchronous)
[in] | canFrame | The frame to write to the bus |
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.