[Rxtx] XON / XOFF Question

Bob Jacobsen bob_jacobsen at lbl.gov
Sat Dec 31 20:58:17 MST 2011


On Dec 31, 2011, at 7:38 PM, Riley Porter wrote:

> Thanks for all the great responses.  I am aware of what has been said so far.  However, perhaps I am not very clear in my real question.  I am using a swing worker thread to send the file (line by line) to my device, which in turns WILL send an XOFF char.  How is that character determined to be in fact sent from the serial device to my program?  I fire serialEvents right now for data available.  Should it be handled something like:
> 
> if(XOFF : serialEventResponseLine){ 
>   slowDown()
> };
> 
> Something like that?  Vs perhaps RXTX supplied a XON/XOFF serial event?
> 

If you set XON/XOFF flow control, your code should _NOT_ see the XON/XOFF characters that your device sends.  That should be handled by the operating system and RXTX together.

Your worker thread just tries to send as fast as it can.  That thread won't be given any processor time unless there's room to send more data.

Bob

--
Bob Jacobsen, LBNL Physics Division
Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG








More information about the Rxtx mailing list