43 #ifndef _MLAB_CANDRIVER_H_ 44 #define _MLAB_CANDRIVER_H_ 50 namespace mira {
namespace can {
73 template<
typename Reflector>
77 r.member(
"Device", mDeviceName,
"The device name");
101 mBaudRate = baudRate;
119 mDeviceName = deviceName;
128 return "No CAN-Driver information available.";
140 virtual void open() = 0;
145 virtual void close() = 0;
163 virtual void sendMessage(
const CANMessage& msg) = 0;
169 virtual bool waitForNextMessage(
Duration timeout) = 0;
176 virtual void receiveMessage(
CANMessage& oMsg,
Time& oReceiveTime) = 0;
CANBaudRate
An enum of the different CAN baud rates.
Definition: CANDefs.h:59
virtual ~CANDriver()
The destructor.
Definition: CANDriver.h:70
CANBaudRate getBaudRate() const
Return the current baud rate.
Definition: CANDriver.h:90
A general interface for a CAN driver.
Definition: CANDriver.h:57
void setDeviceName(const std::string &deviceName)
Set the device name.
Definition: CANDriver.h:117
boost::shared_ptr< CANDriver > CANDriverPtr
Definition: CANDriver.h:186
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
std::string getDeviceName() const
Return the device name for the CAN bus.
Definition: CANDriver.h:108
CANDriver()
The default constructor.
Definition: CANDriver.h:66
#define MLAB_CAN_EXPORT
Definition: CANExports.h:57
CANStatusFlags
CAN status enum definitions.
Definition: CANDefs.h:76
CANBaudRate mBaudRate
Used baud rate.
Definition: CANDriver.h:183
std::string mDeviceName
The device name.
Definition: CANDriver.h:182
void reflect(Reflector &r)
The reflect method.
Definition: CANDriver.h:74
virtual std::string getDriverInfo()
Get some information about the driver.
Definition: CANDriver.h:126
A definition of a CAN message.
Definition: CANDefs.h:105
Common CANbus definitions.
void setBaudRate(const CANBaudRate &baudRate)
Set the baud rate.
Definition: CANDriver.h:99
250 kBit/s
Definition: CANDefs.h:62