They correspond to fopen and fclose for files. For receiving and sending data, use the same functions as for reading from and writing to files, such as fread and fwrite . Close a serial port opened with opendevice . Its argument is the file descriptor obtained with opendevice . Once it is closed, a serial port can be opened again by opendevice or by another application.
All ports are closed anyway when the application quits.
See also opendevice devicename Serial device name. Flush the input buffer of a serial port opened with opendevice . The input buffer is always flushed when the connection is opened. See also opendevice opendevice Open a serial port. Names depend on the operating system and can be obtained with devicename .