#include <stdio.h>
#include<sys/stat.h>
#include<fcntl.h>
#include <stdlib.h>
char *dev="/dev/ttyUSB0";
int OpenDev(char *Dev)
{
int fd = open( Dev, O_RDWR | O_NOCTTY | O_NDELAY);
if (-1 == fd) {
perror("Can't Open Serial Port");
return -1;
} else
return fd;
}
int read_fun(
Linux非阻塞读取串口数据
最新推荐文章于 2024-07-12 17:21:26 发布