mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
implement flushInput and flushOutput for windows
This commit is contained in:
parent
827c4a784d
commit
c9a2a086ca
@ -471,13 +471,19 @@ Serial::SerialImpl::flush ()
|
||||
void
|
||||
Serial::SerialImpl::flushInput ()
|
||||
{
|
||||
THROW (IOException, "flushInput is not supported on Windows.");
|
||||
if (is_open_ == false) {
|
||||
throw PortNotOpenedException("Serial::flushInput");
|
||||
}
|
||||
PurgeComm(fd_, PURGE_RXCLEAR);
|
||||
}
|
||||
|
||||
void
|
||||
Serial::SerialImpl::flushOutput ()
|
||||
{
|
||||
THROW (IOException, "flushOutput is not supported on Windows.");
|
||||
if (is_open_ == false) {
|
||||
throw PortNotOpenedException("Serial::flushOutput");
|
||||
}
|
||||
PurgeComm(fd_, PURGE_TXCLEAR);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user