RXTX and Java

As I mentioned before, I’m using RXTX to do serial communication in Java since Sun has dropped support for serial communication under the Windows platform.  I want to revamp my read routines on the java side because they are ugly.  At the time, it was done the way it was because it works.

I’m still having the read-length problem mentioned in this post, or actually the comment on that post.

While I’m not sure WHY this is happening, I know what the sort of related causes are.  It appears the USB to serial virtual com port drivers only support a “USB transfer size” of 4096 bytes, then each successive read from the converter yields a maximum of 3968 bytes.  This is 4096 = 3968 +128 bytes overhead.  The read routines, however, in RXTX are designed to put some more intelligence by doing multiple reads until the desired size is fulfilled.  These routines are not working, most likely because there is a bug in the virtual com port drivers………

anyways more on this later


Amateur Electronics Design Engineer and Hacker

Add comment