diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-18DD4FE5-6641-5A0E-A00E-DC0C00639CE4.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-18DD4FE5-6641-5A0E-A00E-DC0C00639CE4.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,45 @@ + + + + + +Set +the Configuration DescriptorsA short document that describes how to set the configuration descriptors. + +
Introduction

The +configuration descriptor contains values required by the class drivers. The +settings are:

    +
  • number of interfaces +in the configuration,

  • +
  • maximum power taken +by the device,

  • +
  • is remote wakeup enabled.

  • +

Note: that the number of interfaces in the configuration +must be set, all the other settings are optional.

The size of the +data to be copied may be obtained by using GetConfigurationDescriptorSize().TInt desc_size = 0; +gPort.GetConfigurationDescriptorSize(desc_size);

The size +should normally be KUsbDescSize_Config as defined in <usb.h>

+
Setting configuration descriptors

Set the configuration +descriptor using RDevUsbcScClient::SetConfigurationDescriptor().

TBuf8<desc_size> descriptor; + +// Invert Remote-Wakup support +descriptor[KConfDesc_AttribOffset] = (descriptor[KConfDesc_AttribOffset] ^ KUsbDevAttr_RemoteWakeup); + +// Change the reported max power to 200mA (2 * 0x64) +descriptor[KConfDesc_MaxPowerOffset] = 0x64; +r = gPort.SetConfigurationDescriptor(descriptor);

Additional +values may be set using the RDevUsbcScClient class. These +values can be set, retrieved and removed:

    +
  • Manufacturer,

  • +
  • Product,

  • +
  • Serial numbers.

  • +
+ +

After you have set the configuration descriptors you should Set the Interface Descriptors.

+
\ No newline at end of file