From 7ffbc73919814189dd80160cde09a6ce1184f10e Mon Sep 17 00:00:00 2001 From: kai-morich Date: Thu, 1 Jul 2021 07:45:24 +0200 Subject: [PATCH] restore FT2232C support --- build.gradle | 2 +- usbSerialExamples/build.gradle | 2 +- .../com/hoho/android/usbserial/driver/FtdiSerialDriver.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index f7fa2805..2a96c290 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.0' + classpath 'com.android.tools.build:gradle:4.2.2' } } diff --git a/usbSerialExamples/build.gradle b/usbSerialExamples/build.gradle index 404096a5..0e8a05c2 100644 --- a/usbSerialExamples/build.gradle +++ b/usbSerialExamples/build.gradle @@ -27,6 +27,6 @@ android { dependencies { implementation project(':usbSerialForAndroid') - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'com.google.android.material:material:1.3.0' } diff --git a/usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver/FtdiSerialDriver.java b/usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver/FtdiSerialDriver.java index dbbc01c8..5f88d32a 100644 --- a/usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver/FtdiSerialDriver.java +++ b/usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver/FtdiSerialDriver.java @@ -128,7 +128,8 @@ protected void openInt(UsbDeviceConnection connection) throws IOException { throw new IOException("Could not get device descriptors"); } int deviceType = rawDescriptors[13]; - baudRateWithPort = deviceType == 7 || deviceType == 8 || deviceType == 9; // ...H devices + baudRateWithPort = deviceType == 7 || deviceType == 8 || deviceType == 9 // ...H devices + || mDevice.getInterfaceCount() > 1; // FT2232C } @Override