public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: David Lawyer <dave@lafn.org>
To: Chuck Messenger <chuckm@rochester.rr.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: Serial Howto suggestions (was Re: Trouble reading from my serial device...)
Date: Fri, 21 Nov 2003 21:32:39 -0800	[thread overview]
Message-ID: <20031122053239.GB488@lafn.org> (raw)
In-Reply-To: <3FBD7CD7.1060902@rochester.rr.com>

On Thu, Nov 20, 2003 at 09:47:51PM -0500, Chuck Messenger wrote:
> OK, thanks for the thorough explanation, Ed -- it all makes sense now...
> 
> As far as the documentation goes -- I'm sending this to the 
> maintainers/writers of the Linux Serial Howto, and the Linux Serial 
> Programming Howto.  I had trouble sending to both before, so I'm 
> cross-posting here in the hopes they might see it...
> 
> 1) In my experience, open() does not hang if DTD is not asserted, even 
> without O_NONBLOCK.  Instead, open() returns, but read() hangs instead. 
>  If DTD is not asserted, and you open with O_NONBLOCK, then open() 
> returns (as per the documentation), but all read()'s fail right away 
> (not in the documentation).
> 
> 2) It would be very helpful to point out in the documentation that you 
> _must_ assert DCD -- in hardware -- or it will be impossible for you to 
> operate the serial port, no matter what software flags you use.

Not so.  At least not on my system.  I'm running kernel 2.4.20 and
updated using Debian unstable a few months ago.  I'm now typing on a
dump terminal which is only connected by 3 wires to the PC so there is
no DCD.  But getty has set clocal which does the trick

Furthermore, I just used minicom to open my serial port for my modem
while watching "modemstat".  It shows DCD off (red) since I've set up my
modem to only assert DCD once the modem connects.  No problem opening
the port or reading it.  It reads when I see the results of AT commands
such as displaying the modem settings to double check that I've set it
for DCD off until connect.

So the way it's described is the way it's been working for many years.
I just checked the modemstat code and it opens the port without
O_NONBLOCK so it may well be that it's read() that hangs and not open().
Modemstat just checks the control lines and doesn't do any reads.

		David Lawyer (maintainer of Serial-HOWTO)

> It would be nice to point out the trick of attaching DTR to DCD, too.

> For reference, I'm running Mandrake 9.1, with kernel 2.4.21-0.13mdk.

Was a bug introduced with 2.4.21?  Anyway, you could try setting your
modem to negate DCD and see if you can dial out.

> 
>     - Chuck
> 
[snip]

      parent reply	other threads:[~2003-11-22  6:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-20 21:38 DTD required (was Re: Trouble reading from my serial device ( a microcontroller)) Ed Vance
2003-11-21  2:47 ` Serial Howto suggestions (was Re: Trouble reading from my serial device...) Chuck Messenger
2003-11-21  5:29   ` Gary Frerking
2003-11-21 21:59   ` low_latency flag Chuck Messenger
2003-11-21 22:43     ` Jan-Benedict Glaw
2003-11-21 23:37       ` Chuck Messenger
2003-11-22  5:32   ` David Lawyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031122053239.GB488@lafn.org \
    --to=dave@lafn.org \
    --cc=chuckm@rochester.rr.com \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox