Moxa Technologies W311 Computer Hardware User Manual


 
ThinkCore W311/321/341 Linux User’s Manual Programmer’s Guide
6-4
int swtd_enable(int fd, unsigned long time)
Description
Enable application sWatchDog. And you must do ack after this process.
Input
int fd - the file handle, from the swtd_open() return value.
unsigned long time - The time you wish to ack sWatchDog periodically. You must ack the
sWatchDog before timeout. If you do not ack, the system will be reboot automatically. The
minimal time is 50 msec, the maximum time is 60 seconds. The time unit is msec.
Output
OK will be zero. The other has some error, to get the error code from errno().
int swtd_disable(int fd)
Description
Disable the application to ack sWatchDog. And the kernel will be auto ack it. User does not to
do it at periodic.
Input
int fd - the file handle from swtd_open() return value.
Output
OK will be zero. The other has some error, to get error code from errno.
int swtd_get(int fd, int *mode, unsigned long *time)
Description
Get current setting values.
mode –
1 for user application enable sWatchDog: need to do ack.
0 for user application disable sWatchdog: does not need to do ack.
time – The time period to ack sWatchDog.
Input :
int fd - the file handle from swtd_open() return value.
int *mode - the function will be return the status enable or disable user application need to
do ack.
unsigned long *time – the function will return the current time period.
Output:
OK will be zero.
The other has some error, to get error code from errno().