Linux: 输入设备驱动测试程序
来源:互联网 发布:linux 安装oracle9i 编辑:程序博客网 时间:2024/06/06 05:25
测试写好的输入设备模块,比如遥控器,交叉编译后bin档放到rootfs/bin,直接运行
/* test remote.ko
* you should insmod remote.ko and config it before
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/input.h>
struct input_event buff;
int main(int argc, char **argv)
{
int fd;
printf("%s: entered/n", argv[0]);
fd = open("/dev/input/event0", O_RDONLY);
if(fd == -1) {
printf("open failed");
exit(-1);
}
printf("%s: open successful: %d/n", argv[0], fd);
while(1) {
if(read(fd,&buff,sizeof(struct input_event))!=0)
printf("type:%d code:%d value:%d/n",buff.type,buff.code,buff.value);
}
close(fd);
}
- Linux: 输入设备驱动测试程序
- 【转载】LINUX输入设备驱动
- linux设备驱动之LED驱动测试
- Linux设备驱动之plat_led驱动测试
- LINUX设备驱动之输入子系统(二)
- LINUX设备驱动之输入子系统(三)
- LINUX设备驱动——输入子系统
- LINUX设备驱动之输入子系统(二)
- LINUX设备驱动之输入子系统(三)
- LINUX设备驱动之输入子系统(三)
- LINUX设备驱动之输入子系统(二)
- linux设备驱动——输入子系统
- linux输入设备驱动实列
- 【Linux设备驱动】Linux输入子系统之底层驱动
- Linux触摸屏驱动测试程序
- Linux 字符驱动设备的测试案例
- linux块设备驱动与其测试
- Linux输入子系统框架分析及输入设备驱动编程
- 递归的应用
- VC工具栏相关问题
- Java学习之什么是回调?
- MFC如何修改窗口背景色
- 如何删除detached instance?
- Linux: 输入设备驱动测试程序
- Windows下Apache2.2.8及Php5.2.5的安装与配置方法
- 一个简易查询引起的悲剧
- 利用SqlBulkCopy快速大批量导入数据(SqlBulkCopy强大)
- Gvim+ctags+cscope(转载)
- 百科-TR069
- 实用:oracle存储过程语法
- C++构造函数调用构造函数问题
- vim 编辑器安装 配置