Description: Implement the related API functions of serial communication
API functions not only provide a way to open and read communication ports, but also provide a wide range of functions to support the various operations of serial communication.
Function name function
CreateFile opens the serial port
GetCommState detects the serial port Settings
SetCommState sets the serial port
BuilderCommDCB fills the device control block with the values in the string
GetCommTimeouts detects communication timeout Settings
SetCommTimeouts sets the communication timeout parameter
SetCommMask sets the monitored event
WaitCommEvent waits to be monitored
WaitForMultipleObjects waits for the results of multiple monitored objects
WriteFile sends the data
ReadFile receives data
GetOverlappedResult returns the final overlapping (asynchronous) operation result
PurgeComm empties the serial buffer and exits all related operations
ClearCommError updates the serial port state structure and clears all serial port hardware errors
CloseHandle closes the serial port
File list (Check if you may need any files):