Author Topic: [USB Hid using WDK] Set interface for my composite device  (Read 8934 times)

ModularMix

  • Member
  • ***
  • Posts: 4
[USB Hid using WDK] Set interface for my composite device
« on: April 22, 2011, 01:18:26 pm »
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

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: [USB Hid using WDK] Set interface for my composite device
« Reply #1 on: April 22, 2011, 02:19:02 pm »
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

  • Member
  • ***
  • Posts: 4
Re: [USB Hid using WDK] Set interface for my composite device
« Reply #2 on: April 26, 2011, 10:39:04 am »
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.