AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
isobus::InnoMakerUSB2CANWindowsPlugin Class Reference

A Windows CAN Driver for InnoMaker USB2CAN devices. More...

#include <innomaker_usb2can_windows_plugin.hpp>

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

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.
 

Detailed Description

A Windows CAN Driver for InnoMaker USB2CAN devices.

Definition at line 30 of file innomaker_usb2can_windows_plugin.hpp.

Member Enumeration Documentation

◆ Baudrate

The baudrates supported by the InnoMaker USB2CAN device.

Enumerator
B20k 

20 kbps baudrate

B33k3 

33.3 kbps baudrate

B40k 

40 kbps baudrate

B50k 

50 kbps baudrate

B66k6 

66.6 kbps baudrate

B80k 

80 kbps baudrate

B83k3 

83.3 kbps baudrate

B100k 

100 kbps baudrate

B125k 

125 kbps baudrate

B200k 

200 kbps baudrate

B250k 

250 kbps baudrate

B400k 

400 kbps baudrate

B500k 

500 kbps baudrate

B666k 

666 kbps baudrate

B800k 

800 kbps baudrate

B1000k 

1000 kbps baudrate

Definition at line 34 of file innomaker_usb2can_windows_plugin.hpp.

Constructor & Destructor Documentation

◆ InnoMakerUSB2CANWindowsPlugin()

isobus::InnoMakerUSB2CANWindowsPlugin::InnoMakerUSB2CANWindowsPlugin ( int channel,
Baudrate baudrate = B250k )
explicit

Constructor for the Windows version of the InnoMaker USB2CAN Windows CAN driver.

Parameters
[in]channelThe channel to use by index, passed directly to the consuming driver
[in]baudrateThe baud rate to configure the device for. Typically 250k baud

Definition at line 24 of file innomaker_usb2can_windows_plugin.cpp.

◆ ~InnoMakerUSB2CANWindowsPlugin()

isobus::InnoMakerUSB2CANWindowsPlugin::~InnoMakerUSB2CANWindowsPlugin ( )
virtual

The destructor for InnoMakerUSB2CANWindowsPlugin.

Definition at line 37 of file innomaker_usb2can_windows_plugin.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ close()

void isobus::InnoMakerUSB2CANWindowsPlugin::close ( )
overridevirtual

Closes the connection to the hardware.

Implements isobus::CANHardwarePlugin.

Definition at line 47 of file innomaker_usb2can_windows_plugin.cpp.

Here is the caller graph for this function:

◆ get_is_valid()

bool isobus::InnoMakerUSB2CANWindowsPlugin::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 42 of file innomaker_usb2can_windows_plugin.cpp.

◆ open()

void isobus::InnoMakerUSB2CANWindowsPlugin::open ( )
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.

◆ read_frame()

bool isobus::InnoMakerUSB2CANWindowsPlugin::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
Todo
error frame handling

Implements isobus::CANHardwarePlugin.

Definition at line 255 of file innomaker_usb2can_windows_plugin.cpp.

◆ write_frame()

bool isobus::InnoMakerUSB2CANWindowsPlugin::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 302 of file innomaker_usb2can_windows_plugin.cpp.

Member Data Documentation

◆ baudrate

const std::uint32_t isobus::InnoMakerUSB2CANWindowsPlugin::baudrate
private

Stores the baud rate associated with this object.

Definition at line 90 of file innomaker_usb2can_windows_plugin.hpp.

◆ CAN_EFF_FLAG

constexpr std::uint32_t isobus::InnoMakerUSB2CANWindowsPlugin::CAN_EFF_FLAG = 0x80000000
staticconstexprprivate

Set if the frame is extended.

Definition at line 84 of file innomaker_usb2can_windows_plugin.hpp.

◆ CAN_EFF_MASK

constexpr std::uint32_t isobus::InnoMakerUSB2CANWindowsPlugin::CAN_EFF_MASK = 0x1FFFFFFF
staticconstexprprivate

The mask for extended frames.

Definition at line 86 of file innomaker_usb2can_windows_plugin.hpp.

◆ CAN_MODE

constexpr InnoMakerUsb2CanLib::UsbCanMode isobus::InnoMakerUSB2CANWindowsPlugin::CAN_MODE = InnoMakerUsb2CanLib::UsbCanModeNormal
staticconstexprprivate

The mode to use for the CAN device.

Definition at line 83 of file innomaker_usb2can_windows_plugin.hpp.

◆ CAN_SFF_MASK

constexpr std::uint32_t isobus::InnoMakerUSB2CANWindowsPlugin::CAN_SFF_MASK = 0x000007FF
staticconstexprprivate

The mask for standard frames.

Definition at line 85 of file innomaker_usb2can_windows_plugin.hpp.

◆ channel

const int isobus::InnoMakerUSB2CANWindowsPlugin::channel
private

Stores the channel associated with this object.

Definition at line 89 of file innomaker_usb2can_windows_plugin.hpp.

◆ driverInstance

std::unique_ptr< InnoMakerUsb2CanLib > isobus::InnoMakerUSB2CANWindowsPlugin::driverInstance = nullptr
staticprivate

The driver itself.

Definition at line 88 of file innomaker_usb2can_windows_plugin.hpp.

◆ txContexts

std::unique_ptr<InnoMakerUsb2CanLib::innomaker_can> isobus::InnoMakerUSB2CANWindowsPlugin::txContexts
private

Stores Tx tickets for the driver.

Definition at line 91 of file innomaker_usb2can_windows_plugin.hpp.


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