1.概述
Watchdog采用标准的 linux 框架,提供硬件的 watchdog,上层应用可以设定 time out 时间,自己来 keep alive。Watchdog 默认是关闭的,客户可自行决定是否开启。开启建议在主线程中操作,如果在其他线程中操作,watchdog 会随着线程的关闭而关闭。
2. WATCHDOG 控制
2.1. 打开 WATCHDOG
打开/dev/watchdog 设备,watchdog 将被启动。参考代码如下:
int wdt_fd = -1;
wdt_fd = open("/dev/watchdog", O_WRONLY);
if (wdt_fd == -1)
{
// fail to open watchdog device
}
16RD supports Paypal , Payment is calculated at the exchange rate of the day. Unable to download please contact 18902843661 (WhatsApp OR wechat number)