Revert UsbSerialTransport.read() to return 0 on timeout (library expects this)
This commit is contained in:
parent
8ef971c051
commit
06a99793a2
1 changed files with 1 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ class UsbSerialTransport(
|
||||||
|
|
||||||
override fun read(buffer: ByteArray, length: Int): Int {
|
override fun read(buffer: ByteArray, length: Int): Int {
|
||||||
val n = connection.bulkTransfer(epIn, buffer, length, 5000)
|
val n = connection.bulkTransfer(epIn, buffer, length, 5000)
|
||||||
if (n < 0) throw IOException("USB read failed")
|
if (n < 0) return 0
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue