Subject: Re: Reading from a serial port/modem
To: David Forbes <david@flossy.u-net.com>
From: Willem Brown <willem@brwn.org>
List: netbsd-help
Date: 07/23/2000 18:02:04
Hi,

There is a app called xringd that does something like this. It is a Linux app and
I can't find any reference to it at the moment. Maybe you'll find something on
freshmeat.net. Maybe it will give you an idea on how to go about this.

It listens for rings and based on the ring pattern it executes certain commands.

Regards
Willem Brown

On Sun, Jul 23, 2000 at 04:36:24PM +0100, David Forbes wrote:
> > > 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...
> 
> 

-- 
 /* =============================================================== */
 /*      Linux, FreeBSD, NetBSD, OpenBSD. The choice is yours.      */
 /* =============================================================== */

Vital papers will demonstrate their vitality by
spontaneously moving from where you left them to where
you can't find them.