Date: Thu, 27 May 1999 10:18:48 +0930 (CST) From: "Daniel O'Connor" <doconnor@gsoft.com.au> To: Peter Brevik <pb@ludd.luth.se> Cc: freebsd-hackers@freebsd.org Subject: RE: RS232 status read ioctl (RI,DSR,CTS etc..) Message-ID: <XFMail.990527101848.doconnor@gsoft.com.au> In-Reply-To: <199905261614.SAA22845@father.ludd.luth.se>
next in thread | previous in thread | raw e-mail | index | archive | help
On 26-May-99 Peter Brevik wrote:
> it seems the bits in the resulting code does not correspond to what actually
> are physicaly on the rs232 connector anyway.
> I would not like to use brute force, like inb()/outb() commands..
> Any suggestions on how to get TIOCMGET ioctl() to work as intended ..?
Hmm.. I have a dumb serial UPS which works this way (ie it toggles various
lines on the serial port for status) and it works fine.
The ups code which I got (which is pretty ugly, but it does work! :) uses
TIOCMGET ioctl, and it seems to sense power failures etc just fine.
eg
-- code snippet --
/* Lower All Modem Lines */
commlines = 0;
ioctl(ups->SerialPortHandle,TIOCMSET,&commlines);
D( printf("Clearing... commlines = %ld\n",commlines); )
-- end code --
---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.990527101848.doconnor>
