mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-06-07 07:56:20 +00:00
fix write timeout calculation
This commit is contained in:
parent
4ffcc8d0fb
commit
cbed086279
@ -211,7 +211,7 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort {
|
||||
throw new IOException("Connection closed");
|
||||
}
|
||||
while (offset < src.length) {
|
||||
final int requestTimeout;
|
||||
int requestTimeout;
|
||||
final int requestLength;
|
||||
final int actualLength;
|
||||
|
||||
@ -230,6 +230,8 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort {
|
||||
requestTimeout = timeout;
|
||||
} else {
|
||||
requestTimeout = (int)(endTime - System.currentTimeMillis());
|
||||
if(requestTimeout == 0)
|
||||
requestTimeout = -1;
|
||||
}
|
||||
if (requestTimeout < 0) {
|
||||
actualLength = -2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user