Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple configurations problem



At 6:07 PM -0500 6/28/05, Mark Cookson wrote:

I do a IOUSBDevice::SetConfiguration(1) to get the second interface (because the parameter is an index, not a value -- important safety tip), but then calls to IOUSBDevice::FindNextInterface() fail to find the last interface.

Are you totally sure of that? I'm expecting, and looking in the source backs this up, that the parameter to SetConfiguration is the configuration value, not an index.


There can be a great deal of confusion between the config index and the config value, so to be clear:

The configuration descriptors are arranged as zero based array, they are retrieved by index in a GET_DESCRIPTOR request, the indicies would be 0,1 in your case.

The configuration value is one field of the configuration descriptor, the spec either implies or requires (I'm not sure which) that this value be a one based number, so it'd be 1,2 in your case. The configuration value is what is passed in a SET_CONFIGURATION request to specify the configuration.

The confusion comes because the index and value are offset by one and both have to be used at various points. Note: zero is not a valid configuration value, the spec specifically states a SET_CONFIGURATION(0) is equivalent to unconfiguring a device. Its not uncommon for single configuration devices to, incorrectly, specify zero as the configuration value. Once you get to multiple configuration devices this error really causes problems.

The series of commands your device should be getting to set the second configuration is:

GET_DESCRIPTOR(config, 1)
SET_CONFIGURATION(2)

The note in the log says:

   42.260 [5]    foobar[0x1800200]::SetConfiguration to 1

Which is using a configuration value of 1, which should be the first configuration as you're finding out. Its also what you specified in the SetConfiguration.

So, are your configuration values correct (1,2)? and are you sending the right value to SetConfiguration.
--
Barry Twycross
email@hidden
---
USB, it's not a Dyslexic BUS. (Thanks to TC.)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden


This email sent to email@hidden
References: 
 >Multiple configurations problem (From: Mark Cookson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.