User`s manual
UC-7112-LX Plus Software User’s Manual Programmer’s Guide
6-4
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
errno() returns the error code. A value of 0 (zero) indicates no error.
int swtd_disable(int fd)
Description
Disable the application to ack sWatchDog. In this case, the kernel will be auto ack, so the user
does not need ack periodically.
Input
int fd - the file handle from swtd_open() return value.
Output
errno() returns the error code. A value of 0 (zero) indicates no error.
int swtd_get(int fd, int *mode, unsigned long *time)
Description
Get current setting values.
mode –
1 for user application to enable sWatchDog: need to ack.
0 for user application to disable sWatchdog: does not need to ack.
time – The time period to ack sWatchDog.
Input :
int fd - the file handle from swtd_open() return value.
int *mode - this function returns the status of enable or disable (if status is “enable” the user
must ack before the current time period expires.
unsigned long *time – the function will return the current time period.
Output:
A value of 0 (zero) indicates no error.
Otherwise, you can get the error code from the function errno().
int swtd_ack(int fd)
Description
Acknowledge sWatchDog. When the user application enable sWatchDog, it needs to call this
function periodically, using the the time predefined by the user in the application program.
Input
int fd - the file handle from swtd_open() return value.
Output
A value of 0 (zero) indicates no error.
Otherwise, you can get the error code from the function errno().
int swtd_close(int fd)
Description
Close the file handle.
Input
int fd - the file handle from swtd_open() return value.