1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-22 19:54:57 +08:00

Use PurgeComm for flush

This commit is contained in:
Marat Nagayev 2023-12-04 12:22:11 +03:00 committed by GitHub
parent 69e0372cf0
commit 2034e390d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -465,7 +465,8 @@ Serial::SerialImpl::flush ()
if (is_open_ == false) {
throw PortNotOpenedException ("Serial::flush");
}
FlushFileBuffers (fd_);
PurgeComm(fd_, PURGE_RXCLEAR);
PurgeComm(fd_, PURGE_TXCLEAR);
}
void