UsbSerial icon indicating copy to clipboard operation
UsbSerial copied to clipboard

SerialInputStream read function

Open zcsrf opened this issue 5 years ago • 1 comments

There seems to be an issue with the SerialInputStream read to buffer function.

If the user calls the serialInput.read() to check for new data and afterwards calls serialInput.available() to find out how many more bytes are available the following call to serialInput.read(buffer) should obtain all the previous bytes of data obtained and only afterwards issue a issue a syncRead to get the rest of the data.

The current implementations makes it a bit more complex to implement communication API where the first byte of the message is always the size.

zcsrf avatar Jun 17 '19 10:06 zcsrf

I'm having the same problem.

tamasharasztosi avatar Jul 05 '19 14:07 tamasharasztosi