john@wa3wbu.UUCP (John Gayman) (01/20/89)
I'm looking for a simple seril-port interface program written in C that would monitor a given port for the assertion of DSR or DCD and then execute a routine depending on wether one, the other or both signals were detected. What I'm trying to do is come up with an interface for a UPS system. This system will provide two relay closures, one at switch-over time and another at the 2-minute warning. I'd like to wire these into synthesizing a signal like DSR and DCD (or something else) and then when it detects the first signal it would know the power has gone off. It could then internally keep track of the back-up time left. When it gets the second signal, it would know a power shutdown is eminent and could exec a "shutdown" and have the system in single-user mode waiting for power to die. Also, if the back-up signal dropped (power back on) it would cancel the operation and go back to monitoring the port. Does anyone have any ideas or perhaps a program that already does something like this for SVR2 ? Any and all suggestions are appreciated. John -- John Gayman, WA3WBU | UUCP: uunet!wa3wbu!john 1869 Valley Rd. | ARPA: john@wa3wbu.uu.net Marysville, PA 17053 | Packet: WA3WBU @ AK3P
cgh018@tijc02.UUCP (Calvin Hayden ) (01/25/89)
John writes: > > I'm looking for a simple seril-port interface program written in > C that would monitor a given port for the assertion of DSR or DCD > and then execute a routine depending on wether one, the other > or both signals were detected. > > What I'm trying to do is come up with an interface for a UPS system. > This system will provide two relay closures, one at switch-over time > and another at the 2-minute warning. I'd like to wire these into > synthesizing a signal like DSR and DCD (or something else) and then > when it detects the first signal it would know the power has gone off. ---snip snip--- > > Does anyone have any ideas or perhaps a program that already does > something like this for SVR2 ? Any and all suggestions are > appreciated. ---snip snip--- I would be interested in such also. No need to reinvent the wheel. Calvin UUCP: mcnc!rti!tijc02!cgh018 Voice: (615)461-2254