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

80 Chapter3
Common Device Control Functions
Altering Terminal Deficefiles
Altering Device Control Settings
The code fragment presented in Figure 3-7 shows how a series of
FCONTROL calls may be used to perform various device control
functions. The end result of such a sequence of FCONTROL calls should
be a devicefile whose characteristics are as required for a specific
application.
The first call in the example, to FCONTROL(40), returns device
information to the calling program as the value of the
line_speed
variable. This call is used to determine the current line speed of the
device. Examples of when such a call may be used are to verify a
particular setting for an application, or to obtain and store a current
value so that a setting can be altered and later reset to its original
value.
The next call, to FCONTROL(11), changes the line speed of the device
to a new value. The value used in the call must be a supported line
speed, entered as characters per second (240 characters per second is
2400 bps).
The next two FCONTROL calls work together to set a desired parity
and enable parity checking. FCONTROL(36) is used in this case to
define odd parity as the parity to be used if parity is enabled. Note that
setting parity has no effect until parity is enabled.
Parity is enabled through the subsequent call to FCONTROL(24). In
the FCONTROL(24) call, the third parameter has no meaning. A
dummy value must be specified, however, to satisfy the needs of the
FCONTROL intrinsic, as well as the needs of the Pascal compiler.