From owner-freebsd-hackers Wed May 26 17:49:32 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cain.gsoft.com.au (genesi.lnk.telstra.net [139.130.136.161]) by hub.freebsd.org (Postfix) with ESMTP id F2B3C1512C for ; Wed, 26 May 1999 17:49:26 -0700 (PDT) (envelope-from doconnor@gsoft.com.au) Received: from lot.gsoft.com.au (lot.gsoft.com.au [203.38.152.106]) by cain.gsoft.com.au (8.8.8/8.8.8) with ESMTP id KAA07106; Thu, 27 May 1999 10:18:48 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199905261614.SAA22845@father.ludd.luth.se> Date: Thu, 27 May 1999 10:18:48 +0930 (CST) From: "Daniel O'Connor" To: Peter Brevik Subject: RE: RS232 status read ioctl (RI,DSR,CTS etc..) Cc: freebsd-hackers@freebsd.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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