|
AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
A Windows CAN Driver for InnoMaker USB2CAN devices. More...
#include <innomaker_usb2can_windows_plugin.hpp>
Public Types | |
| enum | Baudrate { B20k , B33k3 , B40k , B50k , B66k6 , B80k , B83k3 , B100k , B125k , B200k , B250k , B400k , B500k , B666k , B800k , B1000k } |
| The baudrates supported by the InnoMaker USB2CAN device. More... | |
Public Member Functions | |
| InnoMakerUSB2CANWindowsPlugin (int channel, Baudrate baudrate=B250k) | |
| Constructor for the Windows version of the InnoMaker USB2CAN Windows CAN driver. | |
| virtual | ~InnoMakerUSB2CANWindowsPlugin () |
| The destructor for InnoMakerUSB2CANWindowsPlugin. | |
| 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 | |
| const int | channel |
| Stores the channel associated with this object. | |
| const std::uint32_t | baudrate |
| Stores the baud rate associated with this object. | |
| std::unique_ptr< InnoMakerUsb2CanLib::innomaker_can > | txContexts |
| Stores Tx tickets for the driver. | |
Static Private Attributes | |
| static constexpr InnoMakerUsb2CanLib::UsbCanMode | CAN_MODE = InnoMakerUsb2CanLib::UsbCanModeNormal |
| The mode to use for the CAN device. | |
| static constexpr std::uint32_t | CAN_EFF_FLAG = 0x80000000 |
| Set if the frame is extended. | |
| static constexpr std::uint32_t | CAN_SFF_MASK = 0x000007FF |
| The mask for standard frames. | |
| static constexpr std::uint32_t | CAN_EFF_MASK = 0x1FFFFFFF |
| The mask for extended frames. | |
| static std::unique_ptr< InnoMakerUsb2CanLib > | driverInstance = nullptr |
| The driver itself. | |
A Windows CAN Driver for InnoMaker USB2CAN devices.
Definition at line 30 of file innomaker_usb2can_windows_plugin.hpp.
The baudrates supported by the InnoMaker USB2CAN device.
Definition at line 34 of file innomaker_usb2can_windows_plugin.hpp.
|
explicit |
Constructor for the Windows version of the InnoMaker USB2CAN Windows CAN driver.
| [in] | channel | The channel to use by index, passed directly to the consuming driver |
| [in] | baudrate | The baud rate to configure the device for. Typically 250k baud |
Definition at line 24 of file innomaker_usb2can_windows_plugin.cpp.
|
virtual |
The destructor for InnoMakerUSB2CANWindowsPlugin.
Definition at line 37 of file innomaker_usb2can_windows_plugin.cpp.
|
overridevirtual |
Closes the connection to the hardware.
Implements isobus::CANHardwarePlugin.
Definition at line 47 of file innomaker_usb2can_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 42 of file innomaker_usb2can_windows_plugin.cpp.
|
overridevirtual |
Connects to the hardware you specified in the constructor's channel argument.
Implements isobus::CANHardwarePlugin.
Definition at line 76 of file innomaker_usb2can_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 255 of file innomaker_usb2can_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 302 of file innomaker_usb2can_windows_plugin.cpp.
|
private |
Stores the baud rate associated with this object.
Definition at line 90 of file innomaker_usb2can_windows_plugin.hpp.
|
staticconstexprprivate |
Set if the frame is extended.
Definition at line 84 of file innomaker_usb2can_windows_plugin.hpp.
|
staticconstexprprivate |
The mask for extended frames.
Definition at line 86 of file innomaker_usb2can_windows_plugin.hpp.
|
staticconstexprprivate |
The mode to use for the CAN device.
Definition at line 83 of file innomaker_usb2can_windows_plugin.hpp.
|
staticconstexprprivate |
The mask for standard frames.
Definition at line 85 of file innomaker_usb2can_windows_plugin.hpp.
|
private |
Stores the channel associated with this object.
Definition at line 89 of file innomaker_usb2can_windows_plugin.hpp.
|
staticprivate |
The driver itself.
Definition at line 88 of file innomaker_usb2can_windows_plugin.hpp.
|
private |
Stores Tx tickets for the driver.
Definition at line 91 of file innomaker_usb2can_windows_plugin.hpp.