Public Types | Public Member Functions | Private Member Functions | Private Attributes
icl_hardware::canopen_schunk::HeartBeatMonitor Class Reference

#include <HeartBeatMonitor.h>

List of all members.

Public Types

typedef boost::shared_ptr
< const HeartBeatMonitor
ConstPtr
 Shared pointer to a const HeartBeatMonitor.
typedef boost::shared_ptr
< HeartBeatMonitor
Ptr
 Shared pointer to a HeartBeatMonitor.

Public Member Functions

void addHeartbeat (const uint8_t node_id)
 Incoming heartbeats will trigger this function to update the most recent heartbeat time.
uint16_t getHeartBeatCycleTime () const
 The HeartbeatMonitor checks for missing heartbeat messages with this cycle time. If the last heartbeat message for one node was received more than one cycle ago, the error function will be triggered. So basically, this cycle time should be greater than the smallest heartbeat time.
 HeartBeatMonitor ()
void registerErrorCallback (const boost::function< void()> &f)
 This function will be called as soon as one node is missing a heartbeat message. Probably this function should turn off / stop all devices.
void reset ()
 Resets the heartbeat monitor. This will make the monitor forget about all past heartbeats and start from scratch.
void setHeartBeatCycleTime (const uint16_t heartbeat_cycle_time_ms)
 The HeartbeatMonitor checks for missing heartbeat messages with this cycle time. If the last heartbeat message for one node was received more than one cycle ago, the error function will be triggered. So basically, this cycle time should be greater than the smallest heartbeat time.
 ~HeartBeatMonitor ()

Private Member Functions

void start ()
 starts thread execution
void stop ()
 stops thread execution
void workerFunction ()
 Thread worker function for the Heartbeat monitor. This function will regularly check for missing heartbeat messages. If a heartbeat message is missing, m_error_function will be called.

Private Attributes

boost::function< void()> m_error_function
uint16_t m_period_time_ms
 Cycle period of the monitor thread.
bool m_running
boost::thread m_thread
 monitor thread handle
std::map< uint8_t,
icl_core::TimeStamp
m_timestamp_record

Detailed Description

Definition at line 34 of file HeartBeatMonitor.h.


Member Typedef Documentation

Shared pointer to a const HeartBeatMonitor.

Definition at line 40 of file HeartBeatMonitor.h.

Shared pointer to a HeartBeatMonitor.

Definition at line 38 of file HeartBeatMonitor.h.


Constructor & Destructor Documentation

Definition at line 28 of file HeartBeatMonitor.cpp.

Definition at line 35 of file HeartBeatMonitor.cpp.


Member Function Documentation

Incoming heartbeats will trigger this function to update the most recent heartbeat time.

Parameters:
node_idNode-ID the heartbeat message belonged to.

Definition at line 81 of file HeartBeatMonitor.cpp.

The HeartbeatMonitor checks for missing heartbeat messages with this cycle time. If the last heartbeat message for one node was received more than one cycle ago, the error function will be triggered. So basically, this cycle time should be greater than the smallest heartbeat time.

Returns:
The cycle time in milliseconds

Definition at line 69 of file HeartBeatMonitor.h.

void icl_hardware::canopen_schunk::HeartBeatMonitor::registerErrorCallback ( const boost::function< void()> &  f)

This function will be called as soon as one node is missing a heartbeat message. Probably this function should turn off / stop all devices.

Definition at line 41 of file HeartBeatMonitor.cpp.

Resets the heartbeat monitor. This will make the monitor forget about all past heartbeats and start from scratch.

Definition at line 110 of file HeartBeatMonitor.cpp.

void icl_hardware::canopen_schunk::HeartBeatMonitor::setHeartBeatCycleTime ( const uint16_t  heartbeat_cycle_time_ms) [inline]

The HeartbeatMonitor checks for missing heartbeat messages with this cycle time. If the last heartbeat message for one node was received more than one cycle ago, the error function will be triggered. So basically, this cycle time should be greater than the smallest heartbeat time.

Parameters:
heartbeat_cycle_time_msThe cycle time in milliseconds

Definition at line 79 of file HeartBeatMonitor.h.

starts thread execution

Definition at line 97 of file HeartBeatMonitor.cpp.

stops thread execution

Definition at line 91 of file HeartBeatMonitor.cpp.

Thread worker function for the Heartbeat monitor. This function will regularly check for missing heartbeat messages. If a heartbeat message is missing, m_error_function will be called.

Definition at line 47 of file HeartBeatMonitor.cpp.


Member Data Documentation

Definition at line 110 of file HeartBeatMonitor.h.

Cycle period of the monitor thread.

Definition at line 105 of file HeartBeatMonitor.h.

Definition at line 112 of file HeartBeatMonitor.h.

monitor thread handle

Definition at line 108 of file HeartBeatMonitor.h.

Definition at line 102 of file HeartBeatMonitor.h.


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


schunk_canopen_driver
Author(s): Felix Mauch , Georg Heppner
autogenerated on Thu Jun 6 2019 20:17:24