Module: digiwdog

The systems hardware watchdog is exposed in the digiwdog built-in module. This module contains a single class named Watchdog, each instance of which represents a task or event in the system that promises to stroke the watchdog at least as often as a given rate, failure of which to do so will result in the system rebooting.

The Watchdog class constructor takes two arguments. The first argument is the promised stroke rate. This is given in seconds and must be no less than ten seconds. A second optional argument allows a descriptive name to be attached to the object for identification of watchdog objects in the system and possible future use in reporting watchdog activity.

The resulting Watchdog object from a call to the constructor contains a single method named stroke(). stroke() takes no arguments and must be called at least as often as the promised rate in order to keep the system up.

When a Watchdog object goes out of scope, it will automatically unregister itself, so that allowing an object to go out of scope and not be stroked is not a failure that will cause the system to reboot. objects can be explicitly removed with the del keyword in Python to explicitly lose the references and unregister.