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. | |
void | stop () |
stops thread execution | |
virtual | ~CanOpenReceiveThread () |
~CanOpenReceiveThread Destructor | |
Private Member Functions | |
int32_t | receiveData () |
receiveData Reads Data from the can driver and calls the data receivec callback if it was valid | |
void | workerFunction () |
state machine processing received data | |
Private Attributes | |
boost::shared_ptr < icl_hardware::can::tCanDevice > | m_can_device |
Can handle for message receiving. | |
icl_hardware::can::tCanMessage | m_can_msg |
Can message for storing and transmission of received data. | |
int32_t | m_period_time_ms |
Cycle period of the receive thread. | |
ReceivedPacketCallback | m_received_callback |
Callback for parsing of correctly received can messages (protocoll will be evaluated there) | |
boost::thread | m_thread |
Feedback thread handle. |
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.
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.
period | Time periods between two can readings |
can_device | shared pointer to a can device |
received_callback | Handle to a callback function that processes the can messages |
Definition at line 32 of file CanOpenReceiveThread.cpp.
~CanOpenReceiveThread Destructor
Definition at line 42 of file CanOpenReceiveThread.cpp.
receiveData Reads Data from the can driver and calls the data receivec callback if it was valid
Definition at line 91 of file CanOpenReceiveThread.cpp.
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.
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.
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.