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

A Windows CAN Driver for PEAK PCAN Devices. More...

#include <pcan_basic_windows_plugin.hpp>

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

Public Member Functions

 PCANBasicWindowsPlugin (WORD channel)
 Constructor for the Windows version of the PEAK PCAN Basic CAN driver.
 
virtual ~PCANBasicWindowsPlugin ()
 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

TPCANHandle handle
 The handle as defined in the PCAN driver API.
 
TPCANStatus openResult
 Stores the result of the call to begin CAN communication. Used for is_valid check later.
 

Detailed Description

A Windows CAN Driver for PEAK PCAN Devices.

Definition at line 32 of file pcan_basic_windows_plugin.hpp.

Constructor & Destructor Documentation

◆ PCANBasicWindowsPlugin()

isobus::PCANBasicWindowsPlugin::PCANBasicWindowsPlugin ( WORD channel)
explicit

Constructor for the Windows version of the PEAK PCAN Basic CAN driver.

Parameters
[in]channelThe channel to use. See definitions in PCANBasic.g such as PCAN_USBBUS1

Definition at line 19 of file pcan_basic_windows_plugin.cpp.

◆ ~PCANBasicWindowsPlugin()

isobus::PCANBasicWindowsPlugin::~PCANBasicWindowsPlugin ( )
virtual

The destructor for PCANBasicWindowsPlugin.

Definition at line 25 of file pcan_basic_windows_plugin.cpp.

Member Function Documentation

◆ close()

void isobus::PCANBasicWindowsPlugin::close ( )
overridevirtual

Closes the connection to the hardware.

Implements isobus::CANHardwarePlugin.

Definition at line 34 of file pcan_basic_windows_plugin.cpp.

◆ get_is_valid()

bool isobus::PCANBasicWindowsPlugin::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 29 of file pcan_basic_windows_plugin.cpp.

◆ open()

void isobus::PCANBasicWindowsPlugin::open ( )
overridevirtual

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

Implements isobus::CANHardwarePlugin.

Definition at line 39 of file pcan_basic_windows_plugin.cpp.

◆ read_frame()

bool isobus::PCANBasicWindowsPlugin::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 49 of file pcan_basic_windows_plugin.cpp.

◆ write_frame()

bool isobus::PCANBasicWindowsPlugin::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 74 of file pcan_basic_windows_plugin.cpp.

Member Data Documentation

◆ handle

TPCANHandle isobus::PCANBasicWindowsPlugin::handle
private

The handle as defined in the PCAN driver API.

Definition at line 63 of file pcan_basic_windows_plugin.hpp.

◆ openResult

TPCANStatus isobus::PCANBasicWindowsPlugin::openResult
private

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

Definition at line 64 of file pcan_basic_windows_plugin.hpp.


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