Guardian Programmer's Guide

Table Of Contents
Communicating With Terminals
Guardian Programmer’s Guide 421922-014
10 - 25
Taking BREAK Ownership
To establish BREAK mode for the terminal, you need to use SETMODE function 12.
Once in BREAK mode, only operations that are associated with BREAK are allowed to
access the terminal.
To interpret BREAK-related errors, check for error 110 (only BREAK access
permitted) and error 111 (operation aborted because of BREAK). Any process using
the same terminal as the TACL process or other process that handles the BREAK key
must check for these errors. See Recovering From Errors later in this section.
Figure 10-7 shows the sequence of events when establishing and reestablishing
BREAK ownership.
Taking BREAK Ownership
When a process takes BREAK ownership for a terminal from another process (for
example, a TACL process), the application process should identify the process that
currently owns BREAK and get the BREAK mode of the current owner. You can do
this by specifying the last-param-array to the SETPARAM procedure call:
LITERAL SET^BREAK^FUNCTION = 3,
NORMAL^MODE = 0,
TAKE^BREAK = 1;
INT LAST^PARAM^ARRAY[0:3];
INT PARAM^ARRAY[0:3];
.
.
PARAM^ARRAY[0] := TAKE^BREAK;
PARAM^ARRAY[1] := NORMAL^MODE;
PARAM^ARRAY[2] := 0;
PARAM^ARRAY[3] := 0;
PARAM^COUNT := 8;
CALL SETPARAM(TERM^NUM,
SET^BREAK^FUNCTION,
Figure 10-7. Enabling BREAK
VST046.VSD