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

Chapter 6 125
Typeahead Mode
Programming for Typeahead Mode
Setting Typeahead Mode
The code fragment shown in Figure 6-1 illustrates how you can use the
FDEVICECONTROL intrinsic to allow typeahead processing for your
program. A control directive of 51, set typeahead mode, is passed in
parm1, and parm2 is set to 2 to specify Write access. The buffer
parameter contains a variable called
value
, set to 1 in this example,
which will cause typeahead mode to be enabled. (A value of 0 would
disable typeahead mode.)
In this example, the Pascal/iX
ccode
function checks for errors that
might occur during execution of the intrinsic. If an error occurs, the
program reports the file system error number associated with the error.
If no errors occur, the program informs the user that typeahead is now
on.