10#ifndef TOUCAN_VSCP_CANAL_PLUGIN_HPP
11#define TOUCAN_VSCP_CANAL_PLUGIN_HPP
15#include "isobus/hardware_integration/canal.h"
35 TouCANPlugin(std::int16_t deviceID, std::uint32_t serialNumber, std::uint16_t baudRate = 250);
51 void close()
override;
71 bool reconfigure(std::int16_t deviceID, std::uint32_t serialNumber, std::uint16_t baudRate = 250);
82 void generate_device_name(std::int16_t deviceID, std::uint32_t serialNumber, std::uint16_t baudRate);
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.
An interface for using a Rusoku TouCAN device via the VSCP CANAL api.
virtual ~TouCANPlugin()
The destructor for TouCANPlugin.
std::uint32_t currentlyConfiguredSerialNumber
The serial number of the device that is being used.
void close() override
Closes the connection to the hardware.
TouCANPlugin(std::int16_t deviceID, std::uint32_t serialNumber, std::uint16_t baudRate=250)
Constructor for a TouCAN hardware plugin object.
std::string name
A configuration string that is used to connect to the hardware through the CANAL api.
bool write_frame(const isobus::CANMessageFrame &canFrame) override
Writes a frame to the bus (synchronous)
std::uint32_t handle
The handle that the driver returns to us for the open hardware.
void open() override
Connects to the hardware.
void generate_device_name(std::int16_t deviceID, std::uint32_t serialNumber, std::uint16_t baudRate)
Generates a device name string for the TouCAN device.
std::uint32_t openResult
Stores the result of the call to begin CAN communication. Used for is_valid check later.
std::uint32_t get_serial_number() const
Returns the currently configured serial number of the device which will be used to connect to the har...
bool reconfigure(std::int16_t deviceID, std::uint32_t serialNumber, std::uint16_t baudRate=250)
Changes previously set configuration parameters. Only works if the device is not open.
bool read_frame(isobus::CANMessageFrame &canFrame) override
Returns a frame from the hardware (synchronous), or false if no frame can be read.
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...