30.11.2012 Views

USBIO Driver for Windows CE - Thesycon Systemsoftware ...

USBIO Driver for Windows CE - Thesycon Systemsoftware ...

USBIO Driver for Windows CE - Thesycon Systemsoftware ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3 Programming Interface<br />

CUsbIo::GetDescriptor<br />

Get a descriptor from the device.<br />

Definition<br />

DWORD<br />

GetDescriptor(<br />

void* Buffer,<br />

DWORD& ByteCount,<br />

<strong>USBIO</strong>_REQUEST_RECIPIENT Recipient,<br />

UCHAR DescriptorType,<br />

UCHAR DescriptorIndex = 0,<br />

USHORT LanguageId = 0<br />

);<br />

Parameters<br />

Buffer<br />

Pointer to a caller-provided buffer. The buffer receives the requested descriptor.<br />

ByteCount<br />

When the function is called ByteCount specifies the size, in bytes, of the buffer pointed to<br />

by Buffer. After the function successfully returned ByteCount contains the number of<br />

valid bytes returned in the buffer.<br />

Recipient<br />

Specifies the recipient of the request. Possible values are enumerated by<br />

<strong>USBIO</strong>_REQUEST_RECIPIENT.<br />

DescriptorType<br />

The type of the descriptor to request. Values are defined by the USB specification, chapter 9.<br />

DescriptorIndex<br />

The index of the descriptor to request. Set to zero if an index is not used <strong>for</strong> the descriptor<br />

type, e.g. <strong>for</strong> a device descriptor.<br />

LanguageId<br />

The language ID of the descriptor to request. Used <strong>for</strong> string descriptors only. Set to zero if<br />

not used.<br />

Return Value<br />

The function returns 0 if successful, an <strong>USBIO</strong> error code otherwise.<br />

Comments<br />

If the size of the provided buffer is less than the total size of the requested descriptor then only<br />

the specified number of bytes from the beginning of the descriptor is returned.<br />

44 <strong>USBIO</strong> <strong>Driver</strong> <strong>for</strong> <strong>Windows</strong> <strong>CE</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!