-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flush() does not work for Windows and Linux #161
Comments
Because of
in case of BOOL WINAPI FlushFileBuffers( In HANDLE hFile )
in Linux case? |
Confirmed on Windows 8.1:
always yields 72, which means that |
Thanks for reporting the issue and for trying to confirm it with an example. It sounds like you have a suggested solution, please open a pull request: https://help.github.com/articles/creating-a-pull-request/ Thanks! |
@wjwwood |
This was already reported in wjwwood/serial#161.
According to your documentation the
flush()
function should flush both input and output buffers. However both for Windows and Linux platforms it doesn't work properly - buffers are not cleared.Correct and tested implementation:
Windows
PurgeComm(fd_, PURGE_RXCLEAR | PURGE_TXCLEAR);
Linux
tcflush(fd_, TCIOFLUSH);
The text was updated successfully, but these errors were encountered: