home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / vms / 12738 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.8 KB

  1. Xref: sparky comp.os.vms:12738 comp.lang.pascal:4530 comp.lang.c:11538 comp.terminals:969
  2. Path: sparky!uunet!gossip.pyramid.com!decwrl!concert!mcnc!ais!bruce
  3. From: bruce@ais.com (Bruce C. Wright)
  4. Newsgroups: comp.os.vms,comp.lang.pascal,comp.lang.c,comp.terminals
  5. Subject: Re: How to read device attributes response ?
  6. Message-ID: <4958@ais.com>
  7. Date: 23 Jul 92 14:25:08 GMT
  8. References: <12996.2a671aaf@ohstpy.mps.ohio-state.edu> <62648@cup.portal.com>
  9. Distribution: usa
  10. Organization: Applied Information Systems, Chapel Hill, NC
  11. Lines: 46
  12.  
  13. In article <62648@cup.portal.com>, Aurelius@cup.portal.com (Mark Christian Barnes) writes:
  14. > S.V. writes:
  15. > | **I need to read the VT330 terminal's attributes
  16. > | (mode, etc) from within running program, and I send
  17. > | for this purpose the sequence <CSI c> to terminal.
  18. > | It should respond with service code, which
  19. > | looks like <CSI ? 63;1;2;...;c> . But the
  20. > | problem is I cannot read this response !!!!!
  21. > | Does anybody know how to handle device attribute
  22. > | response ?
  23. > | Many thanks for any suggestions...
  24. > | S.V.
  25. >  Yes, you could issue a $QIO( extended read ) call. You need to include
  26. > a terminator list that has the character(s) you are expecting from the
  27. > VT330 response sequence. I don't exactly remember the details, but I
  28. > do have some VAX C code that does all this. I could E-mail it to you
  29. > soon ... if you like.
  30.  
  31. You don't `need' to include the terminator list, though that would
  32. certainly be one possible implementation.  The simplest implementation,
  33. though, is probably to let the terminal driver find the escape sequence
  34. terminator itself by specifying IO$M_ESCAPE in the QI/O read function
  35. code, assuming that you are reasonably confident that the response will
  36. follow ANSI guidelines.  (If it doesn't then you will need a more
  37. complicated algorithm than just sending a `CSI c' to the terminal,
  38. probably with a whole list of possible `what are you' escape codes for
  39. several different terminals with appropriate timeouts in case the
  40. terminal doesn't respond to one or another of the inquiries.  Naturally
  41. this can get rather more complex depending on the terminals you are
  42. dealing with ... you'd want to try to avoid sending inquiry sequences
  43. that could mess up some types of terminals until you could rule out
  44. those terminal types as the type that was currently connected).  All
  45. VTxxx terminals where xxx >= 100 follow the ANSI guidelines sufficiently
  46. for this purpose, so for the problem as originally stated this isn't an
  47. issue.
  48.  
  49. I recently posted a program to do just this;  even though it's in PL/I
  50. rather than in C or Pascal, it essentially consists of nothing but a
  51. single QI/O call with (a rather small amount of) appropriate glue to set
  52. it all up, so converting it to any other language you like should be
  53. trivial.  It doesn't set up a terminator mask;  it lets the TTDRIVER
  54. do that.
  55.  
  56. Bruce C. Wright
  57.