Thanks for the quick response. I realize now that there were some info
missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush
function in the termios.c really does what I need. I have two questions:
1.You said that maybe this function might have a call in Java in version
2.1, can you tell me when this will be decided? Because based on this,
I will decide if I wait for version this build of 2.1
2.in the tcflush function, when PurgeComm is called, it is used
PURGE_RXABRT, wouldn't it be better to use PURGE_RXCLEAR instead?
Thanks,
Francisco
Trent Jarvi wrote:
Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote:
>
>>Hi, I'm having the following problem: when I'm reading from the serial
>>port, I get a lot of garbage thta was written. Is there anyway to clear
>>the input before reading? I searched through the mail list archive, but
>>didn't find anything conclusive. Any response is deeply appreciated.
>>
>
>>
>
>I dont think this is specified in CommAPI at all. If you found something,
>please let me know.
>
>So what you are asking for is an extension to commapi or a change in the
>open() behavior that is not documented.
>
>
>In Linux/Unix, you can do this in the native open code with the following:
>
>tcflush( fd , TCIFLUSH );
>
>search for RXTX.open. The code should be placed after PEN() man termios
>documents this for the C API.
>
>It looks like I have implemented this in the w32 termios.c so the above
>change should just work in w32 too. it has not been tested.
>
>If there is a real need for accessing this functionality from Java, we
>could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with
>whatever Sun documents though.
>
>
Rxtx mailing list
Rxtx (AT) mail (DOT) electronpusher.org