usb-serial-for-android v2.1.0 Release Notes

Release Date: 2019-11-15 // about 1 month ago
  • 🔋 features:

    • 👍 DTR and RTS support for CP21xx drivers
    • reimplemented read timeout. caution: too short timeout can cause data loss, see wiki for details
    • include proguard rules in .aar library to retain driver classes instantiated by UsbSerialProber

    🛠 fixes:

    • 👌 improve error handling in close and more reliably interrupt read and terminate SerialInputOutputManager
    • harmonize + cleanup error messages
    • correct purgeHwBuffers parameter description
    • manage USB permission intent in sample app
    • ✅ more code coverage tests

    🔄 changes:

    • 👍 distinguish IllegalArgumentException and UnsupportedOperationException in setParameter
      If you had dedicated handling for IllegalArgumentException, you now have to handle both
    • 0️⃣ SerialInputOutputManager now has infinite read/write timeout per default, to prevent data loss
      If you want to use SerialInputOutputManager.writeAsync you should set a readTimeout!=0 before starting the thread

Previous changes from v2.0.0

  • 🔀 merged back changes collected in kai-morich's fork

    🆕 new features:

    • support ft_232h, cp210_ multiport devices
    • CH34x: data bits, parity, stop bits
    • CP21xx: mark+space
    • 👌 support USB devices with other non CDC related endpoints
    • 👍 CH34x: support more baudrates

    🔄 changes:

    increased minimum Android version to 4.3 (API 17)

    🚀 Always use async read (UsbDeviceConnection.requestWait), as bulkTransfer (UsbDeviceConnection. bulkTransfer) can cause data loss at high baud rates. Before this release only the CdcAcm driver used async read.

    With async read currently read timeout != 0 is ignored. read blocks until data is available (except Ftdi, where status data is available each 16msec).

    💻 Instead of using read you can use the asynchronuos SerialInputOutputManager to be notified on available data. SerialInputOutputManager.writeAsync is also affected, as the loop blocks in a read. Instead you can write directly in your UI thread.