3

When using the Java Simple Serial Connector (jSSC) library, SerialPort.getInputBufferBytesCount() always returns zero, even when there are bytes in the buffer.

Probably related to this, readBytes() never returns any bytes. The readBytes(byteCount) version works - but, of course, I don't know how many to read because of above issue.

Platform is Windows 8 and I'm using the Virtual Serial Ports software from HHD.

Does any one know what might be causing this or how to resolve?

Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
PaulJNewell
  • 239
  • 3
  • 9

1 Answers1

0

This appears to be a bug. There are a number of issues opened on the Google Code page that seem to point to the same symptoms.

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

Community
  • 1
  • 1
joshreesjones
  • 1,934
  • 5
  • 24
  • 42