Moxa IA3341-LX Инструкция по эксплуатации онлайн [59/72] 170917

Moxa IA3341-LX Инструкция по эксплуатации онлайн [59/72] 170917
IA3341 Linux User’s Manual Programmer’s Guide
6-4
Description:
Open the file handle to control the WDT. If you want to do something you
must first to this. And keep the file handle to do other.
Input:
None
Output:
The return value is file handle. If has some error, it will return < 0 value. You
can get error from errno().
int swtd_enable(int fd, unsigned long time)
Description:
Enable application WDT 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 WDT before timeout. If you do not ack, the system will 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 acknowledge WDT. And the kernel will 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 WDT: need to
acknowledge. 0 for user application disable WDT: does not need to
acknowledge. time – The time period to acknowledge WDT.
Input :
int fd - the file handle from swtd_open() return value. int mode - the
function will return the status of user application need to . 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().
int swtd_ack(int fd)
Description:
Acknowledge sWatchDog. When the user application enable sWatchDog. It
need to call this function periodically with user predefined time in the
application program.
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_close(int fd)
Description:
Close the file handle.
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().

Содержание

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

Скачать