home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / biz / sco / general / 4937 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  4.2 KB

  1. Path: sparky!uunet!shady!kevin
  2. From: kevin@shady.UUCP (Kevin Smith)
  3. Newsgroups: biz.sco.general
  4. Subject: Re: Logitech C9 Serial Mouse at 9600 Baud
  5. Message-ID: <79@shady.UUCP>
  6. Date: 2 Jan 93 08:46:17 GMT
  7. References: <9212311731.aa13710@scoke.sco.COM>
  8. Organization: ShadeTree Software, Inc.
  9. Lines: 97
  10.  
  11. In article <9212311731.aa13710@scoke.sco.COM> belal@sco.COM (Bela Lubkin) writes:
  12. :>Kevin Smith wrote:
  13. :>
  14. :>> It doesn't appear that the STTY and INIT strings are in any way
  15. :>> configured into the kernel.  For a serial mouse, then, this must be
  16. :>> handled by the event library calls (By the way, I seem to be missing
  17. :>> my ev_open() man pages).  The sequence would be, I believe, to apply
  18. :>> the STTY to the port then send the INIT string, after which,
  19. :>> everything should be ready to go.
  20. :>
  21. :>I've included ev_open(S) below (compressed, uuencoded -- it has
  22. :>formatting which will not necessarily transport correctly over the
  23. :>Internet).
  24. :>
  25. :>It is ev_open() which sends the INIT string to the mouse port.  The
  26. :>string itself is meaningful to the mouse, not the kernel.  The serial
  27. :>mouse init strings in /usr/lib/event/devices all have the form "*nNx",
  28. :>where "x" varies depending on the mouse mode to be used.  So presumably
  29. :>either "n" or "N" is the baud rate specifier.  I'd say, experiment with
  30. :>it.  With nothing using the serial mouse, do this:
  31. :>
  32. :>  on multiscreen 1: sleep 10000 < /dev/tty1a    # keep the port open
  33. :>  on multiscreen 2: hd /dev/tty1a               # log mouse output
  34. :>  on multiscreen 3: stty 1200 < /dev/tty1a
  35. :>  on multiscreen 3: echo "*nNU\c" > /dev/tty1a  # init to default mode
  36. :>  <move mouse around, look at the hex output on screen 2, get an idea of
  37. :>   what it's supposed to look like when it's working correctly>
  38. :>  on multiscreen 3: stty 2400 < /dev/tty1a
  39. :>  on multiscreen 3: echo "*nOU\c" > /dev/tty1a  # init 2400??
  40. :>  <move mouse around: is it making sense on screen 2?>
  41. :>
  42. :>I learned from the ev_open() source that the baud rate is set before the
  43. :>init string is sent.  So I'm guessing that the mouse automatically
  44. :>handles varying baud rates for the init string, which probably means the
  45. :>first two characters are just to get it in sync.  So the third is
  46. :>probably the baud rate, thus the guess of "*nOU" to initialize the same
  47. :>mouse mode at 2400bps.
  48. :>
  49. :>Anyone with tech docs for a Logitech serial mouse should be able to
  50. :>answer this instantly...
  51. :>
  52. :>>Bela<
  53.  
  54. Through further experimentation I have discovered the following:
  55.  
  56.     The mouse is initially operating at 1200 baud.
  57.  
  58.     The sequence "*nN?" where ? is the operational/encoding mode
  59.     for the mouse ("U" for SCO).
  60.  
  61.     The 'n' in the sequence encodes the baud rate and must be
  62.     delivered at the current operating rate of the mouse (i.e.
  63.     it doesn't seem to do any baud rate matching like modems).
  64.  
  65.     n = 1200, o=2400, p=4800, q=9600
  66.  
  67.     I was able to step through the speeds with
  68.  
  69.     <starting at the default 1200 baud>
  70.     echo "*oNU
  71.     stty 2400
  72.     <works now at 2400>
  73.     echo "*pNU"
  74.     stty 4800
  75.     <works now at 4800>
  76.     echo "*qNU"
  77.     stty 9600
  78.     <works now at 9600>
  79.  
  80.     so... the following script will put the mouse in 9600 baud
  81.     mode
  82.  
  83.     (
  84.         stty 1200
  85.         echo "*qNU"
  86.     ) </dev/tty1a >/dev/tty1a
  87.  
  88.     With the mouse now in 9600 baud mode, I edited /usr/lib/event/devices
  89.     and changed the INIT and STTY strings for "*qNU" and "... 9600 ..."
  90.  
  91.     Normally this would not work since (as Bela pointed out) ev_open()
  92.     sets the baud rate before issuing the INIT and the modem would not
  93.     (if not at 1200 baud) recognize the control string.  Since I have
  94.     already programmed the modem into 9600 baud mode it still works
  95.     after the stty and the INIT string is redundant (since the mouse
  96.     is already programmed) but necessary since the original '*nNU' would
  97.     put the mouse right back into 1200 baud mode.  I could, I guess,
  98.     eliminate the INIT string or set it to something harmless.
  99.  
  100.     I created an rc2.d/S88mouse script to do the initial programming
  101.     and my pointer is now gracefully sliding around my display.
  102.     This is a bit of a hack but I'll live with it.
  103. -- 
  104.         | Email - !shady!kevin uunet!shady!kevin kevin%shady@uunet.uu.net
  105. Kevin Smith | Voice - (+1) (908) 874-7980
  106.         | Mail  - ShadeTree Software, Inc., 192 Capricorn Dr. #10,
  107.         |         Somerville, NJ  08876, USA
  108.