-
5.8. Watch Dog
5.8.1. Set time out value
Function Description:
Set a watchdog timeout value. After this function being called, it will not take effect until
“StartWatchdog” is called.
Function call:
void SetWatchdogTimeout(DWORD mSecs);
Parameters(Input):
mSecs:
DWORD
: Time out value of milliseconds
5.8.2. Start the watchdog
Function Description:
Start the watchdog. System will reboot at the time defined by the last “SetWatchdogTimeout”. Once
watchdog is started, the hardware cannot stop it. So the only way to avoid system boot is to keep
calling “SetWatchdogTimeout” to update the next watchdog timeout value.
Function call:
void StartWatchdog();
5.8.3. Pause the watchdog
Function Description:
Pause the watchdog. Actually hardware watchdog cannot be stopped. This function allows the user
application to stop calling “SetWatchdogTimeout”. Instead, a thread in the IOC driver will be calling
“SetWatchdogTimeout” continuously, to avoid watchdog reboot. Once paused, the watchdog can be
restarted by calling “StartWatchdog”.
Function call:
void StartWatchdog();
Example:
#include “ioc_ioctl.h”
HANDLE gIOControlDriverHandle;
…
gIOControlDriverHandle = CreateFile(L”IOC1:”, GENERIC_READ |
GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, 0);
if(gIOControlDriverHandle != INVALID_HANDLE_VALUE)
{
IOC_SetWatchdogTimeout(3000);
…
…
IOC_StartWatchdog();
…
…
IOC_PauseWatchdog();
…
…
CloseHandle(gIOControlDriverHandle);
}
else
{
…
…
}
Содержание MR650
Страница 1: ...MR650 Programming Manual V 1 12 1 16 2008 ...
Страница 7: ... 7 13 FUNCTION KEY SETTING ON REGISTRY 65 14 UPDATE NOTES 66 ...
Страница 16: ... it is for internal use send messages ...
Страница 33: ... Be aware to release handles when program ends ...