Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
_modbus_rtu_flush() does not clear the COM-port buffer (in Windows) #144
Function "_modbus_rtu_flush()" does not clear the COM-port buffer when it is filled with random data.
and it clears the COM-port buffer in practice.
I am not Windows programmer, but as I understand from MSDN (for a case of COM-port):
referenced this issue
Nov 27, 2013
added a commit
Jan 29, 2014
Sorry to bring this back up after so long, but :
I just remembered there is also an issue of return values
I think modbus_rtu_flush() is supposed to return like tcflush. 0 on success, and -1 on failure.
The code i am actually using is