Public Member Functions | Private Member Functions | Private Attributes | List of all members
icl_hardware::canopen_schunk::CanOpenReceiveThread Class Reference

The CanOpenReceiveThread class handles incoming canOpen messages. More...

#include <CanOpenReceiveThread.h>

Public Member Functions

 CanOpenReceiveThread (const icl_core::TimeSpan &period, const boost::shared_ptr< icl_hardware::can::tCanDevice > &can_device, const ReceivedPacketCallback &received_callback)
 CanOpenReceiveThread constructor. More...
 
void stop ()
 stops thread execution More...
 
virtual ~CanOpenReceiveThread ()
 ~CanOpenReceiveThread Destructor More...
 

Private Member Functions

int32_t receiveData ()
 receiveData Reads Data from the can driver and calls the data receivec callback if it was valid More...
 
void workerFunction ()
 state machine processing received data More...
 

Private Attributes

boost::shared_ptr< icl_hardware::can::tCanDevicem_can_device
 Can handle for message receiving. More...
 
icl_hardware::can::tCanMessage m_can_msg
 Can message for storing and transmission of received data. More...
 
int32_t m_period_time_ms
 Cycle period of the receive thread. More...
 
ReceivedPacketCallback m_received_callback
 Callback for parsing of correctly received can messages (protocoll will be evaluated there) More...
 
boost::thread m_thread
 Feedback thread handle. More...
 

Detailed Description

The CanOpenReceiveThread class handles incoming canOpen messages.

The CanOpenReceiveThread uses the can device to listen for new messages. Once received it processes the general message to ensure that it is a valid can message without errors. If so the actual parsing of the message is handled by the CanOpenController class which is called via callback.

Definition at line 49 of file CanOpenReceiveThread.h.

Constructor & Destructor Documentation

icl_hardware::canopen_schunk::CanOpenReceiveThread::CanOpenReceiveThread ( const icl_core::TimeSpan period,
const boost::shared_ptr< icl_hardware::can::tCanDevice > &  can_device,
const ReceivedPacketCallback received_callback 
)

CanOpenReceiveThread constructor.

Parameters
periodTime periods between two can readings
can_deviceshared pointer to a can device
received_callbackHandle to a callback function that processes the can messages

Definition at line 32 of file CanOpenReceiveThread.cpp.

icl_hardware::canopen_schunk::CanOpenReceiveThread::~CanOpenReceiveThread ( )
virtual

~CanOpenReceiveThread Destructor

Definition at line 42 of file CanOpenReceiveThread.cpp.

Member Function Documentation

int32_t icl_hardware::canopen_schunk::CanOpenReceiveThread::receiveData ( )
private

receiveData Reads Data from the can driver and calls the data receivec callback if it was valid

Returns
0 on succes, a value <0 if an error eccoured

Definition at line 91 of file CanOpenReceiveThread.cpp.

void icl_hardware::canopen_schunk::CanOpenReceiveThread::stop ( )

stops thread execution

Definition at line 86 of file CanOpenReceiveThread.cpp.

void icl_hardware::canopen_schunk::CanOpenReceiveThread::workerFunction ( )
private

state machine processing received data

Definition at line 49 of file CanOpenReceiveThread.cpp.

Member Data Documentation

boost::shared_ptr<icl_hardware::can::tCanDevice> icl_hardware::canopen_schunk::CanOpenReceiveThread::m_can_device
private

Can handle for message receiving.

Definition at line 84 of file CanOpenReceiveThread.h.

icl_hardware::can::tCanMessage icl_hardware::canopen_schunk::CanOpenReceiveThread::m_can_msg
private

Can message for storing and transmission of received data.

Definition at line 93 of file CanOpenReceiveThread.h.

int32_t icl_hardware::canopen_schunk::CanOpenReceiveThread::m_period_time_ms
private

Cycle period of the receive thread.

Definition at line 81 of file CanOpenReceiveThread.h.

ReceivedPacketCallback icl_hardware::canopen_schunk::CanOpenReceiveThread::m_received_callback
private

Callback for parsing of correctly received can messages (protocoll will be evaluated there)

Definition at line 87 of file CanOpenReceiveThread.h.

boost::thread icl_hardware::canopen_schunk::CanOpenReceiveThread::m_thread
private

Feedback thread handle.

Definition at line 90 of file CanOpenReceiveThread.h.


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


schunk_canopen_driver
Author(s): Felix Mauch , Georg Heppner
autogenerated on Mon Jun 10 2019 15:07:49