#include #define NUM 20
int fd;
void writeThread(void* arg);
void readThread(void* arg);
/*
int openport(void)
{
// int fd;
struct termios options;
if((fd=open("/dev/tts/0",O_RDWR|O_NOCTTY|O_NONBLOCK|O_NDELAY))==-1)
{
perror("Can't open serial1 port.");
return -1;
}
/* tcgetattr(fd,&options);
cfsetispeed(&options,B9600);
cfsetospeed(&options,B9600);
options.c_cflag|=(CLOCAL|CREAD); //忽略控制信号线和使能读功能
options.c_cflag|=PARENB; //奇偶检验
options.c_cflag&=~PARODD; //偶校验
options.c_iflag |= (INPCK | ISTRIP);
options.c_cflag|=CSTOPB; //两个停止位
options.c_cflag&=~CSIZE;
options.c_cflag|=CS8; //8个数据位
options.c_lflag&=~(ICANON|ECHO|ISIG); //原始输入模式