capilot
capilot

Reputation: 13

Is there a way to change device configuration under WinUSB?

I have a multi-function USB device. There's no driver (yet). I want to write an application that talks to just one of its interfaces. It would seem that WinUSB would be perfect for the job, but there's one snag: I need to change the device configuration before I can access the interface.

Is there some way to have WinUSB (or any other part of the system) set the device configuration at the start? I won't need to change it, I just want it to not be configuration zero.

Upvotes: 0

Views: 1063

Answers (2)

Edward Falk
Edward Falk

Reputation: 10063

WinUSB will not let you set device configuration. The usual method is to use USBccgp, specify the "OriginalConfigurationValue" registry value, and then run WinUSB on top of USBccgp.

To be clear, you cannot change the configuration on the fly using Microsoft-supplied drivers. WinUSB doesn't deal with configurations and USBccgp will only set a hard-coded configuration. If you need to select your configuration at runtime, you'll need to write your own driver and it will need to be a kernel driver (not a user-space driver).

Upvotes: 1

David Grayson
David Grayson

Reputation: 87406

I do not think you can do that with WinUSB.

You might look into using libusb, since it has a function named libusb_set_configuration that should do what you want. However, I do not know whether that function actually works on Windows.

Upvotes: 1

Related Questions