10#ifndef SOCKET_CAN_INTERFACE_HPP
11#define SOCKET_CAN_INTERFACE_HPP
47 void close()
override;
65 bool set_name(
const std::string &newName);
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 CAN Driver for Linux socket CAN.
std::string name
The device name.
int fileDescriptor
File descriptor for the socket.
bool write_frame(const isobus::CANMessageFrame &canFrame) override
Writes a frame to the bus (synchronous)
SocketCANInterface(const std::string deviceName)
Constructor for the socket CAN driver.
std::string get_device_name() const
Returns the device name the driver is using.
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 socket.
bool get_is_valid() const override
Returns if the socket connection is valid.
void open() override
Connects to the socket.
virtual ~SocketCANInterface()
The destructor for SocketCANInterface.
struct sockaddr_can * pCANDevice
The structure for CAN sockets.
bool set_name(const std::string &newName)
Changes the name of the device to use, which only works if the device is not open.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...