Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Mar 1997 00:09:45 -0800
From:      Steven Wallace <swallace@ece.uci.edu>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        bugs@freebsd.org, current@freebsd.org, msmith@atrad.adelaide.edu.au
Subject:   Re: serial driver 
Message-ID:  <199703070809.AAA22214@newport.ece.uci.edu>
In-Reply-To: Your message of "Fri, 07 Mar 1997 18:02:05 %2B1100." <199703070702.SAA04952@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help

Okay, by Mike suggestion, here is an example of what happens:
I got out my break box and looked at the levels of the line

Terminal Device	<-----straight 25 pin to COM1----->	FreeBSD BOX

Pin 2  TD		OFF
Pin 3  RD		OFF
Pin 4  RTS		OFF
Pin 6  DSR		OFF
Pin 8  CD		OFF
Pin 20 DTR		OFF

					cat /dev/ttyd0 > output
					(hangs waiting for input on BSD box)

Pin 2  TD		OFF
Pin 3  RD		OFF
Pin 4  RTS		OFF
Pin 6  DSR		ON		# PC now says now active
Pin 8  CD		ON		# "
Pin 20 DTR		OFF

output file into serial port of "terminal", thereby activating its serial
port.  Note the device raises DTR.
This is similar to doing something like:
  cat file > serial device
Both are device and PC operating at 9600 baud.

Pin 2  TD		ON	# device sending data to PC
Pin 3  RD		OFF
Pin 4  RTS		ON
Pin 6  DSR		ON
Pin 8  CD		ON
Pin 20 DTR		ON	# device saying its active

File output grows larger.
Device transmits 10016 bytes.
					file output on PC is now 10000 bytes
Device drops DTR.
					up to last 16 bytes are lost on PC
					file remainas at 10000 bytes

---
What I would expect is to receive the data transmitted before DTR was
dropped.  According to what Bruce says, data not read by the read()
call is dropped after DTR is dropped in real time.

I just tried setting clocal to the device and it received all the data
its first time through.  The disadvantage is that the cat program
still sits there waiting for more data to output to the file so
I had to press ^C to stop it.

Is there any way to get the functionality I desire?  I want the cat
program to close / read to fail after all data is read before the DTR
was dropped.  Don't you think that makes more sense anyways?  I'd
hate to lose data because the load was too high or whatever and
my process was not able to read() it before DTR/carrier was lost.

Steven




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