Hi,
I am developing a USB HID device, and have following situation to resolve.
The USB HID device has (for the purpose of this discusion) two functions
- one is a HID interface (say, a mouse)
- the other is debug information
Requirements
- when plugging to _any_ vanilla PC (Windows,Linux,Mac)
- the HID should work without any extra drivers
- the PC should not ask for any extra software to be installed, nor report any errors.
- when a particular application is installed on the PC - Windows only - (Mac and Linux a bonus)
- the debug channel should work and provide as much bandwidth as possible.
Based on that,we implemented the "debug channel" also as a HID device, with a big maxpacketsize for bandwidth.
Alas, we've come to realize than to fulfill USB standard, maxPacketSize on the HID IN interrupt endpoint must be set to 64 bytes (as reported by USB 2.0 CV tests); otherwise, as I understand, we risk the device being silently ignored if there is not enough bandwidth on the bus.
This has the side effect of reducing the available bandwidth on the "debug channel", to the point of making it almost unusable for our application.
What are my options here ?
Here the ones I discarded:
* Use bulk endpoint for debug channel
Discarded because a vanilla Windows installation will ask for a driver (violates one of the above requirements)
* Set maxpacketsize on the debug channel HID interface to a bigger number
Discarded because it may not enumerate if there is not enough bandwidth on the USB bus.
QUESTION: would it not enumerate the whole composite device or each interface independently ?
In other words, would this approach just mean that I violate the standard, and that my "debug channel" may not work sometimes ?
Here others I am considering:
* provide multiple alternate settings with higher maxpacketsize.
BUT, how do I change the setting if the device is a HID device, owned by the HID driver ?
Is WinUSB the way to do it ?
But, in WinUSB, can I just "attach" to a particular interface of a composite device ? (IE: I want the original HID function to work normally thru the standard HID path)
* Special command and re-enumerate with bulk endpoint
Here the PC app, would send a special command and the USB device, would disconnect and connect again with for example a Bulk Endpoint.
This is a bit undesirable, as it is cumbersome to achieve on the firmware of the USB.
Any comments, thoughts and answers much appreciated.
Regards,
Raul