1-24、讯为驱动-简单应用调用驱动

测试程序源码

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>

main(){
	int fd;
	char *hello_node = "/dev/hello_ctl123";
	
	if((fd = open(hello_node,O_RDWR|O_NOCTTY|O_NDELAY))<0){
		printf("APP open %s failed",hello_node);
	}
	else
	{
		printf("APP open %s success",hello_node);
		ioctl(fd,1,6);
	}
	close(fd);
}

开发板测试

发布了113 篇原创文章 · 获赞 1 · 访问量 1194

猜你喜欢

转载自blog.csdn.net/poor_guy_liu/article/details/103611733