User`s manual

UC-8410/8416/8418 LX User’s Manual Programmer’s Guide
5-6
int swtd_enable(int fd, unsigned long time)
Description
Enable the application sWatchDog. You must do an 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 reboot
automatically. The minimum time is 50 msec, and the maximum time is 60 seconds. The
time unit is msec.
Output
If you receive 0 (zero), it means the function is working. If you receive any other number,
then there is something wrong with this function.
int swtd_disable(int fd)
Description:
Call this function if you would like the AP to stop using the Watchdog.
Input :
int fd - the file handle from swtd_open() return value.
Output:
If you receive 0 (zero), it means the function is working. If you receive any other number,
then there is something wrong with this function.
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 return the status: enable or disable.
unsigned long *time – the function will return the current time period.
Output:
If you receive 0 (zero), it means the function is working. If you receive any other number,
then there is something wrong with this function.