From owner-freebsd-questions Fri Sep 19 10:50:17 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA27078 for questions-outgoing; Fri, 19 Sep 1997 10:50:17 -0700 (PDT) Received: from celebris.tddhome (sil-wa4-34.ix.netcom.com [207.93.136.98]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA27070 for ; Fri, 19 Sep 1997 10:50:09 -0700 (PDT) Received: (from tomdean@localhost) by celebris.tddhome (8.8.7/8.8.5) id KAA00710; Fri, 19 Sep 1997 10:50:11 -0700 (PDT) Date: Fri, 19 Sep 1997 10:50:11 -0700 (PDT) Message-Id: <199709191750.KAA00710@celebris.tddhome> From: Thomas Dean To: freebsd-questions@FreeBSD.ORG Subject: Serial Port Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk I am attempting to use a serial port to talk to a Gramin GPS 45XL. I can talk to the device, read and write data. The results make sense. I am using /dev/cuaa0. I have one problem. The communications with the device are not reliable. I execute an application to send the device a command and read the results. It works. I issue the same command again and it hangs. Actually, I use select() and it times out after 15 seconds. Increasing the timeout to 100 seconds does not change things. If I put the command in a loop, it works 10 times. This is using everything except open() and close(). I believe there is something that happens when I close the device. I have tried 'stty raw < /dev/cuaa0', and it does not seem to change the interface. # stty -a < /dev/cuaa0 speed 9600 baud; 0 rows; 0 columns; lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl -echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo -extproc iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel -ignbrk -brkint -inpck -ignpar -parmrk oflags: -opost -onlcr -oxtabs cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow -dtrflow -mdmbuf cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ; eol2 = ; erase = ^?; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W; This looks like it should do what I want. I want the port to send a character only when I tell it to and to receive anything it gets. I use open(), read(), and, write() to communicate with the device. Any ideas? Thanks, tomdean@ix.netcom.com