automotive-message-broker  0.14.803
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Protected Member Functions | List of all members
CANSocketAdapter Class Reference

Socket CAN device implementation based on BerliOS Socket CAN API. More...

#include <cansocketadapter.h>

Inheritance diagram for CANSocketAdapter:
CANAdapter

Public Member Functions

 CANSocketAdapter (CANObserver &observer)
 
virtual bool start (const char *ifName)
 
virtual void stop ()
 
virtual bool sendFrame (const can_frame &frame)
 
virtual bool registerCyclicMessageForReceive (int canId, double minCycleTime, double maxCycleTime)
 
virtual bool unregisterMessageForReceive (int canId)
 

Protected Member Functions

virtual void init ()
 
- Protected Member Functions inherited from CANAdapter
 CANAdapter (CANObserver &observer)
 

Additional Inherited Members

- Static Public Member Functions inherited from CANAdapter
static CANAdaptercreateCANAdapter (CANObserver &observer)
 
- Protected Attributes inherited from CANAdapter
CANObservermObserver
 

Detailed Description

Socket CAN device implementation based on BerliOS Socket CAN API.

Constructor & Destructor Documentation

CANSocketAdapter::CANSocketAdapter ( CANObserver observer)
Parameters
observerObserver that will receives CAN bus frames

Member Function Documentation

CANSocketAdapter::init ( )
protectedvirtual

Socket initialization and starts reading thread

CANSocketAdapter::registerCyclicMessageForReceive ( int  canId,
double  minCycleTime,
double  maxCycleTime 
)
virtual

Registers CAN ID of a cyclic message for receiving

Parameters
canIdCAN ID of the message.
minCycleTimeMinimal interval between messages in seconds. Set to 0 if not used.
maxCycleTimeMaximum interval between messages for timeout detection in seconds. Set to 0 if no timeout detection is necessary.
Returns
True if registration succeeds.

Implements CANAdapter.

CANSocketAdapter::sendFrame ( const can_frame &  frame)
virtual

Sends CAN frame over the socket CAN interface

Parameters
frameCAN frame to be sent
Returns
True if frame was sent

Implements CANAdapter.

CANSocketAdapter::start ( const char *  ifName)
virtual

Creates connection the specified network interface and starts listening on it.

Parameters
ifNameName of the CAN bus network interface
Returns
True if no error occurs.

Implements CANAdapter.

CANSocketAdapter::stop ( )
virtual

Closes socket connection and exits listening thread.

Implements CANAdapter.

CANSocketAdapter::unregisterMessageForReceive ( int  canId)
virtual

Un-registers CAN ID of a message used of receiving. Valid for cyclic and sporadic messages.

Parameters
canIdCAN ID of the message.
Returns
True if de-registration succeeds.

Implements CANAdapter.


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