Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
X: SampleUSBMIDIDriver / SetConfiguration question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

X: SampleUSBMIDIDriver / SetConfiguration question



Hi,

I used the SampleUSBMIDIDriver sample code to produce a driver and everything worked fine (first time !)

There has been an upgrade in the device's hardware/firmware, and now the USBDevice::OpenAndConfigure fails because the call to SetConfiguration returns "device not responding".

This happens when the device is connected to the Mac's USB port, then switched on. If the device is battery-powered, switched on, then plugged in, everything works because the device is fully initialised.

My question: Is there anything I can do to work around the problem or do I tell the manufacturer that it's really their fault and that the device *must* respond to SetConfiguration calls immediately after USBDeviceOpen, even when it's just been switched on ?

(I tried adding a call to usleep between USBDeviceOpen and SetConfiguration but this didn't seem to help)

Here's the routine:

bool USBDevice::OpenAndConfigure(UInt8 configIndex)
{
	require(Usable(), errexit);

// Get a pointer to the configuration descriptor
require_noerr((*mPluginIntf)->GetConfigurationDescriptorPtr(mPluginIntf, configIndex, &mConfigDescPtr), errexit);


	// Open the device
	if (!mIsOpen) {

require_noerr((*mPluginIntf)->USBDeviceOpen(mPluginIntf), errexit);
mIsOpen = true;
}


require_noerr((*mPluginIntf)->SetConfiguration(mPluginIntf, mConfigDescPtr->bConfigurationValue), errexit);

	return true;
errexit:
	return false;
}

Thanks!

Laurent
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.