I use rxtx for serial I / O processing in Java with the FTDI2232H, which provides a USB communication port. It works fine, with one exception: if I disconnect the USB cable so that the COM port disappears at runtime, it throws the exceptions left and right:
java.io.IOException: No error in nativeavailable
at gnu.io.RXTXPort.nativeavailable(Native Method)
at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1427)
at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1339)
and when I plug in the cable again, it does not recover.
Is there a way to get rxtx to work properly with connecting / disconnecting a USB communication port? (I tried to send a message to the rxtx mailing list, but for some strange reason, I cannot send messages, although I subscribed to this list. I sent an email to the list administrator and did not receive a response.)
If not, is there another input / output system?
source
share