USB Property

The USB property gets or sets the value of the bcdUSB field that indicates the USB release number for the device qualifier descriptor, as defined in section 9.6.2 of the USB 2.0 specification.

This property is read/write.

Syntax

HRESULT put_USB(
  [in]           SHORT sUSB
);

HRESULT get_USB(
  [out, retval]  SHORT *psUSB
);

Property Value

The new USB version value for the device qualifier.

Error Codes

USB returns S_OK if the operation succeeds or E_POINTER if the psUSB parameter is not a valid pointer.

Remarks

The following C++ code example shows how to get and set the USB property.

HRESULT CLoopBackDevice::SetDeviceQualifierUSB(ISoftUSBDeviceQualifier *piQualifier)
{
HRESULT hr = S_OK;
SHORT       sUSB = 0;
SHORT       sNewUSB= 0x0200; //binary coded decimal USB version 2.0

if (NULL == piQualifier)
{
  hr = E_INVALIDARG;
  goto Exit;
}

// Get the current USB version
hr = piQualifier->get_USB (&sUSB);
if(FAILED(hr))
  goto Exit;
 
// Update the USB version if required.
if (sUSB!= sNewUSB)
{
  hr = piQualifier->put_USB (sNewUSB);
  if(FAILED(hr))
    goto Exit;
}
Exit:
return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBDeviceQualifier

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010