11#ifndef INNOMAKER_USB2CAN_PLUGIN_HPP
12#define INNOMAKER_USB2CAN_PLUGIN_HPP
18#include "isobus/hardware_integration/InnoMakerUsb2CanLib.h"
67 void close()
override;
83 static constexpr InnoMakerUsb2CanLib::UsbCanMode
CAN_MODE = InnoMakerUsb2CanLib::UsbCanModeNormal;
91 std::unique_ptr<InnoMakerUsb2CanLib::innomaker_can>
txContexts;
An abstraction between this CAN stack and any hardware layer.
A base class for a CAN driver. Can be derived into your platform's required interface.
A classical CAN frame, with 8 data bytes.
An abstract base class for a CAN driver.
A CAN frame for interfacing with a hardware layer, like socket CAN or other interface.
A Windows CAN Driver for InnoMaker USB2CAN devices.
static constexpr std::uint32_t CAN_EFF_MASK
The mask for extended frames.
static constexpr std::uint32_t CAN_SFF_MASK
The mask for standard frames.
InnoMakerUSB2CANWindowsPlugin(int channel, Baudrate baudrate=B250k)
Constructor for the Windows version of the InnoMaker USB2CAN Windows CAN driver.
std::unique_ptr< InnoMakerUsb2CanLib::innomaker_can > txContexts
Stores Tx tickets for the driver.
bool write_frame(const isobus::CANMessageFrame &canFrame) override
Writes a frame to the bus (synchronous)
static std::unique_ptr< InnoMakerUsb2CanLib > driverInstance
The driver itself.
Baudrate
The baudrates supported by the InnoMaker USB2CAN device.
@ B1000k
1000 kbps baudrate
@ B33k3
33.3 kbps baudrate
@ B66k6
66.6 kbps baudrate
@ B83k3
83.3 kbps baudrate
void open() override
Connects to the hardware you specified in the constructor's channel argument.
const int channel
Stores the channel associated with this object.
static constexpr std::uint32_t CAN_EFF_FLAG
Set if the frame is extended.
virtual ~InnoMakerUSB2CANWindowsPlugin()
The destructor for InnoMakerUSB2CANWindowsPlugin.
bool read_frame(isobus::CANMessageFrame &canFrame) override
Returns a frame from the hardware (synchronous), or false if no frame can be read.
void close() override
Closes the connection to the hardware.
const std::uint32_t baudrate
Stores the baud rate associated with this object.
static constexpr InnoMakerUsb2CanLib::UsbCanMode CAN_MODE
The mode to use for the CAN device.
bool get_is_valid() const override
Returns if the connection with the hardware is valid.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...