AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
A Windows CAN Driver for PEAK PCAN Devices. More...
#include <pcan_basic_windows_plugin.hpp>
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. | |
A Windows CAN Driver for PEAK PCAN Devices.
Definition at line 32 of file pcan_basic_windows_plugin.hpp.
|
explicit |
Constructor for the Windows version of the PEAK PCAN Basic CAN driver.
[in] | channel | The channel to use. See definitions in PCANBasic.g such as PCAN_USBBUS1 |
Definition at line 19 of file pcan_basic_windows_plugin.cpp.
|
virtual |
The destructor for PCANBasicWindowsPlugin.
Definition at line 25 of file pcan_basic_windows_plugin.cpp.
|
overridevirtual |
Closes the connection to the hardware.
Implements isobus::CANHardwarePlugin.
Definition at line 34 of file pcan_basic_windows_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 29 of file pcan_basic_windows_plugin.cpp.
|
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.
|
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 49 of file pcan_basic_windows_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 74 of file pcan_basic_windows_plugin.cpp.
|
private |
The handle as defined in the PCAN driver API.
Definition at line 63 of file pcan_basic_windows_plugin.hpp.
|
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.