mik3y / usb-serial-for-android

Android USB host serial driver library for CDC, FTDI, Arduino and other devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

USB Composite Device. Could not get read & write endpoints

diamond-61 opened this issue · comments

Hello!
Hello I have "composite"
My device has 5 interfaces. There is a description in the screenshot.

When I call findAllDrivers(UsbManager) and get the driver CdcAcmSerialDriver.

Next I open the device and try to open the serialPort. m_serialPort.open(m_connection);

I get the message "Could not get read & write endpoints".

I discovered that in your code in the file CdsAsmSerialDriver.jac there is a check on line 187.

 if (dataInterfaceCount == mPortNumber) {
     mDataInterface = usbInterface;
}

mPortNumber= 0, when the number of dataInterfaceCount = 0, usbInterface has ID = 1 (#1 on screenshot)
This interface has no endpoints.
I need an interface with ID = 3 (#4 on screenshot).

I removed these lines from the code and I got my desired interface, but it's wrong. This will not work with any other device.

How can the library be adapted to work with a composite device?

3839c084-00bc-444d-abb8-4669081b1e8c

#1 with 0 endpoints looks strange. Does the device work with Windows?
How many ports are returned by driver.getPorts()

driver.getPorts() return 1 port

Add scrennshot with interface #0
2

If you are not using usb-serial-for-android library version >= 3.6.0, you have to upgrade.
If you already use it, please send logcat output from CdcAcmSerialDriver class

dependencies {
 implementation 'com.github.mik3y:usb-serial-for-android:3.7.0'
}

the library tries to detect the related interfaces with IAD, but the first row 12 01 00 ... does not match the spec table 1-1