Thread View: comp.unix.sys5.r3
1 messages
1 total messages
Started by James Borger
Wed, 27 Jan 1993 04:57
How do I use ioctl to set DTR and RTS?
Author: James Borger
Date: Wed, 27 Jan 1993 04:57
Date: Wed, 27 Jan 1993 04:57
53 lines
1856 bytes
1856 bytes
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...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads