*BSD News Article 29363


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!aggedor.rmit.EDU.AU!goanna.cs.rmit.oz.au!numbat!s882745
From: s882745@numbat.cs.rmit.OZ.AU (Aleksander P Foksa)
Newsgroups: comp.os.386bsd.questions
Subject: Settting and Testing Control lines in RS232
Date: 15 Apr 94 08:51:49 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia
Lines: 31
Message-ID: <s882745.766399909@numbat>
NNTP-Posting-Host: numbat.cs.rmit.oz.au
NNTP-Posting-User: s882745
Keywords: help

Morning all !!

I'm having trouble testing and setting some of the RS232 lines in FreeBSD.

Basically the outputs I can set are TxD, RTS, and DTR.
The inputs are CTS, DSR, CD and RI, plus a few others which aren't
really important.

I have a UPS with a DB-9 connector on the back of it.  The PC is running
FreeBSD and so needs to shut down to single user mode for the power to
go off safely.  The UPS has a relay, with N/O and N/C contacts (1 of each)
with the relay common.  There is also a Remote Shut Down line (with its grnd)
that is limited to 5Volts with a zener.  Once the AC has failed, a 5V
spike to the UPS will shut it down untill AC is restored.
So, how do I test (nicely) the relay contacts, and shutdown the UPS reliably.


Another quick one for "curses" gurus on FreeBSD.
In "normal" curses, I can read a character without echoing and blocking
by setting noecho and nodelay.  Unfortunately, there is no "nodelay"
in FreeBSD curses.  How can I poll the keyboard to see if there is a
specific character waiting, and flush there rest if it is the wrong one.

Thanks in advance

Alex F
--
alexf@dev.ecs.oz.au
s882745@minyos.xx.rmit.oz.au