From: Martin Ling Date: Thu, 7 May 2015 09:06:33 +0000 (+0100) Subject: windows: Always check and set ReadTotalTimeoutMultiplier. X-Git-Tag: libserialport-0.1.1~28 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0188a545c75b1012054efef41b8fb465ca90a37a;p=libserialport.git windows: Always check and set ReadTotalTimeoutMultiplier. This is not currently touched, but will be by the upcoming sp_blocking_read_next() function. --- diff --git a/serialport.c b/serialport.c index 8599de1..fb7adf6 100644 --- a/serialport.c +++ b/serialport.c @@ -970,8 +970,10 @@ SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf, /* Set timeout. */ if (port->timeouts.ReadIntervalTimeout != 0 || + port->timeouts.ReadTotalTimeoutMultiplier != 0 || port->timeouts.ReadTotalTimeoutConstant != timeout_ms) { port->timeouts.ReadIntervalTimeout = 0; + port->timeouts.ReadTotalTimeoutMultiplier = 0; port->timeouts.ReadTotalTimeoutConstant = timeout_ms; if (SetCommTimeouts(port->hdl, &port->timeouts) == 0) RETURN_FAIL("SetCommTimeouts() failed"); @@ -1086,8 +1088,10 @@ SP_API enum sp_return sp_nonblocking_read(struct sp_port *port, void *buf, /* Set timeout. */ if (port->timeouts.ReadIntervalTimeout != MAXDWORD || + port->timeouts.ReadTotalTimeoutMultiplier != 0 || port->timeouts.ReadTotalTimeoutConstant != 0) { port->timeouts.ReadIntervalTimeout = MAXDWORD; + port->timeouts.ReadTotalTimeoutMultiplier = 0; port->timeouts.ReadTotalTimeoutConstant = 0; if (SetCommTimeouts(port->hdl, &port->timeouts) == 0) RETURN_FAIL("SetCommTimeouts() failed");