CanOpenReceiveThread.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of the SCHUNK Canopen Driver suite.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 SCHUNK GmbH, Lauffen/Neckar Germany
12 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
23 //----------------------------------------------------------------------
24 
25 #ifndef CANOPENRECEIVETHREAD_H
26 #define CANOPENRECEIVETHREAD_H
27 
28 #include <boost/thread.hpp>
29 
30 #include <icl_core/TimeSpan.h>
31 
34 
35 namespace icl_hardware {
36 namespace canopen_schunk {
37 
39 typedef boost::function<void (const icl_hardware::can::tCanMessage& msg)> ReceivedPacketCallback;
40 
50 {
51 public:
61  const ReceivedPacketCallback& received_callback );
62 
66  virtual ~CanOpenReceiveThread();
67 
69  void stop();
70 
71 private:
73  void workerFunction();
79 
82 
85 
87  ReceivedPacketCallback m_received_callback;
88 
90  boost::thread m_thread;
91 
94 };
95 
96 
97 
98 }} // end of NS
99 
100 #endif // CANOPENRECEIVETHREAD_H
signed int int32_t
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) ...
int32_t m_period_time_ms
Cycle period of the receive thread.
virtual ~CanOpenReceiveThread()
~CanOpenReceiveThread Destructor
int32_t receiveData()
receiveData Reads Data from the can driver and calls the data receivec callback if it was valid ...
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.


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