BoltGATE 20-25 User Manual Rev. 1-1
10 How to Access the Interfaces Under Linux
10.15 Watchdog
The BoltGATE 20-25 exposes the watchdog as follows:
l
/dev/watchdog1
10.15.1
How to Manage the Watchdog Using the C Programming Language
To manage the watchdog using the C programming language, enter the following commands:
Int interval;
Int bootstatus;
Long value;
/* display current watchdog value */
If (ioctl(fd,WDIOC_GETTIMEOUT,&interval)==0)
{
// interval contains current timeout in seconds
}
/* Check if lasdt boot is caused by watchdog */
If (ioctl(fd,WDIOC_GETBOOTSTATUS,&bootstatus)==0)
{
//bootstatus <> 0 Watchdog
//bootstatus = 0 Power-on reset
}
/* set the watchdog value (for example: 30 seconds) */
value=30;
If (ioctl(fd,WDIOC_SETTIMEOUT,&value)==0)
{
//Watchdog has been set to value content
}
/* stop the watchdog */
write(fd,”V”,1);
/* feed the watchdog */
ioctl(fd,WDIOC_KEEPALIVE,0);
10.15.2
How to Manage the Watchdog From the Command Line
To set the watchdog value (for example: 30 seconds), enter the following command:
wdttest –d /dev/watchdog1 –t 30
To feed the watchdog, enter the following command:
echo 10 > /dev/watchdog1
To stop the watchdog, enter the following command:
echo V > /dev/watchdog1
83 / 102
Содержание BoltGATE 20-25
Страница 4: ...This page has been intentionally left blank...
Страница 12: ...This page has been intentionally left blank...
Страница 14: ...This page has been intentionally left blank...
Страница 16: ...This page has been intentionally left blank...
Страница 24: ...This page has been intentionally left blank...
Страница 48: ...This page has been intentionally left blank...
Страница 66: ...This page has been intentionally left blank...
Страница 86: ...This page has been intentionally left blank...
Страница 92: ...This page has been intentionally left blank...
Страница 94: ...This page has been intentionally left blank...
Страница 98: ...This page has been intentionally left blank...
Страница 101: ...BoltGATE 20 25 User Manual Rev 1 1 Notes NOTES 101 102...