[Rxtx] RTS control in RXTX
Pete Flugstad
pete.flugstad at gmail.com
Tue Sep 19 10:10:39 MDT 2006
So, it seems like there are basically two more or less incompatible
ways to handle the RTS line:
- "old" style: RTS held low until PC ready to TX, then raised -
classic Request To Send behavior - CTS is then raised by the modem to
do PC->modem flow control
- "new" style: RTS held high indicating PC is ready to RX - newer
"Request to Send to me" behavior, used for modem->PC flow control
Right now, RXTX selects the new behavior, and seems to assumes the
whole process is handled automatically the by the device driver (I
think, I haven't dug into it). There's no way to access the "old"
style behavior (at least on Windows) without modifying the RXTX source
code and rebuilding.
It seems that RXTX (and the javax comm API) can't really deal with
this difference, even if the underlying OS (e.g. Windows) allows
access to both behaviors. This would seem to partly be a shortcoming
of the termios interface, which the javax comm API seems to have been
based on (makes sense given it came from Sun), but I don't know
termios very well, so I can't say for sure.
So the next question is: what would people think would be the best way
to extend the javax.com (aka gnu.io) API to allow an application
program access to whichever behavior they want? I don't want (and
literlly can't since they will likely get pulled into the same JVM) to
have multiple versions of RXTX around.
My initial thought was to actually modify RXTX to start paying
attention to the IN/OUT HW flow control values - I think right now, it
just maps either to enabling both direction of HW flow control. My
mod would change it so that RTSCTS_OUT by itself would turn on the old
behavior, whle RTSCTS_OUT|IN would turn on the new behavior.
Then there's the whole DTR/DSR behavior as well, which RXTX seems to
require a more or less manual intervention by whatever application
wants to use it.
Anyway, I haven't thought much beyond all this. I wanted to get the
groups feedback so that I don't paint myself into a corner. Has
anyone else seen any other Java Serial Port implementations that do
something like this (like one of the commercial ones?). Anyone have
any other suggestions?
Thanks,
Pete
More information about the Rxtx
mailing list