github mik3y/usb-serial-for-android v3.31
v3.3.1

latest releases: v3.8.1, v3.8.0, v3.7.3...
3 years ago

features:
  • new SerialTimeoutException class
  • new getReadEndpoint() and getWriteEndpoint() methods in CommonUsbSerialPort class
  • distinguish generic IO error and timeout in write()
    • Return type of write() method changed to void. The return value was redundant before, as it was always the request length or an exception was thrown
    • If timeout is reached, write() now throws a SerialTimeoutException with ex.bytesTransferred filled with known transferred bytes
    • Optimal write buffer size can be set with port.setWriteBufferSize(port.getWriteEndpoint().getMaxPacketSize())
    • By default the write buffer size is > MaxPacketSize and the Linux kernel splits writes in chunks. When the timeout occurs, it's unknown how many chunks have already been transferred and 0 is returned in SerialTimeoutException.bytesTransferred. With optimal write buffer size, this value is known and returned in SerialTimeoutException.bytesTransferred as the chunking is done in this library, but due to more kernel round trips write() might take slightly longer and cause more CPU load
  • introduced IntDef annotation @Parity at setParameters(..., @Parity int parity) parameter for better warnings
  • disable debug logging in SerialInputOutputManager by default. Can be enabled with public static boolean DEBUG;

fixes:

  • set thread priority in SerialInputOutputManager.run
  • improve error handling in close

changes:

  • Return type of write() method changed to void. The return value was redundant before, as it was always the request length or an exception was thrown

Don't miss a new usb-serial-for-android release

NewReleases is sending notifications on new releases.