Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
can::SocketCANInterface Class Reference

#include <socketcan.h>

Inheritance diagram for can::SocketCANInterface:
Inheritance graph
[legend]

Public Member Functions

virtual bool doesLoopBack () const
 
int getInternalSocket ()
 
virtual bool init (const std::string &device, bool loopback)
 
virtual bool recover ()
 
 SocketCANInterface ()
 
virtual bool translateError (unsigned int internal_error, std::string &str)
 
- Public Member Functions inherited from can::AsioDriver< boost::asio::posix::stream_descriptor >
virtual FrameListenerConstSharedPtr createMsgListener (const FrameDelegate &delegate)
 
virtual FrameListenerConstSharedPtr createMsgListener (const Frame::Header &h, const FrameDelegate &delegate)
 
virtual StateListenerConstSharedPtr createStateListener (const StateDelegate &delegate)
 
State getState ()
 
virtual void run ()
 
virtual bool send (const Frame &msg)
 
virtual void shutdown ()
 
virtual ~AsioDriver ()
 
- Public Member Functions inherited from can::DriverInterface
virtual ~DriverInterface ()
 
- Public Member Functions inherited from can::CommInterface
virtual ~CommInterface ()
 
- Public Member Functions inherited from can::StateInterface
virtual ~StateInterface ()
 

Protected Member Functions

virtual bool enqueue (const Frame &msg)
 
void readFrame (const boost::system::error_code &error)
 
virtual void triggerReadSome ()
 
- Protected Member Functions inherited from can::AsioDriver< boost::asio::posix::stream_descriptor >
 AsioDriver ()
 
void dispatchFrame (const Frame &msg)
 
void frameReceived (const boost::system::error_code &error)
 
void setDriverState (State::DriverState state)
 
void setErrorCode (const boost::system::error_code &error)
 
void setInternalError (unsigned int internal_error)
 
void setNotReady ()
 

Protected Attributes

std::string device_
 
can_frame frame_
 
- Protected Attributes inherited from can::AsioDriver< boost::asio::posix::stream_descriptor >
Frame input_
 
boost::asio::io_service io_service_
 
boost::asio::posix::stream_descriptor socket_
 
boost::asio::strand strand_
 

Private Attributes

bool loopback_
 
int sc_
 
boost::mutex send_mutex_
 

Additional Inherited Members

- Public Types inherited from can::CommInterface
typedef fastdelegate::FastDelegate1< const Frame & > FrameDelegate
 
typedef Listener< const FrameDelegate, const Frame & > FrameListener
 
typedef FrameListener::ListenerConstSharedPtr FrameListenerConstSharedPtr
 
- Public Types inherited from can::StateInterface
typedef fastdelegate::FastDelegate1< const State & > StateDelegate
 
typedef Listener< const StateDelegate, const State & > StateListener
 
typedef StateListener::ListenerConstSharedPtr StateListenerConstSharedPtr
 

Detailed Description

Definition at line 20 of file socketcan.h.

Constructor & Destructor Documentation

can::SocketCANInterface::SocketCANInterface ( )
inline

Definition at line 24 of file socketcan.h.

Member Function Documentation

virtual bool can::SocketCANInterface::doesLoopBack ( ) const
inlinevirtual

Implements can::DriverInterface.

Definition at line 28 of file socketcan.h.

virtual bool can::SocketCANInterface::enqueue ( const Frame msg)
inlineprotectedvirtual
int can::SocketCANInterface::getInternalSocket ( )
inline

Definition at line 157 of file socketcan.h.

virtual bool can::SocketCANInterface::init ( const std::string &  device,
bool  loopback 
)
inlinevirtual

initialize interface

Parameters
[in]devicedriver-specific device name/path
[in]loopbackloop-back own messages
Returns
true if device was initialized succesfully, false otherwise

Implements can::DriverInterface.

Definition at line 32 of file socketcan.h.

void can::SocketCANInterface::readFrame ( const boost::system::error_code &  error)
inlineprotected

Definition at line 192 of file socketcan.h.

virtual bool can::SocketCANInterface::recover ( )
inlinevirtual

Recover interface after errors and emergency stops

Returns
true if device was recovered succesfully, false otherwise

Implements can::DriverInterface.

Definition at line 113 of file socketcan.h.

virtual bool can::SocketCANInterface::translateError ( unsigned int  internal_error,
std::string &  str 
)
inlinevirtual

Implements can::DriverInterface.

Definition at line 120 of file socketcan.h.

virtual void can::SocketCANInterface::triggerReadSome ( )
inlineprotectedvirtual

Member Data Documentation

std::string can::SocketCANInterface::device_
protected

Definition at line 161 of file socketcan.h.

can_frame can::SocketCANInterface::frame_
protected

Definition at line 162 of file socketcan.h.

bool can::SocketCANInterface::loopback_
private

Definition at line 21 of file socketcan.h.

int can::SocketCANInterface::sc_
private

Definition at line 22 of file socketcan.h.

boost::mutex can::SocketCANInterface::send_mutex_
private

Definition at line 218 of file socketcan.h.


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


socketcan_interface
Author(s): Mathias Lüdtke
autogenerated on Sat May 4 2019 02:40:41