Support / Knowledge Base / HOW TO: Configure TTY Options in Unix

HOW TO: Configure TTY Options in Unix

HOW TO:  Configure TTY Options in Unix

Solution:

AccelePort and RealPort UNIX device driver packages include a command, ditty, which is a superset of stty, and may be used to set and display the device options for Digi AccelePort devices.

The general command format is:

   ditty [-a] [-n ttyname] [option(s)] [ttyname]

In AIX, substitute the command, stty-digi, for ditty:

   /usr/lbin/tty/stty-digi [-a] [-n ttyname] [option(s)] [ttyname]

When using RealPort for AIX or DG/UX, substitute the command, stty-ncxa, for ditty:

   stty-ncxa [-a] [-n ttyname] [option(s)] [ttyname]

When using RealPort for Linux, substitute the command, ditty-rp, for ditty:

   ditty-rp [-a] [-n ttyname] [option(s)] [ttyname]

With no options, ditty displays all Digi special driver settings, modem signals, and all standard parameters displayed by stty(1) for the TTY device referenced by standard input.

Command options are provided to change flow control settings, set transparent print options, force modem control lines, and display all TTY settings. Any unrecognized options are passed to stty(1) for interpretation.

ditty commands may be executed from the command line, or placed in a startup script to be run whenever the system is booted.

The options are:

-aDisplay all of the unique Digi option settings, as well as all of the standard TTY settings reported by stty -a.
-n ttynameSet and display options for the given TTY device, instead of standard input. This option may be specified multiple times to perform the same operation on multiple TTYs.
ttynameSet and display options for the specified TTY device. Replace ttyname with the TTY pathname (such as /dev/ttya01s, /dev/term/a01 or /dev/dty/a001s, depending on your operating system). This option may be used on a modem control line when no carrier is present.

The following options specify transient actions to be performed immediately:

breakSend a 250 MS break signal out on the TTY line.
clear

Clear the tbusy flag in the channel structure to free the port.

NOTE: This option is supported only in UnixWare, OpenServer and Solaris operating systems.

cspeed n

Set the port speed to n bps, where n is an integer value. Available only on Xr, Xem and Xp adapters.

NOTE: This option is supported only in UnixWare, OpenServer, Solaris and HP-UX operating systems. Because the cspeed option is sticky and not transient on HP-UX systems, and only the AccelePort Xp adapter supports cspeed in HP-UX, HP-UX users should refer to the cspeed entry under the sticky options below.

flushImmediately flush (discard) TTY input and output.
flushinFlush TTY input only.
flushoutFlush TTY output only.

The following options specify actions which are not sticky, meaning that the changes are cancelled when the device is closed, and that the device will use the default values the next time it is opened.

stopoutStop output exactly as if an XOFF character were received.
startoutRestart stopped output exactly as if an XON character were received.
stopinActivate flow control to stop input.
startinRelease flow control to resume stopped input.
[-]dtrRaise [drop] the DTR modem control line, unless DTR hardware flow control is selected.
[-]rtsRaise [drop] the RTS modem control line, unless RTS hardware flow control is selected.

The following options are sticky—the effects continue until the system is rebooted or until the options are changed.

[-]printer

Forces the port to stay open so that non-sticky parameters such as baud rate and flow control are not reset to default values.

NOTES:

  • This option is supported only in UnixWare, OpenServer and Solaris operating systems.
  • This option is not supported by RealPort.
[-]fastcook

Perform cooked output processing on the adapter itself to minimize use of host resources.

NOTES:

  • This option is supported only in OpenServer and AIX operating systems.
  • This option is not supported by RealPort.
[-]fastbaudAlter the baud rate tables to permit the use of data rates that are beyond the range supported by the operating system. See fastbaud Data Rate Mapping, at the end of this page.
[-]rtspaceEnable [disable] RTS hardware input flow control, so RTS drops to pause remote transmission.
[-]ctspaceEnable [disable] CTS hardware output flow control, so local transmission pauses when CTS drops.
[-]dsrpaceEnable [disable] DSR hardware output flow control, so local transmission pauses when DSR drops.
[-]dcdpaceEnable [disable] DCD hardware output flow control, so local transmission pauses when DCD drops.
[-]dtrpaceEnable [disable] DTR hardware input flow control, so DTR drops to pause remote transmission.
[-]forcedcdDisable [re-enable] carrier sense, so the TTY may be opened and used even when carrier is not present.
edelay nedelay is a tunable parameter used to set the number of milliseconds of delay between the time the first character arrives after a period of no characters and notification of its arrival to the host. This is also referred to as the wakeup rate between the host adapter software (FEP/OS) and the host device driver. This has the advantage of reducing host overhead by allowing the host to process larger blocks of incoming data.

Larger edelay values result in more characters being sent in a given time period. This will reduce host processor overhead and increase overall system throughput.

Smaller edelay values result in fewer characters being sent in a given time period. This will increase character response time and increase host processor overhead.

The default value for edelay is 100. This is a good value for normal TTY activity like typing. For some applications like uucp, decreasing the edelay value may increase character throughput, but will result in increased host (system) overhead. For applications receiving continuous input at high speeds, increasing edelay will result in lowering host overhead and increasing overall system throughput. A value of 250 is reasonable.

 NOTES:

  • This option is supported only in UnixWare, OpenServer and AIX operating systems.
  • This option is not supported by RealPort.
startc cSets the XON flow control character. The character may be given as a decimal, octal or hexadecimal number. Octal numbers are recognized by the presence of a leading zero, and hexadecimal numbers are denoted by a leading "0x". For example, the standard XON character, , can be entered as "17" (decimal), "021" (octal) or "0x11" (hexadecimal).
stopc cSets the XOFF flow control character. The character may be given as a decimal, octal, or hexadecimal number (see startc, above, for format of octal and hexadecimal numbers).
astartc cSets auxiliary XON flow control character. The character may be given as a decimal, octal, or hexadecimal number (see startc, above, for format of octal and hexadecimal numbers).

Note: This option is not supported in Solaris.

astopc cSets auxiliary XOFF flow control character. The character may be given as a decimal, octal, or hexadecimal number (see startc, above, for format of octal and hexadecimal numbers).

Note: This option is not supported in Solaris.

[-]aixonEnables auxiliary flow control, so that two unique characters are used for XON and XOFF. If both XOFF characters are received, transmission will not resume until both XON characters are received.
maxcps nSets the maximum Characters Per Second (CPS) rate at which characters are output to the transparent print device. The rate chosen should be just below the average print speed. If the number is too low, printer speed will be reduced. If the number is too high, the printer will resort to flow control, and user entry on the terminal will be correspondingly impaired. Default is 100 CPS.
maxchar nSets the maximum number of transparent print characters the driver will place in the output queue. Reducing this number increases system overhead; increasing this number delays operator keystroke echo times when the transparent printer is in use. Default is 50 characters.
bufsize nSets the driver’s estimate of the size of the transparent printer’s input buffer. After a period of inactivity, the driver bursts this many characters to the transparent printer before reducing to the maxcps rate selected above. Default is 100 characters.
onstr "s"Defines the terminal escape sequence to direct subsequent data to the transparent printer.

s is a string of ASCII characters, enclosed in quotes, that command the terminal to enter transparent printing mode. An arbitrary octal character xxx may be given as \xxx.

For example, the sequence [5i would be entered as: "\033[5i".

offstr "s"Defines the terminal escape sequence to stop directing data to the printer.

s is a string of ASCII characters, enclosed in quotes, that command the terminal to enter transparent printing mode. An arbitrary octal character xxx may be given as \xxx.

For example, the sequence [5i would be entered as: "\033[5i".

term tSets the transparent printer on/off strings to values found in the internal default table. Internal defaults are used for the following terminals: adm31, ansi, dg200, dg210, hz1500, mc5, microterm, multiterm, pcterm, tvi, vp-a2, vp-60, vt52, vt100, vt220, wyse30, wyse50, wyse60, or wyse75. If the terminal type is not found in the internal default table, then ditty reads the terminfo entry for the terminal type and sets transparent print on/off strings to values given by the mc5/mc4 attributes found there.
cspeed nSet the port speed to n bps, where n is an integer value.

For HP-UX, this option is valid only for AccelePort Xp adapters. This option is also supported in the UnixWare, OpenServer and Solaris operating systems. Because the cspeed option is transient and not sticky in these operating systems, UnixWare, OpenServer and Solaris users should refer to the cspeed entry under the transient options above.

Fastbaud:

Use the table below to see how setting fastbaud affects data rates for standard AccelePort and RealPort products. Select one of the links below to view a table of fastbaud data rates for: 

    Note: Fastbaud for AccelePort Xp products is not supported under Linux. Linux users should use stty to set baudrates as high as 921600 or use the setserial command for setting arbitrary baudrates.

    AccelePort fastbaud Data Rates

     XpXeXr, Xem, EPC/XXr 920C/X
    Specified Data Rate:Data Rate Mapped to:Data Rate Mapped to:Data Rate Mapped to:Data Rate Mapped to:Data Rate Mapped to:
    505760057600576005760057600
    757680076800768007680075
    110115200115200115200115200115200
    13413165714400144001440014400
    15015360028800576005760057600
    200230400200230400230400200
    3004608003007680076800300
    600921600600115200115200115200
    1200

    N/A

    12002304002304001200
    1800

    N/A

    1800288002880028800
    24002400240024004608002400
    48004800480048009216004800
    960096009600960096009600
    192001920019200192001920019200
    384003840038400384003840038400

    RealPort fastbaud Data Rates

    The table below contains the fastbaud data rates available for RealPort. All other fastbaud data rates for RealPort are unmapped.

    Specified Data Rate:Data Rate Mapped to:
    5057600
    7576800
    110115200
    134131657
    150153600
    200230400
    300460800

     

     
    Last updated: Aug 08, 2017

    Recently Viewed Articles

    No recently viewed articles
    Contact a Digi expert and get started today! Contact Us