EndpointAddress Property

The EndpointAddress property gets or sets the bEndpointAddress field of the endpoint descriptor, as described in section 9.6.6 of the USB 2.0 specification.

This property is read/write.

Syntax

HRESULT put_EndpointAddress(
  [in]           BYTE bAddress
);

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

Property Value

The new value for the endpoint address.

Error Codes

EndpointAddress 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 to set and get the EndpointAddress property.

HRESULT CLoopBackDevice::UpdateEndpointAddress(ISoftUSBEndpoint *piEndpoint)
{
HRESULT hr = S_OK;
BYTE         bAddress = 0;
BYTE         bNewAddress = 0x81; // Out endpoint 1

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

// Get the current endpoint address
 hr = piEndpoint ->get_EndpointAddress(&bAddress);
 if (FAILED(hr))
 goto Exit;
 
// Update the address if required
 if( bNewAddress != bAddress)
{
 hr = put_EndpointAddress(bNewAddress);
 if(FAILED(hr))
 goto Exit;
}

Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBEndpoint

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010