From owner-freebsd-questions@FreeBSD.ORG Mon Nov 24 09:29:32 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC8EA16A4CE for ; Mon, 24 Nov 2003 09:29:32 -0800 (PST) Received: from serv09.segi.ulg.ac.be (serv09.segi.ulg.ac.be [139.165.32.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86ADC4400B for ; Mon, 24 Nov 2003 09:29:28 -0800 (PST) (envelope-from francois@run.montefiore.ulg.ac.be) Received: (qmail 27850 invoked by uid 504); 24 Nov 2003 18:29:25 +0100 Received: from francois@run.montefiore.ulg.ac.be by serv09.segi.ulg.ac.be by uid 501 with qmail-scanner-1.16 (clamscan: 0.60. spamassassin: 2.55. Clear:. Processed in 0.726637 secs); 24 Nov 2003 17:29:25 -0000 Received: from unknown (HELO run.montefiore.ulg.ac.be) ([139.165.223.23]) (envelope-sender ) by serv09.segi.ulg.ac.be (qmail-ldap-1.03) with SMTP for ; 24 Nov 2003 18:29:24 +0100 Message-ID: <3FC23FE2.5010101@run.montefiore.ulg.ac.be> Date: Mon, 24 Nov 2003 18:29:06 +0100 From: Jean-Marc Francois Organization: Research Unit in Networking User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: questions@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: serial port programming X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: francois@montefiore.ulg.ac.be List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2003 17:29:32 -0000 Sir, I've posted this question on a newsgroup, but got no response. Is there a cuaa-guru out there ? :-) Thanks ! Jean-Marc Francois Université de Liège --------------- I got a strange problem. I want to send a binary string to a small device I made via /dev/cuaa0. The port settings should be 19200, 8N1 (no RTS/CTS, no XON/XOFF). Looks simple. I've written a small program using the standard POSIX API : tcgetattr and the like. When I launch my program, it doesn't work (well, it works with Linux but not with FreeBSD). If I first launch minicom (and ask it to setup the serial port), let it in the background and launch my program, it works. The problem is that the dump of the 'stuct termios' my program is using with or without minicom is the same, so that's not the problem (stty -f /dev/cuaa0 gives the same output also). I thought all the serial settings were in this structure; where am I wrong ? Thank if you can help (if you can't, thanks for reading anyway :-) ), JM --- #> stty -f /dev/cuaa0 speed 19200 baud; lflags: -icanon -isig -iexten -echo iflags: -icrnl -ixon -ixany -imaxbel ignbrk -brkint oflags: -opost -onlcr -oxtabs cflags: cs8 -parenb clocal time 5 --- Dump of struct termios : c_iflag : 0x1 c_oflag : 0x0 c_cflag : 0xcb00 c_lflag : 0x0 c_cc[0] : 0x4 c_cc[1] : 0xff c_cc[2] : 0xff c_cc[3] : 0x7f c_cc[4] : 0x17 c_cc[5] : 0x15 c_cc[6] : 0x12 c_cc[7] : 0x8 c_cc[8] : 0x3 c_cc[9] : 0x1c c_cc[10] : 0x1a c_cc[11] : 0x19 c_cc[12] : 0x11 c_cc[13] : 0x13 c_cc[14] : 0x16 c_cc[15] : 0xf c_cc[16] : 0x1 c_cc[17] : 0x5 c_cc[18] : 0x14 c_cc[19] : 0xff c_ispeed : 0x4b00 c_ospeed : 0x4b00 --- ---------------