Ports and Interfaces > USB

[USB Hid using WDK] Set interface for my composite device

(1/1)

ModularMix:
Hello,

I'm currently using a USB composite device with 2 interfaces.
The first interface contains endpoint 0x81 and the second one contains 0x82.
I've succeeded to open this device and read/write data, but the interface mode is always the first one, with which I can retrieve 20 bytes of data.
I'd like to set interface mode to the second one, in order to get 15 bytes of data.

I guess I have to do that before calling CreateFile method. I've noticed SetupDiEnumDeviceInterfaces method but I'm not sure it's the right one since I didn't succeed to set interface.

Did anyone succeed to set interface of a composite USB device ?

Thanks for your answer.

Regards,
--
Aymeric

Jan Axelson:
After detecting a device with the desired Vendor ID and Product ID, examine the HIDP_CAPS structure to see if it's the desired device. If not, keep looking.

Jan

ModularMix:
Thanks a lot Jan.
For the people who are interested, when examining HIDP_CAPS structure, you just have to get UsagePage to know which interface has been chosen.
If it's not the interface mode you want to choose, just keep looking for the next HID device.

Navigation

[0] Message Index

Go to full version