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

use correct control index for composite CDC devices with non-consecutive interface IDs (#477)

This commit is contained in:
kai-morich 2023-03-15 07:27:37 +01:00
parent fd551970be
commit 083b9ae7fe

View File

@ -150,7 +150,7 @@ public class CdcAcmSerialDriver implements UsbSerialDriver {
UsbInterface usbInterface = mDevice.getInterface(i); UsbInterface usbInterface = mDevice.getInterface(i);
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_COMM) { if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_COMM) {
if(controlInterfaceCount == mPortNumber) { if(controlInterfaceCount == mPortNumber) {
mControlIndex = i; mControlIndex = usbInterface.getId();
mControlInterface = usbInterface; mControlInterface = usbInterface;
} }
controlInterfaceCount++; controlInterfaceCount++;