kopia lustrzana https://github.com/mik3y/usb-serial-for-android
fix write timeout calculation
rodzic
4ffcc8d0fb
commit
cbed086279
|
@ -211,7 +211,7 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort {
|
||||||
throw new IOException("Connection closed");
|
throw new IOException("Connection closed");
|
||||||
}
|
}
|
||||||
while (offset < src.length) {
|
while (offset < src.length) {
|
||||||
final int requestTimeout;
|
int requestTimeout;
|
||||||
final int requestLength;
|
final int requestLength;
|
||||||
final int actualLength;
|
final int actualLength;
|
||||||
|
|
||||||
|
@ -230,6 +230,8 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort {
|
||||||
requestTimeout = timeout;
|
requestTimeout = timeout;
|
||||||
} else {
|
} else {
|
||||||
requestTimeout = (int)(endTime - System.currentTimeMillis());
|
requestTimeout = (int)(endTime - System.currentTimeMillis());
|
||||||
|
if(requestTimeout == 0)
|
||||||
|
requestTimeout = -1;
|
||||||
}
|
}
|
||||||
if (requestTimeout < 0) {
|
if (requestTimeout < 0) {
|
||||||
actualLength = -2;
|
actualLength = -2;
|
||||||
|
|
Ładowanie…
Reference in New Issue