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

An interface for using FlexCAN_T4 on a Teensy4/4.1 device. More...

#include <flex_can_t4_plugin.hpp>

Inheritance diagram for isobus::FlexCANT4Plugin:
[legend]
Collaboration diagram for isobus::FlexCANT4Plugin:
[legend]

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.
 

Detailed Description

An interface for using FlexCAN_T4 on a Teensy4/4.1 device.

Definition at line 20 of file flex_can_t4_plugin.hpp.

Constructor & Destructor Documentation

◆ FlexCANT4Plugin()

isobus::FlexCANT4Plugin::FlexCANT4Plugin ( std::uint8_t channel)
explicit

Constructor for the FlexCANT4Plugin.

Parameters
[in]channelThe channel to use on the device

Definition at line 25 of file flex_can_t4_plugin.cpp.

Member Function Documentation

◆ close()

void isobus::FlexCANT4Plugin::close ( )
overridevirtual

Closes the connection to the hardware.

Implements isobus::CANHardwarePlugin.

Definition at line 35 of file flex_can_t4_plugin.cpp.

◆ get_is_valid()

bool isobus::FlexCANT4Plugin::get_is_valid ( ) const
overridevirtual

Returns if the connection with the hardware is valid.

Returns
true if connected, false if not connected

Implements isobus::CANHardwarePlugin.

Definition at line 30 of file flex_can_t4_plugin.cpp.

◆ open()

void isobus::FlexCANT4Plugin::open ( )
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.

◆ read_frame()

bool isobus::FlexCANT4Plugin::read_frame ( isobus::CANMessageFrame & canFrame)
overridevirtual

Returns a frame from the hardware (synchronous), or false if no frame can be read.

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

Implements isobus::CANHardwarePlugin.

Definition at line 69 of file flex_can_t4_plugin.cpp.

◆ write_frame()

bool isobus::FlexCANT4Plugin::write_frame ( const isobus::CANMessageFrame & canFrame)
overridevirtual

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

Implements isobus::CANHardwarePlugin.

Definition at line 99 of file flex_can_t4_plugin.cpp.

Member Data Documentation

◆ isOpen

bool isobus::FlexCANT4Plugin::isOpen = false
private

Tracks if the connection is open/connected.

Definition at line 60 of file flex_can_t4_plugin.hpp.

◆ selectedChannel

std::uint8_t isobus::FlexCANT4Plugin::selectedChannel
private

The channel that this plugin is assigned to.

Definition at line 59 of file flex_can_t4_plugin.hpp.


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