HP-UX Reference (11i v1 05/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

b
blmode(7) blmode(7)
NAME
blmode - terminal block mode interface
DESCRIPTION
This terminal interface adds functionality to the current termio(7) functionality to allow for efficient emula-
tion of
MPE terminal driver functionality. Most importantly, it adds the necessary functionality to support
block mode transfers with HP terminals. The block mode interface only affects input processing and does
not affect write requests. Write requests are always processed as described in termio(7). In character
mode the terminal sends each character to the system as it is typed. However, in block mode data is
buffered and possibly edited locally in the terminal memory as it is typed, then sent as a block of data when
the Enter key is pressed on the terminal. During block mode data transmissions, the incoming data is not
echoed and no special character processing is performed, other than recognizing a data block terminator
character. For subsequent character mode transmissions, the existing termio state continues to determine
echo and character processing.
There are two parts of the block mode protocol. The first part is the block mode handshake, which works
as follows:
At the beginning of a read, a trigger character is sent to the terminal to notify it that the system is
requesting a block of data. (The trigger character, if defined, is sent at the beginning of all reads,
whether character or block. The trigger character must be defined for block mode reads.)
After receiving the trigger character, the terminal waits until the user has typed data into the
terminal’s memory and pressed the terminal Enter key. The terminal then sends an alert charac-
ter to the system to notify it that the terminal has a block of data to send.
The system may then send user-definable cursor positioning or other data sequences to the termi-
nal. When that is done, the system sends another trigger character to the terminal, repeating the
cycle.
The second part of the block mode protocol is the block mode transmission. During this transmission of
data, the incoming data is not echoed and no special character processing is performed, other than recog-
nizing the data block termination character. It is possible to bypass the block mode handshake and have
the block mode transmission occur after the first trigger character is sent.
To prevent data loss,
XON/XOFF flow control should be used between the system and the terminal. The
IXOFF bit should be set and the terminal strapped appropriately. If flow control is not used, it is possible
for incoming data to overflow and be lost. (Note: some older terminals do not deal correctly with this flow
control.)
It is possible to intermix both character mode and block mode data transmissions. If block mode transmis-
sions are enabled, all transfers are handled as block mode transfers. When block mode transmissions are
not enabled, character mode transmissions are processed as described in termio(7). If block mode transmis-
sions are not enabled, but an alert character is received anywhere in the input data, the transmission mode
is switched to block mode automatically for a single transmission.
Read requests that receive data from block mode transmissions will not be returned until the transmission
is complete; i.e., the terminal has transmitted all characters. If the read is satisfied by byte count or if a
data transmission error occurs, any subsequent data will be discarded. The read waits until completion of
the data transmission before returning.
The data block terminator character is included in the data returned to the user, and is included in the byte
count. If the number of bytes transferred by the terminal in a block mode transfer exceeds the number of
bytes requested by the user, the read returns the requested number of bytes, and the remaining bytes are
discarded. The user can determine if data was discarded by checking the last character of the returned
data. If the last character is not the terminator character, more data was received than was requested, and
data was discarded.
If desired, the application program can provide its own handshake mechanism in response to the alert char-
acter by selecting the
OWNTERM mode. With this mode selected, the driver completes a read request when
the alert character is received. The second trigger is sent by the driver when the application issues the
next read.
Several special characters (both input and output) are used with block mode. These characters and the nor-
mal values used for block mode are described below. The initial value for these characters is 0377, which
causes them to be disabled.
HP-UX 11i Version 1: September 2005 1 Hewlett-Packard Company Section 711