AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
A Mac OS CAN Driver for PEAK PCAN Devices. More...
#include <mac_can_pcan_plugin.hpp>
Public Member Functions | |
MacCANPCANPlugin (WORD channel) | |
Constructor for the MacCAN PCAN plugin. | |
virtual | ~MacCANPCANPlugin () |
The destructor for MacCANPCANPlugin. | |
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 Mac OS CAN Driver for PEAK PCAN Devices.
Definition at line 27 of file mac_can_pcan_plugin.hpp.
|
explicit |
Constructor for the MacCAN PCAN plugin.
[in] | channel | The channel to use. See definitions in PCBUSB.h such as PCAN_USBBUS1 |
Definition at line 18 of file mac_can_pcan_plugin.cpp.
|
virtual |
The destructor for MacCANPCANPlugin.
Definition at line 24 of file mac_can_pcan_plugin.cpp.
|
overridevirtual |
Closes the connection to the hardware.
Implements isobus::CANHardwarePlugin.
Definition at line 33 of file mac_can_pcan_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 28 of file mac_can_pcan_plugin.cpp.
|
overridevirtual |
Connects to the hardware you specified in the constructor's channel argument.
Implements isobus::CANHardwarePlugin.
Definition at line 38 of file mac_can_pcan_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 48 of file mac_can_pcan_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 73 of file mac_can_pcan_plugin.cpp.
|
private |
The handle as defined in the PCAN driver API.
Definition at line 58 of file mac_can_pcan_plugin.hpp.
|
private |
Stores the result of the call to begin CAN communication. Used for is_valid check later.
Definition at line 59 of file mac_can_pcan_plugin.hpp.