CARMA C++
carma::canbus::SocketCan Class Reference

Implements the CanIo interface using the socketcan framework. More...

#include <carma/canbus/SocketCan.h>

Inheritance diagram for carma::canbus::SocketCan:
carma::canbus::CanIo carma::canbus::CanOutput

Public Member Functions

void echoAll (bool enable)
 Echo all CAN messages. More...
 
BusStatusMap getBusStatus () const
 Retrieve bus statistics indexed by bus id. More...
 
carma::canbus::Message getMessage ()
 Wait and retrieve a CAN message. More...
 
void postMessage (const carma::canbus::Message &msg, carma::canbus::txPriorityType p=carma::canbus::NORMAL)
 Post a message to a single or multiple CAN busses. More...
 
 SocketCan ()
 Constructor for use with all busses on the system. More...
 
 SocketCan (const ::std::vector< ::std::string > &canInterfaces)
 Constructor for use with specific busses. More...
 
virtual ~SocketCan ()
 Destructor. More...
 
- Public Member Functions inherited from carma::canbus::CanIo
virtual void clearReadQueue ()
 Clear any underlying read buffers. More...
 
virtual void queueMessage (const Message &msg)
 Queue CAN message to be read for simulation purposes. More...
 
virtual void setTimestampEchoLatency (int tsLatency, busIdType busId)
 Set timestamp echo latency. More...
 
virtual ~CanIo ()
 Virtual destructor. More...
 

Static Public Member Functions

static busIdType parseBusId (const std::string &canInterfaceName)
 Parse bus id given an interface name (e.g. More...
 

Detailed Description

Implements the CanIo interface using the socketcan framework.

Definition at line 26 of file SocketCan.h.

Constructor & Destructor Documentation

carma::canbus::SocketCan::SocketCan ( )

Constructor for use with all busses on the system.

carma::canbus::SocketCan::SocketCan ( const ::std::vector< ::std::string > &  canInterfaces)
explicit

Constructor for use with specific busses.

Parameters
canInterfacesVector of interface names (e.g. ["can0", "can1"]).
virtual carma::canbus::SocketCan::~SocketCan ( )
virtual

Destructor.

Member Function Documentation

void carma::canbus::SocketCan::echoAll ( bool  enable)
virtual

Echo all CAN messages.

This method causes sent messages to be echoed back through the read interface.

Reimplemented from carma::canbus::CanIo.

BusStatusMap carma::canbus::SocketCan::getBusStatus ( ) const
virtual

Retrieve bus statistics indexed by bus id.

Reimplemented from carma::canbus::CanIo.

carma::canbus::Message carma::canbus::SocketCan::getMessage ( )
virtual

Wait and retrieve a CAN message.

This routine is boost::thread interruptable and carma thread quitable.

Implements carma::canbus::CanIo.

static busIdType carma::canbus::SocketCan::parseBusId ( const std::string &  canInterfaceName)
static

Parse bus id given an interface name (e.g.

can0).

void carma::canbus::SocketCan::postMessage ( const carma::canbus::Message msg,
carma::canbus::txPriorityType  p = carma::canbus::NORMAL 
)
virtual

Post a message to a single or multiple CAN busses.

Implements carma::canbus::CanOutput.


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