#include /* Standard input/output definitions */ #include /* String function definitions */ #include /* UNIX standard function definitions */ #include /* File control definitions */ #include /* Error number definitions */ #include /* POSIX terminal control definitions */ int main(int argc, char **argv){ int fd; struct termios options; fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY); if (fd == -1)perror("open_port: Unable to open /dev/ttyUSB0 - "); fcntl(fd, F_SETFL, 0); /* get the current options */ tcgetattr(fd, &options); options.c_cflag &= ~PARENB options.c_cflag &= ~CSTOPB options.c_cflag &= ~CSIZE; options.c_cflag |= CS8; /* set the options */ tcsetattr(fd, TCSANOW, &options); close(fd); return 0; } ~