Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB Composite Device. Could not get read & write endpoints #548

Closed
diamond-61 opened this issue Nov 27, 2023 · 7 comments
Closed

USB Composite Device. Could not get read & write endpoints #548

diamond-61 opened this issue Nov 27, 2023 · 7 comments

Comments

@diamond-61
Copy link

diamond-61 commented Nov 27, 2023

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

@kai-morich
Copy link
Collaborator

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

@diamond-61
Copy link
Author

driver.getPorts() return 1 port

@diamond-61
Copy link
Author

Add scrennshot with interface #0
2

@kai-morich
Copy link
Collaborator

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

@diamond-61
Copy link
Author

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

@diamond-61
Copy link
Author

3

@kai-morich
Copy link
Collaborator

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

@kai-morich kai-morich closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants