Java Simple Serial Connector (jSSC): getInputBufferBytesCount returns zero

When using the Java Simple Serial Connector (jSSC) library, it SerialPort.getInputBufferBytesCount()

always returns zero, even if there are bytes in the buffer.

Probably the related one readBytes()

never returns any bytes. readBytes(byteCount)

works, but of course I don't know how much to read due to the above problem.

The platform is Windows 8 and I am using Virtual Serial Ports software from HHD.

Does anyone know what might be causing this or how to solve it?

+3


source to share


1 answer


It seems like a mistake. There are several issues on the Google Code page that seem to indicate the same symptoms.



As a workaround, this person built a loop to call readBytes (1, timeout) continuously, where the timeout is a fairly short amount of time. The loop breaks when the readBytes () time out.

0


source







All Articles