[comp.unix.wizards] DTR response time?

jc@minya (John Chambers) (11/01/87)

Well, I got so many responses to my last question, that I thought I'd
try to stump y'all with another.  You know the CTS/DTR protocol that
a lot of terminals use?  Sure, you do.  When the device (terminal or
printer or whatever) finds that its buffer is full, it changes the 
value of pin 20 on the RS-232 connector.  The computer's serial card
interprets this to mean that the device is incapacitated, and stops
sending characters.  Later, when the poor device has caught up, it
flips pin 20 (aka DTR or Data Terminal Ready or something like that),
the computer notices that the device is back, and starts transmitting.

It seems that many computers, including this one, don't stop instantly
when DTR drops; they transmit up to N more characters before stopping.
Some time ago, I saw a machine that would send 128 more bytes before
stopping.  You can imagine how well this worked for some devices with 
small buffers.

This machine is nicer; it only transmits about 8 bytes after DTR has
dropped.  This seems OK for most purposes, but I seem to have a printer
that can't even handle that.  I suspect that, when it drops DTR, it
sometimes can't handle even one more character.  (Presumably it will
accept the current one.)  

Anyhow, the puzzle is this:  Is there a way to control this behavior
of the driver and/or serial board in a reasonably generic Sys/V?  Can
I set the above value of N?  I seem to remember some vague rumor that
this can be done somehow, but I just can't find anything about it in
the kwic index.  Neither can grep.  Maybe I just don't know the right
words to look up.  Maybe it isn't documented.  Maybe I can't get there
from here.  

I'd love a "RTFM" response, if it comes accompanied by a section and
page number (or even telling me how it's kwic-indexed).

allbery@ncoast.UUCP (Brandon Allbery) (11/06/87)

As quoted from <350@minya.UUCP> by jc@minya (John Chambers):
+---------------
| Anyhow, the puzzle is this:  Is there a way to control this behavior
| of the driver and/or serial board in a reasonably generic Sys/V?  Can
| I set the above value of N?  I seem to remember some vague rumor that
| this can be done somehow, but I just can't find anything about it in
| the kwic index.  Neither can grep.  Maybe I just don't know the right
| words to look up.  Maybe it isn't documented.  Maybe I can't get there
| from here.  
+---------------

I suspect the only manual that would help you is a hardware manual; many
"smart" serial boards for computers do their own buffering and may insist
on transmitting the remaining contents of the buffer upon receipt of a stop
signal (be it ^S or DTR).
-- 
Brandon S. Allbery		     necntc!ncoast!allbery@harvard.harvard.edu
 {harvard!necntc,well!hoptoad,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery
Moderator of comp.sources.misc

jfh@killer.UUCP (The Beach Bum) (11/07/87)

I have never actually written a device driver that supported full DTR/CTS
flow control, but I would suspect that many feel as I did when writing
a driver for RT-11 (on a DL-11 controller) that DTR and CTS could be
handled at interupt time, while munging around for the tty structure and
then figuring out the tty modes would be too much hassle for an interupt
time routine.

Any thoughts?  Did I guess what you guys are thinking correctly?

- John.
-- 
John F. Haugh II		HECI Exploration Co. Inc.
UUCP:	...!ihnp4!killer!jfh	11910 Greenville Ave, Suite 600
"Don't Have an Oil Well?"	Dallas, TX. 75243
" ... Then Buy One!"		(214) 231-0993