From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 10 11:14:00 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD76E16A4C0 for ; Fri, 10 Oct 2003 11:14:00 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id E670243FCB for ; Fri, 10 Oct 2003 11:13:57 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) h9AIDqt2021280 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Fri, 10 Oct 2003 20:13:55 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id h9AIDoS8044727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 10 Oct 2003 20:13:51 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.10/8.12.10) with ESMTP id h9AIDo2u044070 for ; Fri, 10 Oct 2003 20:13:50 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.10/8.12.10/Submit) id h9AIDoJH044069 for freebsd-hackers@freebsd.org; Fri, 10 Oct 2003 20:13:50 +0200 (CEST) (envelope-from ticso) Date: Fri, 10 Oct 2003 20:13:49 +0200 From: Bernd Walter To: freebsd-hackers@freebsd.org Message-ID: <20031010181349.GG13791@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i Subject: setting sio to even parity failed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2003 18:14:00 -0000 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 ticso@bwct.de info@bwct.de