测试指南

2508 / 2026-01-02 02:21:22 赛事日历

测试

Watchdog

的综合功能

WDT

注册了一个

test_wdt

命令,用于测试

WDT

的其它功能,比如喂狗,预处理等。以下为具体的使用示例:

设置 timeout 为 3

秒并开启看门狗:test_wdt -s 3结果:系统会在

3 秒后重启。

设置 pretimeout 为 3

秒并开启超时中断:test_wdt -p 3

结果:3 秒后触发超时中断。

设置清除窗口为 3

秒:test_wdt -c 3

结果:计数到 3 秒之后才能“喂狗”。

获取当前的

timeout:test_wdt -g

结果:返回当前的 timeout 值。

开启喂狗功能 (空闲钩子):test_wdt -k

结果:开启喂狗功能,防止系统因长时间未操作而重启。

使用 test_wdt -u 帮助命令可以获取 WDT 相关帮助信息:

test_wdt -u

Usage: test_wdt [-s timeout][-p pretimeout][-c clear threshold][-g][-k][-u]

-s, --set-timeout Set a timeout, in second

-p, --set-pretimeout Set a pretimeout, in second

-c, --set-clear threshold Set clear threshold,in second(0~3)

-g, --get-timeout Get the current timeout, in second

-k, --keepalive Keepalive the watchdog

-u, --usage