COMM-DRV/Lib: CloseComPort() Close the communication port

Description-

This function closes a port that was previously opened with the InitializePort() or OpenComPort() function. It releases any resources used(memory etc.). This function is identical to UnInitializePort().

Syntax-

stat = CloseComPort(port);

On Entry-

int port;

Port previously opened with OpenComPort().

On Exit-

int stat;

0  If successful.

See Also-

OpenComPort()

Example-

#include <comm.h>

int stat;
int port=0;

if ((stat = CloseComPort(port)) != 0)

{
printf(“Error cleaning up port\n”);

/* Take remedial action */
}