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::SysTecWindowsPlugin Class Reference

A Windows CAN Driver for SYS TEC electronic AG USB CAN modules. More...

#include <sys_tec_windows_plugin.hpp>

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

Public Member Functions

 SysTecWindowsPlugin (std::uint8_t channel=USBCAN_CHANNEL_CH0, std::uint32_t baudrate=USBCAN_BAUD_250kBit)
 Constructor for the Windows SYS TEC plugin.
 
 SysTecWindowsPlugin (std::uint32_t serialNumber, std::uint32_t baudrate=USBCAN_BAUD_250kBit)
 Constructor for the Windows SYS TEC plugin.
 
virtual ~SysTecWindowsPlugin ()
 The destructor for PCANBasicWindowsPlugin.
 
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::uint32_t serialNumber = 0
 The serial number to connect to, or 0 if not used.
 
std::uint16_t baudrateConstant = USBCAN_BAUD_250kBit
 The constant used to configure the adapter's baudrate.
 
std::uint8_t channelIndex = 0
 The channel for the device, used if you have a multi-channel device.
 
std::uint8_t handle = USBCAN_INVALID_HANDLE
 The handle for the device, used to interact with the DLL.
 
bool openResult = false
 Stores the result of the call to begin CAN communication. Used for is_valid check later.
 

Detailed Description

A Windows CAN Driver for SYS TEC electronic AG USB CAN modules.

Definition at line 28 of file sys_tec_windows_plugin.hpp.

Constructor & Destructor Documentation

◆ SysTecWindowsPlugin() [1/2]

isobus::SysTecWindowsPlugin::SysTecWindowsPlugin ( std::uint8_t channel = USBCAN_CHANNEL_CH0,
std::uint32_t baudrate = USBCAN_BAUD_250kBit )

Constructor for the Windows SYS TEC plugin.

Parameters
[in]channelThe channel to use. See definitions in USBCAN32.h, such as USBCAN_CHANNEL_CH0
[in]baudrateThe baudrate to use when connecting to the bus, typically 250k

Definition at line 17 of file sys_tec_windows_plugin.cpp.

◆ SysTecWindowsPlugin() [2/2]

isobus::SysTecWindowsPlugin::SysTecWindowsPlugin ( std::uint32_t serialNumber,
std::uint32_t baudrate = USBCAN_BAUD_250kBit )

Constructor for the Windows SYS TEC plugin.

Parameters
[in]serialNumberThe serial number of the device to connect to
[in]baudrateThe baudrate to use when connecting to the bus, typically 250k

Definition at line 27 of file sys_tec_windows_plugin.cpp.

◆ ~SysTecWindowsPlugin()

isobus::SysTecWindowsPlugin::~SysTecWindowsPlugin ( )
virtual

The destructor for PCANBasicWindowsPlugin.

Definition at line 33 of file sys_tec_windows_plugin.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ close()

void isobus::SysTecWindowsPlugin::close ( )
overridevirtual

Closes the connection to the hardware.

Implements isobus::CANHardwarePlugin.

Definition at line 43 of file sys_tec_windows_plugin.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_is_valid()

bool isobus::SysTecWindowsPlugin::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 38 of file sys_tec_windows_plugin.cpp.

Here is the caller graph for this function:

◆ open()

void isobus::SysTecWindowsPlugin::open ( )
overridevirtual

Connects to the hardware you specified in the constructor's channel argument.

Implements isobus::CANHardwarePlugin.

Definition at line 54 of file sys_tec_windows_plugin.cpp.

Here is the call graph for this function:

◆ read_frame()

bool isobus::SysTecWindowsPlugin::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
Todo
Can probably optimize this better somehow by using the RX callback from the driver and a condition variable?

Implements isobus::CANHardwarePlugin.

Definition at line 102 of file sys_tec_windows_plugin.cpp.

Here is the call graph for this function:

◆ write_frame()

bool isobus::SysTecWindowsPlugin::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 136 of file sys_tec_windows_plugin.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ baudrateConstant

std::uint16_t isobus::SysTecWindowsPlugin::baudrateConstant = USBCAN_BAUD_250kBit
private

The constant used to configure the adapter's baudrate.

Definition at line 66 of file sys_tec_windows_plugin.hpp.

◆ channelIndex

std::uint8_t isobus::SysTecWindowsPlugin::channelIndex = 0
private

The channel for the device, used if you have a multi-channel device.

Definition at line 67 of file sys_tec_windows_plugin.hpp.

◆ handle

std::uint8_t isobus::SysTecWindowsPlugin::handle = USBCAN_INVALID_HANDLE
private

The handle for the device, used to interact with the DLL.

Definition at line 68 of file sys_tec_windows_plugin.hpp.

◆ openResult

bool isobus::SysTecWindowsPlugin::openResult = false
private

Stores the result of the call to begin CAN communication. Used for is_valid check later.

Definition at line 69 of file sys_tec_windows_plugin.hpp.

◆ serialNumber

std::uint32_t isobus::SysTecWindowsPlugin::serialNumber = 0
private

The serial number to connect to, or 0 if not used.

Definition at line 65 of file sys_tec_windows_plugin.hpp.


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