Attributes Property
The Attributes property gets or sets the bmAttributes 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_Attributes(
[in] BYTE bAttributes
);
HRESULT get_Attributes(
[out, retval] BYTE *pbAttributes
);
Property Value
The new attribute to set in the endpoint.
Error Codes
Attributes returns S_OK if the operation succeeds or E_POINTER if the pbAttributes parameter is not a valid pointer.
Remarks
The following C++ code example shows how to set and get the Attributes property.
HRESULT CLoopBackDevice::UpdateEndpointAttributes(ISoftUSBEndpoint *piEndpoint)
{
HRESULT hr = S_OK;
BYTE bAttributes = 0;
if(NULL == piEndpoint)
{
hr = E_INVALIDARG;
goto Exit;
}
/ Get the current attributes
hr = piEndpoint->get_Attributes(&bAttributes);
if(FAILED(hr))
goto Exit;
// Update the attributes if required
if (0x02 != bAttributes)
{
// Set the endpoint to a BULK endpoint
bAttributes = 0x02;
hr = piEndpoint->put_Attributes(bAttributes);
if(FAILED(hr))
goto Exit;
}
Exit:
return hr;
}
Requirements
Header |
SoftUSBif.h |
See Also
Send comments about this topic to Microsoft
Build date: 9/21/2010