Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)

Chapter 3 77
Common Device Control Functions
Altering Terminal Deficefiles
Altering Terminal Deficefiles
Many of the asynchronous device control functions performed most
commonly are accomplished through the use of the FCONTROL
intrinsic. FCONTROL has often been referred to as the workhorse of
the file system intrinsics. The examples that follow illustrate how
FCONTROL can be used to alter the characteristics of data
transmission to and from a terminal, or to alter device control settings.
The syntax of FCONTROL is shown below:
I16V I16V *
FCONTROL(filenum,controlcode,param);
FCONTROL accesses specific devicefiles through their file numbers, as
specified in the filenum parameter. The function performed by a
particular call to FCONTROL is determined by the controlcode
parameter, as is the meaning and use of param. For some controlcode
values param has no meaning; in these cases param must be coded as
a dummy value to satisfy the requirements of the intrinsic.
See Chapter 8, “Intrinsics Reference,” for a list of the controlcode
values most useful for the control of asynchronous devices and for
information on how param is used for each of the controlcode values
described.
Completion status for each FCONTROL call is indicated through
condition codes. See Chapter 2, “Controlling Asynchronous Devices
Programmatically,” for more information on condition codes.
FCONTROL must be called before any data transfer activity in order to
have any effect on how that activity occurs. In many cases you will need
to use a series of FCONTROL calls to set all of the characteristics
desired for a particular transaction. The code fragments that follow
illustrate the use of a number of FCONTROL functions.
NOTE
An alternative to the FCONTROL intrinsic is provided by the
FDEVICECONTROL intrinsic, which is described in this manual. The
code segments shown in this chapter, however, demonstrate only the
use of FCONTROL.
Specifying an AEOR Character
Specifying an AEOR Character Figure 3-6 shows how FCONTROL may
be used to alter the way in which a read issued against a terminal can
be terminated. A controlcode value of 25 is used, which designates
that a character, specified through the call, is to be accepted as an
Additional End-of-Record (AEOR) character. In this case, an asterisk is
designated as the AEOR character.