43 #ifndef _MLAB_CANCHANNELINTERFACE_H_ 44 #define _MLAB_CANCHANNELINTERFACE_H_ 52 namespace mira {
namespace can {
67 mAuthority(authority.getNamespace(),
69 mLastTime(
Time::now())
73 &CANChannelInterface::onIncoming,
88 boost::mutex::scoped_lock lock(mOutgoingChannelMutex);
90 auto w = mOutChannel.write();
92 Time ts = w->timestamp;
104 mInChannel.readInterval(mLastTime, message->timestamp);
105 mLastTime = message->timestamp;
116 boost::mutex mOutgoingChannelMutex;
Abstract class for a hardware specific CAN driver.
An interface for providing CAN messages with the MIRA framework.
Definition: CANChannelInterface.h:59
Channel< T > publish(const std::string &channelID)
virtual void sendMessage(const CANMessage &msg)
Send a new message over the CAN bus.
Definition: CANChannelInterface.h:84
void onMessageReceived(const CANMessage &message, const Time &time)
A general interface for a CAN driver.
Definition: CANInterface.h:83
boost::shared_ptr< CANChannelInterface > CANChannelInterfacePtr
A shared pointer for CANChannelInterface.
Definition: CANChannelInterface.h:120
void onMessageSend(const CANMessage &message, const Time &time)
CANChannelInterface(Authority &authority)
The constructor.
Definition: CANChannelInterface.h:66
A definition of a CAN message.
Definition: CANDefs.h:105
Channel< T > subscribe(const std::string &channelID, const Duration &storageDuration=Duration::seconds(0))