Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 1997 10:50:11 -0700 (PDT)
From:      Thomas Dean <tomdean@ix.netcom.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Serial Port
Message-ID:  <199709191750.KAA00710@celebris.tddhome>

next in thread | raw e-mail | index | archive | help
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 = <undef>;
        eol2 = <undef>; 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709191750.KAA00710>