termios to set the serial port
时间:2010-08-20 来源:tryandy
struct termios ios;
tcgetattr( fd, &ios );
ios.c_lflag = 0; /* disable ECHO, ICANON, etc... */
ios.c_iflag &= ~(INLCR|IGNCR|ICRNL|IXON);
ios.c_oflag &= ~(ONLCR|OCRNL);
tcsetattr( fd, TCSANOW, &ios );
tcgetattr( fd, &ios );
ios.c_lflag = 0; /* disable ECHO, ICANON, etc... */
ios.c_iflag &= ~(INLCR|IGNCR|ICRNL|IXON);
ios.c_oflag &= ~(ONLCR|OCRNL);
tcsetattr( fd, TCSANOW, &ios );
相关阅读 更多 +