# @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. ueditor 复制word里面带图文的文章,图片可以直接显示

    图片的复制无非有两种方法,一种是图片直接上传到服务器,另外一种转换成二进制流的base64码 目前限chrome浏览器使用,但是项目要求需要支持所有的浏览器,包括Windows和macOS系统.没有办 ...

  2. jsqlparser

    摘要:SQL语法解释器jsqlparser 是用java开发的解析器,可以生成java类层次结构. 主页地址:http://jsqlparser.sourceforge.net 可以完美解析表的增删查 ...

  3. 170814关于Cookie的知识点

    1.会话控制 Http协议   Http协议两个缺陷: 1.HTTP协议是纯文本的    2.HTTP协议是无状态的 服务器不能简单的通过HTTP协议来区分多次请求是否发自同一个用户    虽然通过H ...

  4. 阿里云数据库导出-本地mysql导入

    因阿里云数据库标准访问模式不支持外网接入 因此导出一份到本地,注意选择编码为utf8 mysql 命令行用source导入有utf8编码的sql文件时导入的数据有乱码解决办法 set names ut ...

  5. LintCode之左填充

    题目描述: 分析:由样例可知,第二个参数表示要返回的字符串的最小长度,所以当给定字符串的长度小于规定字符串最小长度时就在左边填充空格,另外还有一个重载方法leftpad的第三个参数指定左边填充的字符. ...

  6. sticky用法

    可以用于滚动到一定距离以后让他实现定位效果. 比如滚动到50px的时候让导航栏固定定位. 用法:给最外层的div设置绝对定位 然后要固定的div设置position:sticky; top:0: 这样 ...

  7. Java IO(3)

    字符流相关 字符流基本上可以类比字节流 只不过是将字节流的byte 换为char. 最根本的两个类是Reader以及Writer Reader的子类有:BufferedReader, CharArra ...

  8. 工作笔记:phpstrom、docker、phpunit进行单元测试

  9. Dockerfile设置时区alpine

    背景: 最近在写golang相关代码.其中用到了时间操作的相关函数,如下: nowTime := time.Now() nUnixEndTime := nowTime.Unix() nHour, nM ...

  10. Anaconda Jupyter WinError2:The system cannot find the file specified

    Traceback (most recent call last): File "C:\Users\builder\Miniconda3\Scripts\conda-build-script ...