Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)
86 Chapter3
Common Device Control Functions
Altering Terminal Deficefiles
Finally, note that in the example an FREAD call specifying a read of 0
bytes is posted against the device immediately following the
FCONTROL calls. Only after the 0 byte read completes successfully
does the program notify the user that the port is in binary mode. It is
actually the read, not the FCONTROL call, that causes the controlling
software to place the device driver in binary mode. (This is only true
when you are setting binary mode. Most FCONTROLs take effect at the
time the FCONTROL call is issued.)
If you are setting binary mode for reads only this is not a consideration,
since the first read posted will cause binary mode to be set. If, however,
you are setting binary mode for both a read port and a write port, you
need to post a read of 0 bytes before assuming that binary mode is set.