I'm implementing a terminal emulator for the ESP8266 ("ESPTerm"), and going through the xterm manpage for reference, as well as the old VTxxx reference manuals.
I've implemented DECREQTPARM
. But now am asking myself a question: What's this good for?
Clearly, once you are able to send the query and get a response, you already know the right baud rate, parity and byte length. Was this ever used for anything, and is it of any use today?
The only piece of the information worth querying for is the {flags}
value, but that's only used for some expansion board.
Here is what I found, for reference:
DECREQTPARM Request Terminal Parameters
<ESC>[ {Ps} x
The host sends this sequence to request the VT100 to send a DECREPTPARM
sequence back. {Ps} can be either 0 or 1. If 0, the terminal will be
allowed to send unsolicited DECREPTPARMs. These reports will be
generated each time the terminal exits the SET-UP mode. If {Ps} is 1,
then the terminal will only generate DECREPTPARMs in response to a
request.
DECREPTPARM Report Terminal Parameters VT100 to Host
<ESC>[ {sol} ; {par} ; {nbits} ; {xspd} ; {rspd} ; {cmul} ; {flags} x
This sequence is generated by the VT100 to notify the host of the
status of selected terminal parameters. The status sequence may be
sent when requested by the host (via DECREQTPARM) or at the terminal's
discretion. On power up or reset, the VT100 is inhibited from sending
unsolicited reports.
The meanings of the sequence paramters are:
Parameter Value Meaning
------------------------------------------------------------------
{sol} 1 This message is a report.
2 This message is a report, and the terminal is
only reporting on request.
{par} 1 No parity set
4 Parity set and odd
5 Parity set and even
{nbits} 1 8 bits per character
2 7 bits per character
{xspd} 0 Speed set to 50 bps
-and- 8 Speed set to 75 bps
{rspd} 16 Speed set to 110 bps
24 Speed set to 134.5 bps
{xspd}= 32 Speed set to 150 bps
Transmit 40 Speed set to 200 bps
Speed 48 Speed set to 300 bps
56 Speed set to 600 bps
{rspd}= 64 Speed set to 1200 bps
Recieve 72 Speed set to 1800 bps
Speed 80 Speed set to 2000 bps
88 Speed set to 2400 bps
96 Speed set to 3600 bps
104 Speed set to 4800 bps
112 Speed set to 9600 bps
120 Speed set tp 19200 bps
{cmul} 1 The bit rate multiplier is 16
{flags} 0-15 This value communicates the four switch values
in block 5 of SET-UP B, which are only visible
to the user when an STP option is installed.
short: aside from the obvious, not much use
longer:
DEC's engineers didn't design the VT100 with the foreknowledge that you could just run stty
and get the information, and with autobauding modems (cited there as "by the early 1980s", which means that the feature was commercially available before), it's certainly possible that you wouldn't really know what your real line speed was. Nor would you know the other details of the serial connection as seen by your DEC computer.
Some of DEC's later systems (such as VMS) had a way to show some of the information, e.g., show term
.