[Gambas-bugtracker] Bug #1956: Feature Request: Flush Buffer Function for Serial Ports (gb.net)

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Mon Nov 9 11:10:45 CET 2020


http://gambaswiki.org/bugtracker/edit?object=BUG.1956&from=L21haW4-

Comment #2 by Claus DIETRICH:

1) After some reading about the meaning of "Flush" in Linux I agree. In Visual Basic 6 it is simply achieved by setting the output buffer to Zero (i.e. MSCommControl.OutBufferCount = 0) which wouldn't make much sense in conjunction with glibc.

2) This is what I thought, but I can't test it because of my bad c-knowledge. In any case it should stop the data output of serial ports immediately which might even be desirable without handshake operation.

3) It seems that the glibc function looks for a parameter to decide whether the input buffer of output buffer is meant. However, since Gambas separates between OutputBufferSize and InputBufferSize it might be consequent to separate the methods to something like DiscardOutput/ DiscardInput.

4) Closing and re-opening a port just to get rid of the transmit buffer data would be inconvenient and would have an undesirable impact on the status of the RTS and DTR handshake signals. However, it sounds like a good idea to clear the buffers also, when a port is closed.

5) The Handshake timeouts are essential events in serial communication. So I had to replicate an RTS/CTS timeout in an own class. As of today it seems to do the job but I need the option to clear the buffer after such timeout.

I have according test facilities and experiences if needed.

Claus DIETRICH changed the state of the bug to: Accepted.




More information about the Bugtracker mailing list