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

#include <HeartBeatMonitor.h>

Public Types

typedef boost::shared_ptr< const HeartBeatMonitorConstPtr
 Shared pointer to a const HeartBeatMonitor. More...
 
typedef boost::shared_ptr< HeartBeatMonitorPtr
 Shared pointer to a HeartBeatMonitor. More...
 

Public Member Functions

void addHeartbeat (const uint8_t node_id)
 Incoming heartbeats will trigger this function to update the most recent heartbeat time. More...
 
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. More...
 
 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. More...
 
void reset ()
 Resets the heartbeat monitor. This will make the monitor forget about all past heartbeats and start from scratch. More...
 
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. More...
 
 ~HeartBeatMonitor ()
 

Private Member Functions

void start ()
 starts thread execution More...
 
void stop ()
 stops thread execution More...
 
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. More...
 

Private Attributes

boost::function< void()> m_error_function
 
uint16_t m_period_time_ms
 Cycle period of the monitor thread. More...
 
bool m_running
 
boost::thread m_thread
 monitor thread handle More...
 
std::map< uint8_t, icl_core::TimeStampm_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

icl_hardware::canopen_schunk::HeartBeatMonitor::HeartBeatMonitor ( )

Definition at line 28 of file HeartBeatMonitor.cpp.

icl_hardware::canopen_schunk::HeartBeatMonitor::~HeartBeatMonitor ( )

Definition at line 35 of file HeartBeatMonitor.cpp.

Member Function Documentation

void icl_hardware::canopen_schunk::HeartBeatMonitor::addHeartbeat ( const uint8_t  node_id)

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.

uint16_t icl_hardware::canopen_schunk::HeartBeatMonitor::getHeartBeatCycleTime ( ) const
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.

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.

void icl_hardware::canopen_schunk::HeartBeatMonitor::reset ( )

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.

void icl_hardware::canopen_schunk::HeartBeatMonitor::start ( )
private

starts thread execution

Definition at line 97 of file HeartBeatMonitor.cpp.

void icl_hardware::canopen_schunk::HeartBeatMonitor::stop ( )
private

stops thread execution

Definition at line 91 of file HeartBeatMonitor.cpp.

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

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

boost::function<void()> icl_hardware::canopen_schunk::HeartBeatMonitor::m_error_function
private

Definition at line 110 of file HeartBeatMonitor.h.

uint16_t icl_hardware::canopen_schunk::HeartBeatMonitor::m_period_time_ms
private

Cycle period of the monitor thread.

Definition at line 105 of file HeartBeatMonitor.h.

bool icl_hardware::canopen_schunk::HeartBeatMonitor::m_running
private

Definition at line 112 of file HeartBeatMonitor.h.

boost::thread icl_hardware::canopen_schunk::HeartBeatMonitor::m_thread
private

monitor thread handle

Definition at line 108 of file HeartBeatMonitor.h.

std::map<uint8_t, icl_core::TimeStamp> icl_hardware::canopen_schunk::HeartBeatMonitor::m_timestamp_record
private

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 Mon Jun 10 2019 15:07:49