]> sigrok.org Git - libserialport.git/commitdiff
windows: Always check and set ReadTotalTimeoutMultiplier.
authorMartin Ling <redacted>
Thu, 7 May 2015 09:06:33 +0000 (10:06 +0100)
committerUwe Hermann <redacted>
Wed, 27 May 2015 09:09:25 +0000 (11:09 +0200)
This is not currently touched, but will be by the upcoming
sp_blocking_read_next() function.

serialport.c

index 8599de137254fd4ab4de956772427c3c9dbdd109..fb7adf65eb0aa7efb4f9b9260d96d81d74bd2722 100644 (file)
@@ -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");