MIRA
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CANDriverSocketCAN Class Referenceabstract

A driver for SocketCAN device. More...

#include <can/CANDriverSocketCAN.h>

Inheritance diagram for CANDriverSocketCAN:
Inheritance graph
[legend]

Public Member Functions

 CANDriverSocketCAN ()
 Default constructor. More...
 
virtual ~CANDriverSocketCAN ()
 The destructor. More...
 
Class const & getClass () const
 
Implementation of class CANDriver
virtual std::string getDriverInfo ()
 Get some information about the driver. More...
 
virtual void open ()
 Open the CAN driver. More...
 
virtual void close ()
 Close the CAN driver. More...
 
virtual CANStatusFlags getStatus ()
 Return the status of the CAN driver. More...
 
virtual void sendMessage (const CANMessage &msg)
 Send a new message over the CAN bus. More...
 
virtual bool waitForNextMessage (Duration timeout)
 Wait until a next message is available or until the timeout is reached. More...
 
virtual void receiveMessage (CANMessage &oMsg, Time &oReceiveTime)
 Receive a new message over the CAN bus. More...
 
Constructor, destructor and reflect
template<typename Reflector >
void reflect (Reflector &r)
 The reflect method. More...
 
General methods
CANBaudRate getBaudRate () const
 Return the current baud rate. More...
 
void setBaudRate (const CANBaudRate &baudRate)
 Set the baud rate. More...
 
std::string getDeviceName () const
 Return the device name for the CAN bus. More...
 
void setDeviceName (const std::string &deviceName)
 Set the device name. More...
 

Static Public Member Functions

static PseudoClass const & CLASS ()
 

Protected Member Functions

virtual Class const & internalGetClass () const=0
 

Protected Attributes

std::string mDeviceName
 The device name. More...
 
CANBaudRate mBaudRate
 Used baud rate. More...
 

Detailed Description

A driver for SocketCAN device.

Constructor & Destructor Documentation

◆ CANDriverSocketCAN()

Default constructor.

◆ ~CANDriverSocketCAN()

virtual ~CANDriverSocketCAN ( )
virtual

The destructor.

Member Function Documentation

◆ getDriverInfo()

virtual std::string getDriverInfo ( )
virtual

Get some information about the driver.

Returns
The driver info string.

Reimplemented from CANDriver.

◆ open()

virtual void open ( )
virtual

Open the CAN driver.

Implements CANDriver.

◆ close()

virtual void close ( )
virtual

Close the CAN driver.

Implements CANDriver.

◆ getStatus()

virtual CANStatusFlags getStatus ( )
virtual

Return the status of the CAN driver.

Returns
The status of the driver.

Implements CANDriver.

◆ sendMessage()

virtual void sendMessage ( const CANMessage msg)
virtual

Send a new message over the CAN bus.

Parameters
[in]msgThe CAN message.

Implements CANDriver.

◆ waitForNextMessage()

virtual bool waitForNextMessage ( Duration  timeout)
virtual

Wait until a next message is available or until the timeout is reached.

Parameters
[in]timeoutHow long should we wait for a new message.

Implements CANDriver.

◆ receiveMessage()

virtual void receiveMessage ( CANMessage oMsg,
Time oReceiveTime 
)
virtual

Receive a new message over the CAN bus.

Parameters
[out]oMsgThe CAN message.
[out]oReceiveTimeTime the message was received/send.

Implements CANDriver.

◆ reflect()

void reflect ( Reflector &  r)
inlineinherited

The reflect method.

◆ getBaudRate()

CANBaudRate getBaudRate ( ) const
inlineinherited

Return the current baud rate.

Returns
The baud rate.

◆ setBaudRate()

void setBaudRate ( const CANBaudRate baudRate)
inlineinherited

Set the baud rate.

Parameters
[in]baudRateThe baud rate.

◆ getDeviceName()

std::string getDeviceName ( ) const
inlineinherited

Return the device name for the CAN bus.

Returns
The device name.

◆ setDeviceName()

void setDeviceName ( const std::string &  deviceName)
inlineinherited

Set the device name.

Parameters
[in]deviceNameThe device name.

Member Data Documentation

◆ mDeviceName

std::string mDeviceName
protectedinherited

The device name.

◆ mBaudRate

CANBaudRate mBaudRate
protectedinherited

Used baud rate.


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