1
0
mirror of https://github.com/mik3y/usb-serial-for-android synced 2025-06-07 16:06:10 +00:00

cdc driver: swallow exception for now.

This commit is contained in:
mike wakerly 2012-06-29 01:58:11 -07:00
parent b4b6d147ea
commit f2ff56ba51

View File

@ -106,7 +106,11 @@ public class CdcAcmSerialDriver implements UsbSerialDriver {
timeoutMillis);
if (transferred < 0) {
throw new IOException("Timeout reading timeoutMillis=" + timeoutMillis);
// This sucks: we get -1 on timeout, not 0 as preferred.
// We *should* use UsbRequest, except it has a bug/api oversight
// where there is no way to determine the number of bytes read
// in response :\ -- http://b.android.com/28023
return 0;
}
System.arraycopy(mReadBuffer, 0, dest, 0, transferred);
return transferred;