See: Description
Interface | Description |
---|---|
WatchdogTimer |
The
WatchdogTimer interface provides methods for controlling a watchdog timer that can be used to force the
device to reboot (or depending on the platform, the Java Virtual Machine to restart). |
WindowedWatchdogTimer |
The
WindowedWatchdogTimer interface provides methods for controlling a watchdog timer that can be used to
force the device to reboot (or depending on the platform, the Java Virtual Machine to restart). |
Class | Description |
---|---|
WatchdogTimerConfig |
The
WatchdogTimerConfig class encapsulates the hardware addressing information, and static and dynamic
configuration parameters of a watchdog timer. |
WatchdogTimerPermission |
The
WatchdogTimerPermission class defines permissions for watchdog timer access. |
WatchdogTimer
instance for the watchdog timer the application wants to use,
using its numerical ID, name, type (interface) and/or properties:
WatchdogTimer wdt = DeviceManager.open(8);
Or for a windowed watchdog timer,WatchdogTimer wdt = DeviceManager.open("WDT", WatchdogTimer.class, null);
WindowedWatchdogTimer wdt = DeviceManager.open("WWDT", WindowedWatchdogTimer.class, null);
WatchdogTimer.start
method and subsequently
refresh the timer periodically using the WatchdogTimer.refresh
method When done, the application should call thewdt.start(1000); ... wdt.refresh();
WatchdogTimer.close
method to close the watchdog
timer. The following sample codes give examples of using the watchdog timer API:wdt.close();
Unless otherwise noted, passing apublic class WatchdogSample { public boolean checkSomeStatus() { // check some status.... // if status is ok then return true to kick watch dog timer. return true; } public void test_loop() { WatchdogTimer watchdogTimer = (WatchdogTimer) DeviceManager.open(WDT_ID); watchdogTimer.start(180000); // Start watch dog timer with 3 min duration. while (true) { if (checkSomeStatus() == true) { // Everything goes fine, timer will be kick. watchdogTimer.refresh(); // do something more... } else { // Something goes wrong. Timer will not be kick. // If status not recovered within 2-3 turns then system will be reboot. } sleep(60000); // sleep for 1 min. } } }
null
argument to a constructor or method in any class
or interface in this package will cause a NullPointerException
to be thrown.Copyright © 2012, 2014, Oracle and/or its affiliates. All rights reserved.
Legal Notices