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