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
1 changed files with 1 additions and 1 deletions

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.fDsrSensitivity = FALSE;
data.dcb.fErrorChar = FALSE; data.dcb.fErrorChar = FALSE;
data.dcb.fNull = FALSE; data.dcb.fNull = FALSE;
data.dcb.fAbortOnError = TRUE; data.dcb.fAbortOnError = FALSE;
#else #else
/* Turn off all fancy termios tricks, give us a raw channel. */ /* Turn off all fancy termios tricks, give us a raw channel. */
data.term.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IMAXBEL); data.term.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IMAXBEL);