Author Topic: Devices with Multiple configurations  (Read 6448 times)

nvd

  • Member
  • ***
  • Posts: 42
Devices with Multiple configurations
« on: February 26, 2013, 11:18:01 pm »
Hello,
 I am a bit confused about how host retrieves information about multiple configurations of a device.
 
 In Device descriptor host gets bNumConfigurations field with the value indicating Number of possible configuration (1, 2 etc.) at current speed.
 Then host sends the GetDescriptor command with wValue-HSB set to Configuration Descriptor type and wValue LSB set to the index of the possible configuration.
 So, Index = 0 means first (or default) configuration, Index=1 means second configuration etc.

 But When Host issues Set_Configuration command, to indicate which configuration to set, it should use the bConfigurationValue which was provided as part of Configuration descriptor.
 
 Also the iConfiguration field in Configuration Descriptor provides index to string descriptor for that configuration.
 The index provided in this field should not collide with index numbers provided in iManufacturer, iProduct, iSerialNumber indexes in Device descriptor.

 Is that how it goes?

Regards,
NVD
« Last Edit: February 26, 2013, 11:23:22 pm by nvd »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Devices with Multiple configurations
« Reply #1 on: February 27, 2013, 08:50:04 am »
Yes and yes. Be aware that most host drivers don't support selecting from among multiple configurations; they just choose the first one.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Devices with Multiple configurations
« Reply #2 on: February 27, 2013, 02:02:08 pm »
On the Mac, the default driver (the composite driver) will attempt to select the configuration which uses most power for the power that is available. (A 500mA config on a powered port, or 100mA config on a bus powered port).

I'm not sure which one it'll chose if there are two equal configs.

Its pretty easy to supply your own device driver on a Mac if you want to choose a config in some other manner. Windows just chooses the first one I think.