I initially thought the selected device per interface would not matter for libusb and that any interface would accept a report that was declared for a different interface, but apparently, it does not. Also, libusb might enumerate these interfaces in varying orders, but that seems purely dependent on the USB descriptor.
Because of this, it's necessary to specify the interface where the ISP report declaration resides. I'm adding in a default (interface_number = 1) and a new argument to customize it. This might unfortunately break the previously declared parts/devices, but from the device reports I saw myself, the ISP report always lives on interface #1, so perhaps there won't be any issues.
Also, just to document this about USBHID somewhere:
macOS - has exactly the same device paths for each interface (does not matter which interface the report is sent to)
linux (libusb) - needs a device path with the correct interface for the report
windows - needs a device path for the specific TLC where thee report was declared in
Addresses the issue encountered in https://github.com/carlossless/sinowealth-kb-tool/issues/28#issuecomment-1880002380 and possibly https://github.com/carlossless/sinowealth-kb-tool/issues/40#issuecomment-1879929586.
I initially thought the selected device per interface would not matter for libusb and that any interface would accept a report that was declared for a different interface, but apparently, it does not. Also, libusb might enumerate these interfaces in varying orders, but that seems purely dependent on the USB descriptor.
Because of this, it's necessary to specify the interface where the ISP report declaration resides. I'm adding in a default (interface_number = 1) and a new argument to customize it. This might unfortunately break the previously declared parts/devices, but from the device reports I saw myself, the ISP report always lives on interface #1, so perhaps there won't be any issues.
Also, just to document this about USBHID somewhere: