void opensio(char* devname) { struct termios buf; int val; fd = open(devname, O_RDWR); if (fd < 0) { printf("open serial %s failed: %s\n", devname, strerror(errno)); exit(1); } val = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, val | O_NONBLOCK); if (tcgetattr(fd, &buf) < 0) { printf("tcgetattr failed: %s\n", strerror(errno)); exit (1); } cfmakeraw(&buf); buf.c_iflag |= IGNBRK; buf.c_cflag &= ~(CSIZE | PARODD); buf.c_cflag |= CS8 | CLOCAL | PARENB; if (tcsetattr(fd, TCSAFLUSH, &buf) < 0) { printf("tcsetattr failed: %s\n", strerror(errno)); exit (1); } }
If I do PARENB or not doesn't change anything in the output pattern. However it does change handling in receiving characters. The OS is a real old -current from 8th Feb 2003. Unfortunately it's a RS485 application and I can't easily test the situation on a system with a more recent version and I can't easily update the given system. -- B.Walter BWCT http://www.bwct.de [EMAIL PROTECTED] [EMAIL PROTECTED] _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"