MIRA
|
A general interface for a CAN driver. More...
#include <can/CANDriver.h>
Public Member Functions | |
Class const & | getClass () const |
Constructor, destructor and reflect | |
CANDriver () | |
The default constructor. More... | |
virtual | ~CANDriver () |
The destructor. More... | |
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... | |
virtual std::string | getDriverInfo () |
Get some information about the driver. More... | |
Methods for open and close the CAN device | |
virtual void | open ()=0 |
Open the CAN driver. More... | |
virtual void | close ()=0 |
Close the CAN driver. More... | |
virtual CANStatusFlags | getStatus ()=0 |
Return the status of the CAN driver. More... | |
Message exchange methods | |
virtual void | sendMessage (const CANMessage &msg)=0 |
Send a new message over the CAN bus. More... | |
virtual bool | waitForNextMessage (Duration timeout)=0 |
Wait until a next message is available or until the timeout is reached. More... | |
virtual void | receiveMessage (CANMessage &oMsg, Time &oReceiveTime)=0 |
Receive a new message over the CAN bus. 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... | |
A general interface for a CAN driver.
|
inline |
The default constructor.
|
inlinevirtual |
The destructor.
|
inline |
The reflect method.
|
inline |
Return the current baud rate.
|
inline |
Set the baud rate.
[in] | baudRate | The baud rate. |
|
inline |
Return the device name for the CAN bus.
|
inline |
Set the device name.
[in] | deviceName | The device name. |
|
inlinevirtual |
Get some information about the driver.
Reimplemented in CANDriverPCAN, CANDriverMLCAN, and CANDriverSocketCAN.
|
pure virtual |
Open the CAN driver.
Implemented in CANDriverPCAN, CANDriverMLCAN, and CANDriverSocketCAN.
|
pure virtual |
Close the CAN driver.
Implemented in CANDriverPCAN, CANDriverMLCAN, and CANDriverSocketCAN.
|
pure virtual |
Return the status of the CAN driver.
Implemented in CANDriverPCAN, CANDriverMLCAN, and CANDriverSocketCAN.
|
pure virtual |
Send a new message over the CAN bus.
[in] | msg | The CAN message. |
Implemented in CANDriverPCAN, CANDriverMLCAN, and CANDriverSocketCAN.
|
pure virtual |
Wait until a next message is available or until the timeout is reached.
[in] | timeout | How long should we wait for a new message. |
Implemented in CANDriverPCAN, CANDriverMLCAN, and CANDriverSocketCAN.
|
pure virtual |
Receive a new message over the CAN bus.
[out] | oMsg | The CAN message. |
[out] | oReceiveTime | Time the message was received/send. |
Implemented in CANDriverPCAN, CANDriverMLCAN, and CANDriverSocketCAN.
|
protected |
The device name.
|
protected |
Used baud rate.