Class DummyInterface

Inheritance Relationships

Base Type

Class Documentation

class DummyInterface : public can::DriverInterface

Public Functions

inline explicit DummyInterface(bool loopback)
inline bool add(const std::string &k, const Frame &v, bool multi)
inline bool add(const Frame &k, const Frame &v, bool multi)
inline bool add(const std::string &k, const std::string &v, bool multi)
inline bool add(const Frame &k, const std::string &v, bool multi)
inline virtual bool send(const Frame &msg)

enqueue frame for sending

Parameters:

msg[in] message to be enqueued

Returns:

true if frame was enqueued succesfully, otherwise false

inline virtual FrameListenerConstSharedPtr createMsgListener(const FrameFunc &delegate)

acquire a listener for the specified delegate, that will get called for all messages

Parameters:

delegate[in] delegate to be bound by the listener

Returns:

managed pointer to listener

inline virtual FrameListenerConstSharedPtr createMsgListener(const Frame::Header &h, const FrameFunc &delegate)

acquire a listener for the specified delegate, that will get called for messages with demanded ID

Parameters:
  • header[in] CAN header to restrict listener on

  • delegate[in] delegate to be bound listener

Returns:

managed pointer to listener

inline virtual bool recover()

Recover interface after errors and emergency stops

Returns:

true if device was recovered succesfully, false otherwise

inline virtual State getState()
Returns:

current state of driver

inline virtual void shutdown()

shutdown interface

Returns:

true if shutdown was succesful, false otherwise

inline virtual bool translateError(unsigned int internal_error, std::string &str)
inline virtual bool doesLoopBack() const
inline virtual void run()
inline virtual bool init(const std::string &device, bool loopback)

initialize interface

Parameters:
  • device[in] driver-specific device name/path

  • loopback[in] loop-back own messages

Returns:

true if device was initialized succesfully, false otherwise

inline virtual StateListenerConstSharedPtr createStateListener(const StateFunc &delegate)

acquire a listener for the specified delegate, that will get called for all state changes

Parameters:

delegate[in] delegate to be bound by the listener

Returns:

managed pointer to listener