tcsetattr calls cause framing errors
Chris Dearman
chris@algor.co.uk
Fri Feb 20 16:44:00 GMT 1998
I noticed a problem when using the coolview cygwin.dll (634339 Nov 3
07:04) on an NT4.0 machine. It appears that calls to SetCommState
reprogram the serial chip even if the device parameters are
unchanged. Calling tcsetattr to modify the timeout parameters
(something that gdb does frequently...) can cause received data to be
scrambled.
The attached patch works round the problem by only calling
SetCommState if the device parameters have actually changed. It also
preserves the parity and stop bit settings.
I'm not sure if the handling for ERROR_OPERATION_ABORTED in ReadFile
is really appropriate; it's needed because any serial error will make
the device inaccessible until ClearCommError is called. It might be
better to simply stop the error from being generated by clearing
nstate.fAbortOnError in the tcsetattr call.
Regards
Chris
[ATTACHMENT /usr/algor/chris/fhandler.cc.diffs, application/octet-stream]
--
Chris Dearman, Algorithmics Ltd, 3 Drayton Park, London, N5 1NU, England
Phone: +44 171 700 3301 FAX: +44 171 700 3400 Email: chris@algor.co.uk
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
More information about the Cygwin
mailing list