Closed SparkyTD closed 2 years ago
There is no buffering in this library. It's also not possible to peek into USB transfers. If you do not want to allocate to much memory, you can do partial read with a buffer of size port.getReadEndpoint().getMaxPacketSize()
as mentioned in FAQ
Some other serial libraries use an internal buffer, and they expose an API for the user to peek at the number of available bytes in this buffer. (e.g.
SerialPort.BytesToRead
in C#,SerialPort.bytesAvailable()
in jSerialComm). Is something like this possible with this library? I can't see any relevant methods in theUsbSerialDevice
class other thanread
andwrite
, but maybe I'm missing something.