1
0
mirror of https://github.com/mik3y/usb-serial-for-android synced 2025-06-11 18:06:17 +00:00

Fix open().

Issue #53.
This commit is contained in:
mike wakerly 2014-03-19 21:51:09 -07:00
parent a331afaa1a
commit 61714523fc

View File

@ -243,10 +243,11 @@ public class FtdiSerialDriver implements UsbSerialDriver {
if (mConnection != null) { if (mConnection != null) {
throw new IOException("Already open"); throw new IOException("Already open");
} }
boolean opened = false; boolean opened = false;
try { try {
for (int i = 0; i < mDevice.getInterfaceCount(); i++) { for (int i = 0; i < mDevice.getInterfaceCount(); i++) {
if (mConnection.claimInterface(mDevice.getInterface(i), true)) { if (connection.claimInterface(mDevice.getInterface(i), true)) {
Log.d(TAG, "claimInterface " + i + " SUCCESS"); Log.d(TAG, "claimInterface " + i + " SUCCESS");
} else { } else {
throw new IOException("Error claiming interface " + i); throw new IOException("Error claiming interface " + i);