home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / sys5 / r3 / 460 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.8 KB  |  64 lines

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!rpi!utcsri!newsflash.concordia.ca!mizar.cc.umanitoba.ca!bison!draco!gremlin!borger
  2. From: borger@gremlin.muug.mb.ca (James Borger)
  3. Newsgroups: comp.unix.sys5.r3
  4. Subject: How do I use ioctl to set DTR and RTS?
  5. Message-ID: <1993Jan27.045725.24394@gremlin.muug.mb.ca>
  6. Date: Wed, 27 Jan 1993 04:57:25 GMT
  7. Organization: The Haunted Unix Box
  8. Lines: 54
  9.  
  10.  
  11.  
  12. I posted this a long time ago, and got no replies, hopefully there's
  13. someone out there now that can help out.
  14.  
  15.  
  16.  The following piece of code was posted to comp.os.linux:
  17.  
  18. /*
  19.  
  20.  mousemode.c 
  21.  
  22.  Program to reset [or set] the DTR and RTS modem control lines on
  23.  a serial port.  For some serial mice this will change the mouse
  24.  mode from Microsoft mode to Mouse Systems mode.
  25.  
  26.  Usage:  mousemode device [set]
  27.  
  28.  where device is your mouse serial device (e.g. /dev/ttys1) and
  29.  the optional set argument (which can be any string) causes the
  30.  control lines to be turned on instead of off.
  31.  
  32.  Use/abuse as you want.  Ed Casas (edc@ee.ubc.ca) 92/11/24.
  33.  
  34. */
  35.  
  36. #include <assert.h>
  37. #include <unistd.h>
  38. #include <fcntl.h> 
  39. #include <sys/ioctl.h>
  40.  
  41. void main(int argc, char **argv)
  42. {
  43.   int fd, s = TIOCM_DTR | TIOCM_RTS ;
  44.   assert ( argc > 1 && ( fd = open ( argv[1] , O_RDONLY ) ) ) ;
  45.   if ( argc > 2 )
  46.     ioctl( fd, TIOCMBIS , &s ) ;
  47.   else
  48.     ioctl( fd, TIOCMBIC , &s ) ;
  49. }
  50.  
  51. I have one of these weird mice and would love to get the three buttons out
  52. of it.  Does anyone know how to convert this to run on ISC 2.2.1?  I looked
  53. through the man pages for ioctl and ioctl.h and fas.h and I
  54. couldn't come up with much. 
  55.  
  56. I was able to make the DTR light flash, but couldn't get it to a stable
  57. state.  I want to set the DTR and RTS before I run XFree so all 3 buttons
  58. on my mouse will work.
  59.  
  60. Can anyone help?
  61.  
  62. Thanks...
  63.  
  64.