# @name Watchdog Timer getsupport,settimeout,getstatus,keepalive ioctl and write test
# @desc Watchdog Timer getsupport,settimeout,getstatus,keepalive ioctl and write test
# @requires watchdog

WDT_S_FUNC_GETSUPORT
source 'common.sh'; do_cmd install_modules.sh 'wdt' ;
DEV_NODE=`get_devnode.sh "wdt"` || die "error getting devnode for wdt";
do_cmd wdt_tests -device $DEV_NODE -ioctl getsupport

 
 
wdt_tests -device /dev/watchdog -ioctl getsupport
 
wdt_tests是c代码
 
SOURCES := \
        ../utils/user/st_fileapi.c \
        src/interface/common/st_wdt_common.c \
        src/parser/st_wdt_parser.c \
        src/testcases/st_wdt_ioctl.c \
        src/testcases/st_wdt_open_close.c \
        src/testcases/st_wdt_write.c

MAKE_TARGETS            := wdt_tests

wdt_tests:
    $(CC) $(CFLAGS) $(LDFLAGS) -o wdt_tests ${INCLUDES} ${SOURCES}

 
main函数位于:
st_wdt_parser.c
 
/****************************************************************************
 * Function        - Main function
 * Functionality    - This is where the execution begins
 * Input Params        - argc,argv
 * Return Value        - None
 * Note            - None
 ****************************************************************************/
int main(int argc, char *argv[])
{

int retval;
    /* Initialize options with default vales */
    st_init_wdt_test_params();

/* Invoke the parser function to process the command line options */
    retval = st_process_wdt_test_options(argc, argv);
    return retval;
}

 
1.
st_init_wdt_test_params(); //初始化 in  st_wdt_common.c
void st_init_wdt_test_params(void)
{
    strcpy(testoptions.device , DEFAULT_DEVICE);
    testoptions.ioctl = DEFAULT_IOCTL;
    testoptions.loop = DEFAULT_LOOP_COUNT;
    testoptions.ioctl_arg = DEFAULT_IOCTL_ARG;
    testoptions.iomode = DEFAULT_IOMODE;
}
 
#define DEFAULT_IOMODE        ST_WDT_IOMODE_NONE
#define DEFAULT_DEVICE        "/dev/watchdog"
#define DEFAULT_IOCTL         ST_WDT_IOCTL_NONE
#define DEFAULT_LOOP_COUNT    1
#define DEFAULT_IOCTL_ARG     0
 
2.
retval = st_process_wdt_test_options(argc, argv); //in st_wdt_parser.c
 
 
int c = getopt_long_only(argc, argv, "vh", long_options,
                     &option_index); //获取参数
TEST_PRINT_TST_START(testcaseid);  //打印start
st_print_wdt_test_params(&testoptions, testcaseid);  //打印参数
fileDesc = st_wdt_open(&testoptions);  //open wdt
ret_val2 = st_wdt_ioctl_test(&testoptions, testcaseid, fileDesc);  //
TEST_PRINT_TST_RESULT(result, testcaseid);  //打印result
TEST_PRINT_TST_END(testcaseid);  //打印end
ioctl(fileDesc, WDIOC_GETTIMEOUT, &timeout); //取超时时间
 
一旦/dev/watchdog被打开,则watchdog激活,并且除非喂狗,否则将在一段时间之后重启。
 
 
 
 
 
 
 

ltp-ddt wdt_test的更多相关文章

  1. LTP随笔——本地调用ltp之ltp4j

    关于ltp本地调用的相关参考请见LTP的Git项目:https://github.com/HIT-SCIR 以下以/home/lion/Desktop路径为例下面教程中出现的具体路径以你实际配置的为准 ...

  2. ZH奶酪:自然语言处理工具LTP语言云调用方法

    前言 LTP语言云平台 不支持离线调用: 支持分词.词性标注.命名实体识别.依存句法分析.语义角色标注: 不支持自定义词表,但是你可以先用其他支持自定义分词的工具(例如中科院的NLPIR)把文本进行分 ...

  3. Eclipse DDT

    http://www.eclipse.org/downloads/ https://github.com/DDT-IDE/DDT/blob/latest/documentation/UserGuide ...

  4. ASP.NET中常用的几个李天平开源公共类LTP.Common,Maticsoft.DBUtility,LtpPageControl

    ASP.NET中常用的几个开源公共类: LTP.Common.dll: 通用函数类库     源码下载Maticsoft.DBUtility.dll 数据访问类库组件     源码下载LtpPageC ...

  5. 很好的一篇讲LTP在编解码中的作用的文章

    原文链接 LONG-TERM PREDICTION by: Adit Aviv       Kfir Grichman introduction: The speech signal has been ...

  6. ASP.NET中常用的几个李天平开源公共类LTP.Common,Maticsoft.DBUtility,LtpPageControl (转)

    ASP.NET中常用的几个开源公共类: LTP.Common.dll: 通用函数类库     源码下载Maticsoft.DBUtility.dll 数据访问类库组件     源码下载LtpPageC ...

  7. 编译哈工大语言技术平台云LTP(C++)源码及LTP4J(Java)源码

    转自:编译哈工大语言技术平台云LTP(C++)源码及LTP4J(Java)源码 JDK:java version “1.8.0_31”Java(TM) SE Runtime Environment ( ...

  8. LTP学习

    下载LTP源码和模型文件: https://github.com/linux-test-project/ltp 官方说明文档 http://ltp.readthedocs.org/zh_CN/late ...

  9. LTP 分词算法实践

    参考链接: https://github.com/HIT-SCIR/ltp/blob/master/doc/install.rst http://www.xfyun.cn/index.php/serv ...

  10. ltp工具使用配置

    ltp是一个比较全的自然语言处理工具,可以用它进行分词.词性标注.语法分析等任务. ---- 准备 下载 下载ltp和ltp4j,在cmake官网下载并安装相应版本的cmake,并且下载ant. 构建 ...

随机推荐

  1. java.nio.channels.IllegalBlockingModeException

    报错信息如下: Exception in thread "main" java.nio.channels.IllegalBlockingModeException at java. ...

  2. 从保障淘宝到全球市场“第一阵营”,阿里云的DDoS防护之路走了多远?

    2年前,不少技术圈的朋友,读过论坛里的一篇解读文章:DDoS,阿里为什么要走自己的一条路(https://bbs.aliyun.com/read/271764.html?pos=13),文章讲述了阿里 ...

  3. MySQL基础篇——安装、管理

    MySQL 安装 所有平台的 MySQL 下载地址为https://dev.mysql.com/downloads/mysql/ .挑选你需要的 MySQL Community Server 版本及对 ...

  4. Word文档粘贴到帝国CMS

    很多时候我们用一些管理系统的时候,发布新闻.公告等文字类信息时,希望能很快的将word里面的内容直接粘贴到富文本编辑器里面,然后发布出来.减少排版复杂的工作量. 下面是借用百度doc 来快速实现这个w ...

  5. ubuntu 18.04下修改pip镜像源

    在home/用户名/目录下创建.pip文件夹 然后cd .pip 创建pip.conf文件touch pip.conf 输入以下内容然后保存即可 [global] timeout = 6000 ind ...

  6. 【HDOJ6699】Block Breaker(模拟)

    题意:给定一个n*m的网格块,如果一个块水平或垂直方向没有相邻支撑就会掉下去 有q次询问,每次会掉下去一块,问连锁反应新掉下的块数 n,m<=2e3,q<=1e5 思路: #include ...

  7. [NOIP2016]蚯蚓 题解

    题目描述 本题中,我们将用符号[c]表示对c向下取整,例如:[3.0」= [3.1」= [3.9」=3.蛐蛐国最近蚯蚓成灾了!隔壁跳蚤国的跳蚤也拿蚯蚓们没办法,蛐蛐国王只好去请神刀手来帮他们消灭蚯蚓. ...

  8. save change is not permitted

    https://support.microsoft.com/en-my/help/956176/error-message-when-you-try-to-save-a-table-in-sql-se ...

  9. Python3.5自带venv创建虚拟环境

    为每个程序单独创建虚拟环境可以保证程序只能访问虚拟环境中的包,保持全局解释器的干净整洁,使其只作为创建(更多)虚拟环境的源. windows下创建虚拟环境 Python3.5自带venv,只需执行py ...

  10. CSS-同一行的元素高度统一

    一:flex 大法 步骤 设置外部容器 display: flex; 设置内部容器 align-items: stretch; 原理 https://developer.mozilla.org/zh- ...