Closed MaG21 closed 10 years ago
Sorry for delay. And thank you for this major addition.
If possible, I would like to create a release that also supports this flushing on Windows, but I'm not sure if that is possible. Seems FlushFileBuffer handles this a la drain, but it may be for output only. Are you familiar with this at all? I just asked around.
Will probably merge this to a new feature branch in the meantime.
Opss this PR was meant for the feature-io-flush branch. Sorry about that :\
Support for SerialPort#flush_input() and SerialPort#flush_output() on Windows added. Method SerialPort#flush() was removed due to a possible conflict with the IO#flush method, to produce the same behaviour a combination of flush_input() and flush_output() should be used instead.
The PurgeComm function from Winbase.h was used to produce the same behaviour the POSIX tcflush(3) provides on non-windows systems.
Released as v1.3.0. Thank you.
ruby-serialport lacks the capability to discard data transmitted and/or received through the serial effectively, function that is already provided by the tcflush(3) function from termios on POSIX compliant system.
This pull add support to flush the data received and/or transmitted through the following method.