Moxa V2406-24I-CT-XPE [56/81] Wdt watch dog timer

Moxa V2406-XPE [56/81] Wdt watch dog timer
V2406/2422/2426 Linux User’s Manual Programming Guide
4-6
WDT (Watch Dog Timer)
Introduction
The WDT works like a watchdog function, and can be enabled or disabled. When the WDT function is enabled
and the application does not acknowledge it, the system will reboot. The acknowledgement time can be set to
any number between 50 milliseconds and 60 seconds.
How the WDT Works
You will need to write your own application to enable the WDT function. Refer to the following APIs for help on
writing the application.
The user API
Function int swtd_open(void)
Description Open the file handle to control the software watchdog.
Input None
Output None
Return On success, return a file handle. Otherwise, return < 0 value.
Function int swtd_enable(int fd, unsigned long time)
Description Enable software watchdog. And you must do swtd_ack() after this procedure
Input <fd> the file handle, from the swtd_open() return value
<time>
The time you wish to ack software watchdog periodically.
Note: You must ack the software watchdog before timeout. Otherwise, the system will
reboot automatically. The minimal time is 50 msec, the maximum time is 60 seconds. The
time unit is msec.
Output None
Return On success, 0 is returned. Otherwise, an error number is return
Function int swtd_disable(int fd)
Description Disable the application to ack software watchdog. And the kernel will ack it automatically.
Input <fd> the file handle from swtd_open() return value.
Output None
Return On success, 0 is returned. Otherwise, an error number is return
Function int swtd_get(int fd, int *mode, unsigned long *time)
Description Get current setting values.
Input <fd> the file handle from swtd_open() return value.
<*mode>
return the status 1(enable) or 0(disable) of userspace watchdog
<*time>
return the current time period.
Output None
Return On success, 0 is returned. Otherwise, an error number is return

Содержание

Похожие устройства

Скачать