HIDGetDescriptor

Syntax

#include <cafe/hid.h>

HID_ERROR_CODE  HIDGetDescriptor(
                                    u32         handle,
                                    u8          descriptor_type,
                                    u8          descriptor_index,
                                    u16         language_id,
                                    u8          *p_buffer,
                                    u32         buffer_length,
                                    HIDCallback async_callback,
                                    void        *p_user
                                    );

Parameters

handle Handle associated with the HID device.
descriptor_type Descriptor type as defined by the USB/HID specification.
descriptor_index Descriptor index as defined by the USB/HID specification.
language_id Language ID as defined by the USB/HID specification.
p_buffer Pointer to buffer to receive transaction data. This buffer must be aligned and padded to L2_CACHE_LINE_SIZE.
buffer_length Size of the buffer to receive transaction data in bytes.
async_callback Pointer to HIDCallback for asynchronous completion notification.
p_user User-specified pointer passed to HIDCallback.

Return Values

HIDGetDescriptor returns HID_ERROR_CODE. For blocking calls, a return value of ≥ 0 specifies the number of bytes transferred for the request. For asynchronous calls, a return value of HID_ERROR_OK specifies that the call was initiated successfully and the result of the transaction will be specified in the HIDCallback parameters upon completion.

Description

HIDGetDescriptor performs a USB/HID get descriptor transaction to an HID interface associated with an HIDDevice.handle. HIDGetDescriptor executes in a blocking manner when no HIDCallback is specified.

Do Not Call From

Background Do not call this function from the background.

See Also

HID_ERROR_CODE
HIDCallback
HIDSetDescriptor

Revision History

2013/05/08 Automated cleanup pass.
2011/09/29 Initial version.


CONFIDENTIAL