ComClose

This function relinquishes ownership and closes a communication port.

ComClose is not a graceful close of the specified communication port; any data buffered for transmission will not be transmitted, and any data ready to be received will be flushed. If a graceful close must be performed, see the transmit/receive queue testing routines identified below.

If other applications are also using this communications port, this function simply decrements the open count and exits. Until all applications which performed a ComOpen also perform a ComClose, the port is considered open and controlled by the System Manager (i.e., the interrupt vector points into the System Manager). When the last application with the port open performs its ComClose, the UART resets to its previous state, the interrupt vector is returned to its initial value, and the PICs return to their initial state.