ApparatusFramework::WatchdogTaskSupervisor Class Reference
[Pattern Services]

#include <PatternServices/current/include/WDogSprv.h>

Inheritance diagram for ApparatusFramework::WatchdogTaskSupervisor:
ApparatusFramework::Task

List of all members.

Public Types

enum  WatchdogTaskSupervisorStateEnum { NORMAL_OPERATION, DUMPING_INFO, FAILURE }

Public Member Functions

void initialize ()
void startup ()
int operator== (const WatchdogTaskSupervisor &right) const
int operator!= (const WatchdogTaskSupervisor &right) const
void updateConfig ()
virtual void runBody ()
void registerTask (SupervisedTask *pWannabeSupervisedTask)
void unregisterTask (SupervisedTask *pWannabeSupervisedTask)

Static Public Member Functions

static WatchdogTaskSupervisorCreate (IntFuncPtr resetCauseCheckFunction, VoidFuncPtr kickFunction, const int watchTime=BBVPKG_PATTERNSERVICES_WDGSUPERVISOR_SUPERVISION_WATCH_TIMEOUT)
static WatchdogTaskSupervisorDefault ()
static bool IsCreated ()
static void watch ()
static void handleWatchdogReset ()
static int wasWatchdogReset ()
static int isInitialized ()
static void installInitializedCallback (VoidFuncPtr pCallback)
static void dumpWatchdogInfo ()
static bool cmdDumpWatchdogInfo (const char *param)

Detailed Description

Holds list of supervised tasks that are periodically checked. If one of the tasks is not alive any longer, a watchdog reset is initated else the watchdog is kicked. For further information see the documentation.

Definition at line 140 of file WDogSprv.h.


Member Enumeration Documentation

Nested types States for the simple main state machine of the WatchdogTaskSupervisor.

  • NORMAL_OPERATION As it says :-)
  • DUMPING_INFO The watchdog supervisor dumps information to the logger when a watchdog reset is initiated by a supervised task.
  • FAILURE The state after all info has been dumped.
Enumerator:
NORMAL_OPERATION 
DUMPING_INFO 
FAILURE 

Definition at line 149 of file WDogSprv.h.


Member Function Documentation

static bool ApparatusFramework::WatchdogTaskSupervisor::cmdDumpWatchdogInfo ( const char *  param  )  [static]

Command interpreter command to dump the watchdog info

Parameters:
param A parameter, that was given with the command line (unused here)
Returns:
bool true: ok, false: failure
static WatchdogTaskSupervisor* ApparatusFramework::WatchdogTaskSupervisor::Create ( IntFuncPtr  resetCauseCheckFunction,
VoidFuncPtr  kickFunction,
const int  watchTime = BBVPKG_PATTERNSERVICES_WDGSUPERVISOR_SUPERVISION_WATCH_TIMEOUT 
) [static]

singleton methods Creates an instance of the singleton if none exists yet. The object is created in static memory.

Parameters:
resetCauseCheckFunction Function to determine the source of a reset.
kickFunction Function that kicks the watchdog.
watchTime Time in ms between two watch calls.
Returns:
A pointer to the created singleton instance.
static WatchdogTaskSupervisor* ApparatusFramework::WatchdogTaskSupervisor::Default (  )  [static]

References an instance that has been previously created.

Returns:
A pointer to the singleton instance.
static void ApparatusFramework::WatchdogTaskSupervisor::dumpWatchdogInfo (  )  [static]

Diagnostic function. Dumps a task table onto the Logger. Can be used to find the source of the watchdog reset.

static void ApparatusFramework::WatchdogTaskSupervisor::handleWatchdogReset (  )  [static]

Is called after the startup to store the watchdog reset in the error log. It also checks how many failed startups we have seen so far.

void ApparatusFramework::WatchdogTaskSupervisor::initialize (  ) 

Factory startup Initializes the component according to the factory startup pattern.

static void ApparatusFramework::WatchdogTaskSupervisor::installInitializedCallback ( VoidFuncPtr  pCallback  )  [inline, static]

This allows the client to install a callback method that is called as soon as all supervised tasks have started up correctly.

Parameters:
pCallback The callback to be installed.

Definition at line 249 of file WDogSprv.h.

static bool ApparatusFramework::WatchdogTaskSupervisor::IsCreated (  )  [static]

States whether an instance of this singleton has been created.

Returns:
True if an instance has been created, false otherwise.
static int ApparatusFramework::WatchdogTaskSupervisor::isInitialized (  )  [static]

This decides from where the watchdog is kicked. During the startup phase, this is done out of an isr for instance. After the startup period (if it was successful), we switch to the supervisor task. This method is needed to find out wheter we already made the switch. So the client may poll using this method to find out the state of the supervisor. Another possiblilty is to install a callback that will be called by the supervisor when all tasks are started up.

int ApparatusFramework::WatchdogTaskSupervisor::operator!= ( const WatchdogTaskSupervisor right  )  const

Unequality operator

int ApparatusFramework::WatchdogTaskSupervisor::operator== ( const WatchdogTaskSupervisor right  )  const

Operators Equality operator

void ApparatusFramework::WatchdogTaskSupervisor::registerTask ( SupervisedTask pWannabeSupervisedTask  ) 

Supervisor methods Is used by a task that wants to be supervised. It adds the task to the supervisors task list.

Parameters:
pWannabeSupervisedTask Task that wants to get supervised.
virtual void ApparatusFramework::WatchdogTaskSupervisor::runBody (  )  [virtual]

Task methods The periodical watch is initiated out of a task. So the supervisor is a task.

Reimplemented from ApparatusFramework::Task.

void ApparatusFramework::WatchdogTaskSupervisor::startup (  ) 

Starts up the component according to the factory startup pattern.

void ApparatusFramework::WatchdogTaskSupervisor::unregisterTask ( SupervisedTask pWannabeSupervisedTask  ) 

Cancels the task out of the task list. It will not be controlled any more.

Parameters:
pWannabeSupervisedTask Task that no longer wants to be supervised.
void ApparatusFramework::WatchdogTaskSupervisor::updateConfig (  ) 

Is called if the configuration changes.

static int ApparatusFramework::WatchdogTaskSupervisor::wasWatchdogReset (  )  [static]

Used to find out wheter the last reset was a watchdog reset. Same function as provided in the constructor

Returns:
int 0 No watchdog reset, 1 Watchdog reset
static void ApparatusFramework::WatchdogTaskSupervisor::watch (  )  [static]

This method is called periodically and initiates the supervisor to look through the supervised tasks.

© 2004-2010 bbv Software Services AG / Apparatus Services