A Controller which interacts with the socket CAN linux driver. More...
#include <SocketCANController.hpp>
Public Member Functions | |
SocketCANController (int priority, std::string dev_name, int timeout) | |
Create a socket CAN controller. | |
bool | initialize () |
void | loop () |
bool | breakLoop () |
void | finalize () |
virtual void | addBus (CANBusInterface *bus) |
virtual void | process (const CANMessage *msg) |
This method instructs the CANDeviceInterface instance to process a certain CANMessage. | |
bool | readFromBuffer (void) |
A Controller which interacts with the socket CAN linux driver.
It is tested with the NON REALTIME CAN driver from Peak-Systems. See http://peak-systems.com/linux for more information on how to compile this driver with socket CAN support.
Definition at line 21 of file SocketCANController.hpp.
SocketCANController | ( | int | priority, | |
std::string | dev_name, | |||
int | timeout | |||
) |
Create a socket CAN controller.
priority | The priority of the activity | |
dev_name | The name of the socket CAN device. E.g. if you are using can0, dev_name is can0 | |
timeout | reception timeout of the socket in ms |
Definition at line 51 of file SocketCANController.cpp.
void process | ( | const CANMessage * | msg | ) | [virtual] |
This method instructs the CANDeviceInterface instance to process a certain CANMessage.
You are not the owner of msg.
msg | The message to be processed by this instance. |
Implements CANListenerInterface.
Definition at line 165 of file SocketCANController.cpp.
References CANMessage::getData(), CANMessage::getDLC(), and CANMessage::isRemote().
bool readFromBuffer | ( | void | ) |
If ret < 0, something went wrong while receiving the CAN message
Definition at line 198 of file SocketCANController.cpp.
References CANBusInterface::write().