AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
An interface for using FlexCAN_T4 on a Teensy4/4.1 device. More...
#include <flex_can_t4_plugin.hpp>
Public Member Functions | |
FlexCANT4Plugin (std::uint8_t channel) | |
Constructor for the FlexCANT4Plugin. | |
virtual | ~FlexCANT4Plugin ()=default |
The destructor for FlexCANT4Plugin. | |
bool | get_is_valid () const override |
Returns if the connection with the hardware is valid. | |
void | close () override |
Closes the connection to the hardware. | |
void | open () override |
Connects to the hardware you specified in the constructor's channel argument. | |
bool | read_frame (isobus::CANMessageFrame &canFrame) override |
Returns a frame from the hardware (synchronous), or false if no frame can be read. | |
bool | write_frame (const isobus::CANMessageFrame &canFrame) override |
Writes a frame to the bus (synchronous) | |
Private Attributes | |
std::uint8_t | selectedChannel |
The channel that this plugin is assigned to. | |
bool | isOpen = false |
Tracks if the connection is open/connected. | |
An interface for using FlexCAN_T4 on a Teensy4/4.1 device.
Definition at line 20 of file flex_can_t4_plugin.hpp.
|
explicit |
Constructor for the FlexCANT4Plugin.
[in] | channel | The channel to use on the device |
Definition at line 25 of file flex_can_t4_plugin.cpp.
|
overridevirtual |
Closes the connection to the hardware.
Implements isobus::CANHardwarePlugin.
Definition at line 35 of file flex_can_t4_plugin.cpp.
|
overridevirtual |
Returns if the connection with the hardware is valid.
true
if connected, false
if not connected Implements isobus::CANHardwarePlugin.
Definition at line 30 of file flex_can_t4_plugin.cpp.
|
overridevirtual |
Connects to the hardware you specified in the constructor's channel argument.
Implements isobus::CANHardwarePlugin.
Definition at line 41 of file flex_can_t4_plugin.cpp.
|
overridevirtual |
Returns a frame from the hardware (synchronous), or false
if no frame can be read.
[in,out] | canFrame | The CAN frame that was read |
true
if a CAN frame was read, otherwise false
Implements isobus::CANHardwarePlugin.
Definition at line 69 of file flex_can_t4_plugin.cpp.
|
overridevirtual |
Writes a frame to the bus (synchronous)
[in] | canFrame | The frame to write to the bus |
true
if the frame was written, otherwise false
Implements isobus::CANHardwarePlugin.
Definition at line 99 of file flex_can_t4_plugin.cpp.
|
private |
Tracks if the connection is open/connected.
Definition at line 60 of file flex_can_t4_plugin.hpp.
|
private |
The channel that this plugin is assigned to.
Definition at line 59 of file flex_can_t4_plugin.hpp.