FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kSvNode_EnableWatchdog ( kSvNode  node,
kBool  enable,
k64u  timeoutPeriod,
k64u  checkPeriod,
kSvWatchdogFx  callback,
kPointer  receiver 
)

Enables or disables the watchdog timer.

Watchdog timers are disabled by default. When the watchdog timer is enabled, the provided callback function will be invoked periodically, according to the checkPeriod argument. Refer to the kSvWatchdogFx documentation for information on how to implement this callback.

The timeoutPeriod argument determines the countdown period of the underlying watchdog timer. If the countdown reaches zero without positive affirmation of system liveliness (determined by the callback), the node will automatically reset. The watchdog countdown is restarted each time that the callback affirms liveliness. Naturally, timeoutPeriod should be set to something higher than checkPeriod, with a margin of safety to account for thread scheduling variability. Setting timeoutPeriod to twice the duration of checkPeriod would be a reasonable starting point.

Parameters
nodeNode object.
enablekTRUE to enable the watchdog.
timeoutPeriodCoundown period of the underlying watchdog (microseconds).
checkPeriodPeriod at which the system liveliness callback will be invoked (microseconds).
callbackSystem liveliness callback.
receiverCallback context pointer.
Returns
Operation status.
See also
kSvNode_HasWatchdog, kSvWatchdogFx