Share via


Device Property

The Device property gets or sets the device release number, which is the value of the bcdDevice field of the device descriptor as defined in section 9.6.1 of the USB 2.0 specification.

This property is read/write.

Syntax

HRESULT put_Device(
  [in]           SHORT sDeviceNumber
);

HRESULT get_Device(
  [out, retval]  SHORT *psDeviceNumber
);

Property Value

The new device version.

Error Codes

Device returns S_OK if the operation succeeds or E_POINTER if the psDeviceNumber parameter is not a valid pointer.

Remarks

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

HRESULT CLoopBackDevice::SetDeviceVersion(ISoftUSBDevice *piDevice)
{
HRESULT hr = S_OK;
SHORT         sCurrentDeviceVersion= 0;
SHORT         sDeviceVersion = 0x0100; //Binary decimal coded version 1.0 

 if (NULL == piDevice)
{
 hr = E_POINTER;
 goto Exit;
}

 hr = piDevice->get_Device(&sCurrentDeviceVersion);
 if(FAILED(hr))
 goto Exit;

 if (sCurrentDeviceVersion != sDeviceVersion)
{
 hr = piDevice->put_Device(sDeviceVersion);
 if(FAILED(hr))
 goto Exit;
}
Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBDevice

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010