mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
implement SerialImpl::waitByteTimes on windows
This commit is contained in:
parent
69e0372cf0
commit
7ca1d440fa
@ -322,9 +322,13 @@ Serial::SerialImpl::waitReadable (uint32_t /*timeout*/)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Serial::SerialImpl::waitByteTimes (size_t /*count*/)
|
Serial::SerialImpl::waitByteTimes (size_t count)
|
||||||
{
|
{
|
||||||
THROW (IOException, "waitByteTimes is not implemented on Windows.");
|
DWORD wait_time = timeout_.inter_byte_timeout * count;
|
||||||
|
HANDLE wait_event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||||
|
ResetEvent(wait_event);
|
||||||
|
WaitForSingleObject(wait_event, wait_time);
|
||||||
|
CloseHandle(wait_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user