I am testing code for serial port communication. I am using synchronous IO for now to keep things simple. I have observed that when the PC recieves XOFF the program pauses, no more printing in the console window. When the program recieves XON it starts running again.
What method exists to find out if my program's serial port has earlier recieved XOFF (regardless of synchronous and asynchronous IO) since the COM port driver shall prevent the port from sending any characters out in this case and I better check if XOFF was recieved before calling writefile().
I think that one way is to use the ClearCommError() with COMSTAT struct. Is this the only way? I get this impression by reading https://msdn.microsoft.com/en-us/library/ff802693.aspx If that is so, it certainly appears a strange way of doing that.