![Eurotech REGATE-10-12-65G Скачать руководство пользователя страница 88](http://html1.mh-extra.com/html/eurotech/regate-10-12-65g/regate-10-12-65g_user-manual_2440369088.webp)
12 How to manage interfaces in Linux
ReliaGATE 10-12 User manual Rev. 2-1
12.15 How the Watchdog is exposed
The ReliaGATE 10-12 exposes the watchdog as follows:
l
Watchdog:
/dev/watchdog1
12.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 last 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);
12.15.2
How to manage the Watchdog from the command line
To set the watchdog value (for example: 30 seconds), enter the following command:
wdt_setup –d /dev/watchdog1 –t 30
To start and feed the watchdog, enter the following command:
echo 1 > /dev/watchdog1
To stop the watchdog, enter the following command:
echo V > /dev/watchdog1
12.15.3
For more information
For more information on Linux support for watchdog, see:
www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt
88 / 118
Содержание REGATE-10-12-65G
Страница 4: ...This page has been intentionally left blank...
Страница 12: ...This page has been intentionally left blank...
Страница 16: ...This page has been intentionally left blank...
Страница 18: ...This page has been intentionally left blank...
Страница 20: ...This page has been intentionally left blank...
Страница 22: ...This page has been intentionally left blank...
Страница 30: ...This page has been intentionally left blank...
Страница 92: ...This page has been intentionally left blank...
Страница 104: ...This page has been intentionally left blank...
Страница 108: ...This page has been intentionally left blank...
Страница 110: ...This page has been intentionally left blank...
Страница 114: ...This page has been intentionally left blank...
Страница 116: ...This page has been intentionally left blank...
Страница 117: ...ReliaGATE 10 12 User manual Rev 2 1 Notes NOTES 117 118...