Skip to content

Commit 0db4cb0

Browse files
authored
Harmonize WIN32 implementation of serial time-outs with Posix
This is from @mariusgreuel in Issue #1249. #1249 > The WIN32 time-out is specified as ReadTotalTimeoutConstant + buflen * ReadTotalTimeoutMultiplier, which makes it potentially much longer than the Posix one (i.e. at least double). ReadIntervalTimeout is also set to timeout, which essentially renders the interval timeout ineffective, so IMHO, we should explicitly disable that feature.
1 parent 2bb36b9 commit 0db4cb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ser_win32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ static BOOL serial_w32SetTimeOut(HANDLE hComPort, DWORD timeout) // in ms
8888
{
8989
COMMTIMEOUTS ctmo;
9090
ZeroMemory (&ctmo, sizeof(COMMTIMEOUTS));
91-
ctmo.ReadIntervalTimeout = timeout;
92-
ctmo.ReadTotalTimeoutMultiplier = timeout;
91+
ctmo.ReadIntervalTimeout = 0;
92+
ctmo.ReadTotalTimeoutMultiplier = 0;
9393
ctmo.ReadTotalTimeoutConstant = timeout;
9494

9595
return SetCommTimeouts(hComPort, &ctmo);

0 commit comments

Comments
 (0)