Files
redAcore/WatchdogCore.h
Charl Wentzel 5dd0e88708 Minor Update:
- WatchdogCore:
  - Renamed FunctionType TYPE_WATCHDOG -> TYPE_WATCHDOGPING
- ApplicationCore:
  - Prevent overwriting existing Function Type
2018-11-25 10:19:52 +02:00

56 lines
1.2 KiB
C++

/*
* WatchdogCore.h
*
* Created on: July 2017
* Author: wentzelc
*/
#ifndef REDACORE_WATCHDOGCORE_H_
#define REDACORE_WATCHDOGCORE_H_
// Standard C/C++ Libraries
/* none */
// redA Libraries
#include "SelectableCore.h"
#include "LiteProtocolCore.h"
//---------------------------------------------------------------------------
// Function Constructor
#define TYPE_WATCHDOGPING "WatchdogPing"
CFunctionCore * NewWatchdogCore( const char * Name );
//---------------------------------------------------------------------------
class CWatchdogCore : public CSelectableCore
{
private:
// Command
CLiteProtocol * Protocol;
// Timing
timeval PingTimer;
int PingInterval;
// Handle
THandle * Ping;
public:
// Life Cycle
CWatchdogCore( const char * pName, const char * pType = TYPE_WATCHDOGPING );
virtual ~CWatchdogCore();
// Manually set Configuration
bool SetInterval( int pPingInterval );
// Initialisation
virtual bool Init( CDataMember * FunctionConfig );
// Process
virtual bool Process();
};
//---------------------------------------------------------------------------
#endif /* REDACORE_WATCHDOGCORE_H_ */