Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jun 1995 21:58:03 -0500
From:      Randy Berndt <rberndt@neosoft.com>
To:        jleppek@suw2k.ess.harris.com (James Leppek), freebsd-questions@FreeBSD.ORG
Subject:   Re: APC Backups 400 && ups daemon
Message-ID:  <199506300256.VAA19157@Starbase.NeoSoft.COM>

next in thread | raw e-mail | index | archive | help
At 12:18 AM 6/29/95 EDT, James Leppek wrote:
>
>If you wire the status line to the DSR (RS232 pin 6) then this should
>work:
>fd=open("device_name", O_RDONLY,0);
>
>get status with
>int tty_status;
>ioctl(fd, TIOCMGET, &tty_status);
>
>check it with
>if(tty_status & TIOCM_DSR)
>bla bla bla
>
>loop as you see fit, but I would put a sleep(1) in there somewhere
>
>

James,

About an hour after I saw your message, I was faced with a problem of being
able to detect a CD drop on a serial port. Without your message, I would
have spent literally hours digging around trying to find (or steal from an
existing program) something that would 'get me by' (I'm quite new to this).
With your 4 lines of code, you made my life considerably easier.

I just wanted to say "THANK YOU!"

I think the "A tells B something, and it really helps C" is the BIG value of
this mailing list.

Thanks again.

Randy Berndt
[Signature, like every damned freeway in Houston, is "under construction".]




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506300256.VAA19157>