Re: Serial port, DTR & CTS - serial experts wanted

Rogier Wolff (R.E.Wolff@bitwizard.nl)
Thu, 11 Nov 1999 10:51:59 +0100 (MET)


David Monniaux wrote:
> > also don't like the RTS signal doing funky stuff when I open the port
> > just to toggle the DTR signal...
>
> Exactly my problem.
>
> > 2) This sounds like an oversight in the driver. I mean I don't know
> > about these semantics, and I write serial drivers....
>
> Yes, is there any reason why the driver should toggle DTR and RTS when the
> serial port gets opened?

Yes, usually "hardware handshaking" is on, for example on the other
computer on the other end of the link. Turning on DTR and RTS then
results in the other side finally being able to send e.g. the login
prompt.

As this is standard, no "serial communication" program bothers to do
this "by hand" as an extra. Moreover, suppose I have a link where I
just occasionally want to send a batch of data. The program I might
want to connect to the serial port might not even be a "serial
communication" program.

> If there is none, I suggest the behaviour be removed or at least be easily
> switchable. Disabling it with a speed of 0 is cumbersome:
> 1/ The first time your program runs, the driver still toggles the lines.
> 2/ If your program dies unexpectedly, the driver is still at speed, say,
> 1200; you have to open the file again to set it to speed 0.
> So I don't consider the speed 0 thing as an easy switch.

I'd think of an "stty" like flag. The problem is, you'll still toggle
the lines the first time, as the default needs to be compatible with
the current behaviour.

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
 "I didn't say it was your fault. I said I was going to blame it on you."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/