CANOpenBus Class Reference

A CAN Open Bus in its simplest (but effective) form, making use of nodeId() and other CANOpen functionalities to optimise and interpret the data flow. More...

#include <CANOpenBus.hpp>

Inheritance diagram for CANOpenBus:

CANBusInterface

List of all members.

Public Member Functions

 CANOpenBus ()
 Create a CANBus instance with no devices attached to it.
void sync ()
 Write a SYNC message to the bus.
void setController (CANControllerInterface *contr)
 Specify the controller for this bus.
virtual bool addDevice (CANDeviceInterface *dev)
 Register a CANDeviceInterface instance to the bus.
virtual bool addListener (CANListenerInterface *dev)
 Register a CANListenerInterface instance to the bus.
virtual void removeDevice (CANDeviceInterface *dev)
 Remove a CANDeviceInterface from the bus.
virtual void removeListener (CANListenerInterface *dev)
 Remove a CANListenerInterface from the bus.
virtual void write (const CANMessage *msg)
 Write a CANMessage to the bus.

Static Public Attributes

static const unsigned int MAX_DEVICES = 127

Protected Attributes

list< CANDeviceInterface * > devices
list< CANListenerInterface * > listeners
CANControllerInterfacecontroller


Detailed Description

A CAN Open Bus in its simplest (but effective) form, making use of nodeId() and other CANOpen functionalities to optimise and interpret the data flow.

Definition at line 50 of file CANOpenBus.hpp.


Constructor & Destructor Documentation

CANOpenBus (  )  [inline]

Create a CANBus instance with no devices attached to it.

A controller device needs to be added to put on and receive messages from the bus.

Parameters:
_controller The Controller of the bus.

Definition at line 63 of file CANOpenBus.hpp.

References CANMessage::setStdId().


Member Function Documentation

virtual bool addDevice ( CANDeviceInterface dev  )  [inline, virtual]

Register a CANDeviceInterface instance to the bus.

Parameters:
dev The device to be added to the bus.
Returns:
True if the operation succeeded, false otherwise.
Postcondition:
The device will receive all messages on the bus.

Implements CANBusInterface.

Definition at line 83 of file CANOpenBus.hpp.

virtual bool addListener ( CANListenerInterface dev  )  [inline, virtual]

Register a CANListenerInterface instance to the bus.

Parameters:
dev The listener to be added to the bus.
Returns:
True if the operation succeeded, false otherwise.
Postcondition:
The listener will receive all messages on the bus.

Implements CANBusInterface.

Definition at line 92 of file CANOpenBus.hpp.

virtual void removeDevice ( CANDeviceInterface dev  )  [inline, virtual]

Remove a CANDeviceInterface from the bus.

Parameters:
dev The device to be removed from the bus.
Postcondition:
The device will no longer receive messages from the bus.
Invariant:
During a process(), the device may only remove itself.

Implements CANBusInterface.

Definition at line 101 of file CANOpenBus.hpp.

virtual void removeListener ( CANListenerInterface dev  )  [inline, virtual]

Remove a CANListenerInterface from the bus.

Parameters:
dev The listener to be removed from the bus.
Postcondition:
The listener will no longer receive messages from the bus.
Invariant:
During a process(), the listener may only remove itself.

Implements CANBusInterface.

Definition at line 109 of file CANOpenBus.hpp.

virtual void write ( const CANMessage msg  )  [inline, virtual]

Write a CANMessage to the bus.

CANDevices can use this to put data on the CANBus. When this call returns, you are still the owner of msg.

Parameters:
msg A CANMessage which will be put on the bus.

Implements CANBusInterface.

Definition at line 117 of file CANOpenBus.hpp.

References CANMessage::origin, and CANListenerInterface::process().

Referenced by CANOpenBus::sync().


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

Generated on Tue Aug 25 14:09:55 2009 for OrocosComponentLibrary by  doxygen 1.5.8