1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

windows: Set fAbortOnError=FALSE.

Since we're not handling and clearing receive errors (framing, parity and
overrun), we should turn them off to avoid crashing out with
ERROR_OPERATION_ABORTED in various calls if they occur. Invalid data
will then simply not end up in the buffer. This is consistent with our
current behaviour on posix/termios systems.

It might be nice to be able to inform calling code about receive errors, but I
can't see a good way to do this in a cross-platform way at the moment.

This fixes (parts of) bug #341.
This commit is contained in:
Martin Ling 2015-03-27 22:43:14 +00:00 committed by Uwe Hermann
parent 47fcf8ec85
commit 34442106ef

View File

@ -546,7 +546,7 @@ SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags)
data.dcb.fDsrSensitivity = FALSE;
data.dcb.fErrorChar = FALSE;
data.dcb.fNull = FALSE;
data.dcb.fAbortOnError = TRUE;
data.dcb.fAbortOnError = FALSE;
#else
/* Turn off all fancy termios tricks, give us a raw channel. */
data.term.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IMAXBEL);