Matthias Bolte
2014-12-22 23:44:47 UTC
Hi,
I'm using a composite device. It's first function (interface 0) is
used with WinUSB, it's second function (interface 1 and 2) is a CDC
ACM serial console.
This setup works fine, but there is an issue on Windows I'd like to discuss.
libusb_get_device_list() reports three libusb_devices with the VID:PID
of my composite device, but there is only one device physically
connected. As it turns out only for the third libusb_open() call will
succeed. The other two fail with LIBUSB_ERROR_NOT_SUPPORTED.
After some digging around in the libusb code I figured out the libusb
is reporting the two functions of the composite device as if their
were devices as well. This are the two "devices" libusb_open() will
fail for with LIBUSB_ERROR_NOT_SUPPORTED.
Now I wonder If this is intentional or if this is a bug. As far as I
can tell there is no way I can tell these three libusb_devices apart
using the libusb API, except from trying to libusb_open() them and see
which one fails and which one doesn't. Also the xusb tool doesn't work
with this composite device, because libusb_open() fails with
LIBUSB_ERROR_NOT_SUPPORTED.
I can workaround this in my program, but I'd like to know if this is
intentional, or if this is a bug, of if my understanding of how
composite devices are supposed to work on Windows is wrong. Because
once I ignore the failing libusb_open() calls and found the actual
device then I can claim interface 0 and everything works as expected.
Regards,
Matthias
I'm using a composite device. It's first function (interface 0) is
used with WinUSB, it's second function (interface 1 and 2) is a CDC
ACM serial console.
This setup works fine, but there is an issue on Windows I'd like to discuss.
libusb_get_device_list() reports three libusb_devices with the VID:PID
of my composite device, but there is only one device physically
connected. As it turns out only for the third libusb_open() call will
succeed. The other two fail with LIBUSB_ERROR_NOT_SUPPORTED.
After some digging around in the libusb code I figured out the libusb
is reporting the two functions of the composite device as if their
were devices as well. This are the two "devices" libusb_open() will
fail for with LIBUSB_ERROR_NOT_SUPPORTED.
Now I wonder If this is intentional or if this is a bug. As far as I
can tell there is no way I can tell these three libusb_devices apart
using the libusb API, except from trying to libusb_open() them and see
which one fails and which one doesn't. Also the xusb tool doesn't work
with this composite device, because libusb_open() fails with
LIBUSB_ERROR_NOT_SUPPORTED.
I can workaround this in my program, but I'd like to know if this is
intentional, or if this is a bug, of if my understanding of how
composite devices are supposed to work on Windows is wrong. Because
once I ignore the failing libusb_open() calls and found the actual
device then I can claim interface 0 and everything works as expected.
Regards,
Matthias