blmode.7 (2010 09)
b
blmode(7) blmode(7)
CBTRIG1C (DC1) is the initial trigger character sent to the terminal at the beginning of a read
request.
CBTRIG2C (DC1) is the secondary trigger character sent to the terminal after the alert charac-
ter has been received.
CBALERTC (DC2) is the alert character sent by the terminal in response to the first trigger
character. It signifies that the terminal is ready to send the data block. The alert
character can be escaped by preceding it with a backslash (
\ ).
CBTERMC (RS) is sent by the terminal after the block mode transfer is complete. It signifies
the end of the data block to the computer.
The two ioctl (2) requests that apply to block mode use the
blmodeio structure, which defined in
<blmodeio.h>, and includes the following members:
unsigned long cb_flags; /* Modes */
unsigned char cb_trig1c; /* First trigger */
unsigned char cb_trig2c; /* Second trigger */
unsigned char cb_alertc; /* Alert character */
unsigned char cb_termc; /* Terminating char */
unsigned char cb_replen; /* cb_reply length */
char cb_reply[ ]; /∗ optional reply ∗/
The cb_flags member controls the basic block mode protocol:
CB_BMTRANS 0000001 Enable mandatory block mode transmission.
CB_OWNTERM 0000002 Enable user control of handshake.
The
CB_BMTRANS bit is only effective when the ICANON flag in termio (7) is set. If
ICANON is
clear, all transfers are done in raw mode, regardless of the
CB_BMTRANS bit. If CB_BMTRANS is
not set, input processing is performed as described in termio (7). During this time, if the alert char-
acter is defined and is detected anywhere in the input stream, the input buffer is flushed and block-
mode handshake is invoked. The system then sends the cb_trig2c character to the terminal, and a
block mode transfer follows. The alert character can be escaped by preceding it with a backslash
(
\ ).
If
CB_BMTRANS is set, then all transmissions are processed as block mode transmissions. Block
mode handshake is not required and data read is processed as block mode transfer data. Block
mode handshake can still be invoked by receipt of an alert character as the first character received.
Reads issued while the CB_BMTRANS bit is set cause any existing input buffer data to be flushed.
If
CB_OWNTERM is set, reads are terminated upon receipt of a non-escaped alert character. No
input buffer flushing is performed and the alert character is returned in the data read. This allows
application code to perform its own block-mode handshaking. If the bit is clear, an alert character
causes normal block mode handshaking to be used.
The initial
cb_flags value is all-bits-cleared.
The
cb_trig1c character is the initial trigger character sent to the terminal at the beginning of a read
request. The initial value is undefined (0377); i.e., no trigger character is sent.
The
cb_trig2c character is the secondary trigger character sent to the terminal after the alert charac-
ter has been received. The initial value is undefined (0377).
The
cb_alertc character is the alert character sent by the terminal in response to the first trigger
character sent by the computer. It signifies that the terminal is ready to transmit data. The initial value
is undefined (0377).
The
cb_termc character is sent by the terminal after the block mode transfer has completed. It
signifies the end of the data block to the computer. The initial value is undefined (0377).
The
cb_replen member specifies the length in bytes of the cb_reply array. The maximum length of
the cb_reply array is NBREPLY bytes. If set to zero, the cb_reply string is not used. It is initially set to
zero.
The cb_reply array contains a string to be sent out after receipt of the alert character but before the
second trigger character is sent by the computer. Any character can be included in the reply string. The
number of characters sent is specified by
cb_replen. The maximum length of the cb_reply array is
NBREPLY bytes. The initial value of all characters in the cb_reply array is null.
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010