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

Correct "interface" property on Linux hosts #495

Merged
merged 1 commit into from
Sep 20, 2020

Conversation

johannesacco
Copy link
Contributor

The "interface" property should be read from the "usb_interface_path"
instead of the "device_path" as the later one is a directory (e.g.
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3/1-2.3:1.0/ttyUSB1).

This has been tested together with an CP2105EK where it is important
to separate the serial ports from each other.

The "interface" property should be read from the "usb_interface_path"
instead of the "device_path" as the later one is a directory (e.g.
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3/1-2.3:1.0/ttyUSB1).
@zsquareplusc
Copy link
Member

can't reproduce with the composite device i have here (does not show an interface in any of the paths). Have you found some documentation on sys/.../interface?

@johannesacco
Copy link
Contributor Author

I have tested with CP2105, CP2108, TTL232RG-VIP. All of them show "None" as interface without this PR.

With this PR the interface property is correctly initialized to match the one in the USB Descriptor (e.g. "lsusb -v -d 10c4:ea70 | grep iInterface", "lsusb -v -d 10c4:ea71 | grep iInterface" and "lsusb -v -d 0403:6001 | grep iInterface" for above devices.

@zsquareplusc which devices did you try out with and without this PR?

@zsquareplusc
Copy link
Member

getting None on an STM that emulates 2 interfaces, getting duplicate text (same text for product and interface) on CP2104. but at least not None..

@zsquareplusc zsquareplusc merged commit 3e7e896 into pyserial:master Sep 20, 2020
@johannesacco
Copy link
Contributor Author

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants