Revert UsbSerialTransport.read() to return 0 on timeout (library expects this)

This commit is contained in:
eddy 2026-07-26 13:33:17 +02:00
commit 06a99793a2

View file

@ -14,7 +14,7 @@ class UsbSerialTransport(
override fun read(buffer: ByteArray, length: Int): Int {
val n = connection.bulkTransfer(epIn, buffer, length, 5000)
if (n < 0) throw IOException("USB read failed")
if (n < 0) return 0
return n
}