Share via


Address Property

The Address property gets a device's address that the host assigns to the device.

This property is read-only.

Syntax

HRESULT get_Address(
  [out, retval]  BYTE *pbAddress
);

Property Value

Caller-allocated space to hold the current device address.

Error Codes

Address returns S_OK if the operation succeeds or E_POINTER if the pbAddress parameter is not a valid pointer.

Remarks

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

HRESULT CLoopBackDevice::GetDeviceIsAddressed(BOOL *fIsAddressed)
{
HRESULT hr = S_OK;
BYTE bAddress = USB_UnConnected_Device_Address;

 if (NULL == m_piSoftUSBDevice)
{
 hr = E_UNEXPECTED;
 goto Exit;
}

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

 hr = m_piSoftUSBDevice->get_Address(&bAddress);
 if(FAILED(hr))
 goto Exit;

 if(USB_UnConnected_Device_Address = bAddress)
{
  *fIsAddressed = FALSE;
}
 else
{
  *fIsAddressed = TRUE;
}
Exit:
 return hr;
 

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBDevice

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010