home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!rpi!utcsri!newsflash.concordia.ca!mizar.cc.umanitoba.ca!bison!draco!gremlin!borger
- From: borger@gremlin.muug.mb.ca (James Borger)
- Newsgroups: comp.unix.sys5.r3
- Subject: How do I use ioctl to set DTR and RTS?
- Message-ID: <1993Jan27.045725.24394@gremlin.muug.mb.ca>
- Date: Wed, 27 Jan 1993 04:57:25 GMT
- Organization: The Haunted Unix Box
- Lines: 54
-
-
-
- I posted this a long time ago, and got no replies, hopefully there's
- someone out there now that can help out.
-
-
- The following piece of code was posted to comp.os.linux:
-
- /*
-
- mousemode.c
-
- Program to reset [or set] the DTR and RTS modem control lines on
- a serial port. For some serial mice this will change the mouse
- mode from Microsoft mode to Mouse Systems mode.
-
- Usage: mousemode device [set]
-
- where device is your mouse serial device (e.g. /dev/ttys1) and
- the optional set argument (which can be any string) causes the
- control lines to be turned on instead of off.
-
- Use/abuse as you want. Ed Casas (edc@ee.ubc.ca) 92/11/24.
-
- */
-
- #include <assert.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <sys/ioctl.h>
-
- void main(int argc, char **argv)
- {
- int fd, s = TIOCM_DTR | TIOCM_RTS ;
- assert ( argc > 1 && ( fd = open ( argv[1] , O_RDONLY ) ) ) ;
- if ( argc > 2 )
- ioctl( fd, TIOCMBIS , &s ) ;
- else
- ioctl( fd, TIOCMBIC , &s ) ;
- }
-
- I have one of these weird mice and would love to get the three buttons out
- of it. Does anyone know how to convert this to run on ISC 2.2.1? I looked
- through the man pages for ioctl and ioctl.h and fas.h and I
- couldn't come up with much.
-
- I was able to make the DTR light flash, but couldn't get it to a stable
- state. I want to set the DTR and RTS before I run XFree so all 3 buttons
- on my mouse will work.
-
- Can anyone help?
-
- Thanks...
-
-