Subject: Re: Reading from a serial port/modem
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: David Forbes <david@flossy.u-net.com>
List: netbsd-help
Date: 07/23/2000 16:36:24
> > Originally, I tried using /dev/tty00 (which is what pppd uses).  However,
> > I found that I couldn't read anything and I wasn't convinced that I was
> > successfully writing anything either, even when I'd tried various things
> > to set the clocal flag.
> 
> My guess is that you have to deal with some termios properties - see
> termios(4).

Yes, this is what I tried where I got the information about the clocal
flag, and the cread flag.  I've tried various combinations of setting and
clearing these things to no avail.

> BTW, what are you tring to do ? There's several packages to deal with modems
> already available, maybe one could suit your needs ?

I wish to be able to execute an arbitrary action when N rings happen in M
seconds.  i.e. I can call home and let it ring twice and that'll put the
kettle on, collect email, do the washing up or whatever.

And I want to do it using a small program, preferably a script, but a C
program would do.  Oh yeah, and it has to know to get out of the way if
pppd kicks in.  (I was going to work out how to do this later...)

I've also tried reading the modemd source code, but it didn't tell me
anything I didn't already know from reading the man pages.  Somehow
there's some magic in there which I don't understand.

Cheers,

David.

PS - This is made all the more difficult because I don't have a terminal
within sight of the lights on the modem...