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

92 Chapter4
Using FDEVICECONTROL
Syntax Description
Syntax Description
While FDEVICECONTROL performs some of the same device control
functions performed by FCONTROL, the two intrinsics look very
different from each other when you use them in a program.
FCONTROL uses just three parameters, through which you specify a
devicefile, define the control operation to be performed, and, depending
on the control operation, pass or receive specific information that may
be required for that operation.
FDEVICECONTROL requires the use of a greater number of
parameter values. For operations that can be performed by either
FCONTROL or FDEVICECONTROL, it is easier to use FCONTROL.
The following is the syntax for FDEVICECONTROL:
I16V UDS I16V I16V
FDEVICECONTROL(filenum,buffer,length,controlcode,
I16V U16V U16
parm1,parm2,fserrorcode);
FDEVICECONTROL is used for a variety of file control operations,
each of which is appropriate for controlling a specific type of devicefile.
The controlcode parameter determines the control operation that will
be performed. The only control operation which effects asynchronous
devicefiles is controlcode value 192. It sends device control directives
to an asynchronous device.
Refer to Table 8-7 for a list of other valid controlcode values and the
operations they perform. For more information on these operations
refer to the MPE/iX Intrinsics Reference Manuals.
When controlcode is 192, parm1 determines the specific control
directive to be sent to the devicefile. parm1 must contain one of the
control directive values specified in Chapter 4, “Using
FDEVICECONTROL.
parm2 determines the Read/Write access to be imposed on the
directive. The Read/Write access setting must be valid for the control
directive specified in parm1. Set parm2 to 1 for Read access, 2 for
Write access, or 3 for both Read and Write access.
For example, if you were to call FDEVICECONTROL with
controlcode set to 192 and parm1 set to 57, which is the control
directive used to obtain the subsystem break character, you would need
to set parm2 to 1, since only Read access is allowed for that control
directive.
If, however, parm1 were set to 36, which is the control directive used to
define the backspace character, you could set parm2 to 1, 2, or 3. In this
case, setting parm2 to 1 would return the current backspace character