Turns the hardware handshake (automatic CTS) on/off
<nComPort> Designates the port (1 to N) for which the hardware
handshake is switched on or off.
<lNewHandshake> Designates whether the handshake is on (.T.) or off
<lDTR/DSR> Designates whether the function uses the DTR/DSR
handshake or the RTS/CTS handshake. When passed as .T., the function
uses the DTR/DSR handshake instead of the RTS/CTS handshake.
When called only with <nComPort>, the COM_HARD() returns .T. if the
hardware handshake is on and .F. if the hardware handshake is off.
When <lNewHandshake> is passed, the function returns the status prior to
the new setting.
The size of a receiving buffer is always limited. To avoid overflow,
and thereby a loss of characters, software or hardware handshakes are
usually implemented. During a hardware handshake, the port monitors the
RTS signal. If you use this function to switch this handshake on, the
signal is activated as soon as the buffer is 75% full. As soon as the
buffer content is once again reduced to 50% or less, the port (the RTS
signal) is once again released. Some printers use the port signals, DTR
(output like RTS) and DSR (entry like CTS) instead of RTS/CTS, to avoid
buffer overflow. In this case, <lDTR/DSR> can be passed with .T..
” The hardware handshake only supports background transmission
(when COM_OPEN() is implemented with the third parameter
” This function works for data input as well as output.
” If you use a hardware handshake, then the RTS signal should no
longer be affected by COM_RTS() or COM_MCR().
Turn on the hardware handshake at a port:
COM_OPEN(2, 1000, 1000) // Open COM2, background send
COM_HARD(2, .T.) // RTS/CTS Hardware handshake
// for port 2