On 06.01.2010 16:50, Michael Karcher wrote:
Am Mittwoch, den 06.01.2010, 16:27 +0100 schrieb Michael Karcher:
Am Mittwoch, den 06.01.2010, 16:13 +0100 schrieb Carl-Daniel Hailfinger:
+int serialport_discard_read(void)
[...] but is there any reason not to use tcflush(sp_fd, TCIFLUSH); instead of this complicated function?
OK, I think I got it. tcflush is or was broken on Windows. See for example http://www.cygwin.com/ml/cygwin/2003-10/msg00797.html Maybe add a reference to cygwin as explanation?
Don't worry. They changed cygwin. See tcflush in http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler_serial.cc?re... It maps to a native PurgeComm which is just fine. Thanks to patrickg for the hint to recheck current code.
So no need to not use tcflush here.
Patrick, can you take care of this in your serial port patch? Thanks.
Regards, Carl-Daniel