30 namespace canopen_schunk {
35 : m_period_time_ms(period.toMSec()),
36 m_can_device (can_device),
37 m_received_callback(received_callback)
59 if (receive_result == -ENODATA)
63 else if (receive_result != 0)
77 boost::this_thread::sleep(boost::posix_time::milliseconds(
m_period_time_ms));
79 catch(boost::thread_interrupted&)
94 if ( receive_result > 0)
100 return receive_result;
boost::thread m_thread
Feedback thread handle.
icl_hardware::can::tCanMessage m_can_msg
Can message for storing and transmission of received data.
ReceivedPacketCallback m_received_callback
Callback for parsing of correctly received can messages (protocoll will be evaluated there) ...
void stop()
stops thread execution
int32_t m_period_time_ms
Cycle period of the receive thread.
#define LOGGING_WARNING_C(streamname, classname, arg)
virtual ~CanOpenReceiveThread()
~CanOpenReceiveThread Destructor
int32_t receiveData()
receiveData Reads Data from the can driver and calls the data receivec callback if it was valid ...
ThreadStream & endl(ThreadStream &stream)
The CanOpenReceiveThread class handles incoming canOpen messages.
void workerFunction()
state machine processing received data
CanOpenReceiveThread(const icl_core::TimeSpan &period, const boost::shared_ptr< icl_hardware::can::tCanDevice > &can_device, const ReceivedPacketCallback &received_callback)
CanOpenReceiveThread constructor.
boost::function< void(const icl_hardware::can::tCanMessage &msg)> ReceivedPacketCallback
definition of boost function callback for received packages
boost::shared_ptr< icl_hardware::can::tCanDevice > m_can_device
Can handle for message receiving.
#define LOGGING_ERROR_C(streamname, classname, arg)