11 How to access interfaces under Linux
DynaGATE 10-12 User manual Rev. 0-14
11.16 Watchdog
The DynaGATE 10-12 exposes the watchdog as follows:
l
Watchdog:
/dev/watchdog1
11.16.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);
11.16.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
76 / 94
Summary of Contents for DynaGate 10-12 Series
Page 10: ...This page has been intentionally left blank...
Page 12: ...This page has been intentionally left blank...
Page 14: ...This page has been intentionally left blank...
Page 16: ...This page has been intentionally left blank...
Page 22: ...This page has been intentionally left blank...
Page 28: ...This page has been intentionally left blank...
Page 60: ...This page has been intentionally left blank...
Page 62: ...This page has been intentionally left blank...
Page 82: ...This page has been intentionally left blank...
Page 88: ...This page has been intentionally left blank...
Page 90: ...This page has been intentionally left blank...
Page 92: ...This page has been intentionally left blank...
Page 93: ...DynaGATE 10 12 User manual Rev 0 14 Notes NOTES 93 94...