SocketCANController Class Reference

A Controller which interacts with the socket CAN linux driver. More...

#include <SocketCANController.hpp>

Inheritance diagram for SocketCANController:
CANControllerInterface CANDeviceInterface CANListenerInterface

List of all members.

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)

Detailed Description

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.


Constructor & Destructor Documentation

SocketCANController ( int  priority,
std::string  dev_name,
int  timeout 
)

Create a socket CAN controller.

Parameters:
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.


Member Function Documentation

void process ( const CANMessage msg  )  [virtual]

This method instructs the CANDeviceInterface instance to process a certain CANMessage.

You are not the owner of msg.

Parameters:
msg The message to be processed by this instance.
Invariant:
Only this may be removed from the CANBusInterface during process.

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().


The documentation for this class was generated from the following files:
Generated on Thu Dec 23 15:05:29 2010 for OrocosComponentLibrary by  doxygen 1.6.3