UsbQueryDeviceReport
Appearance
Obtains the Compound Descriptor of a specific USB device.
Syntax
For access by Device Handle use:
ulrc = UsbQueryDeviceReport(Handle,pulBufLen,pucData)
For access by Device Number:
ulrc = UsbQueryDeviceReport(ulDevNumber,pulBufLen,pucData)
Parameters
- Handle
- the Device Handle received from the previous UsbOpen.
- ulDevNumber
- the Device Number from 1 up to the Total Number from UsbQueryNumberDevices.
- pulBufLen
- the address of the variable to specify/receive the number of bytes.
- pucData
- the address of the buffer to receive the Compound Descriptor.
Return Code
0x0000 - NO_ERROR
- Errors
0x0057 - ERROR_INVALID_PARAMETER 0x1B58 - USB_NOT_INIT 0xFF13 - ERROR_I24_INVALID_PARAMETER 0xFF1F - ERROR_GEN_FAILURE 0xFF37 - ERROR_DEV_NOT_EXIST 0xFF57 - ERROR_INVALID_PARAMETER 0xFF6F - ERROR_BUFFER_OVERFLOW 0xFFEA - ERROR_MORE_DATA
Remarks
The Compound Descriptor is the concatenation of Device Descriptor and Configuration Descriptor.
Example Code
//Code Snippet - UsbQueryDeviceReport
{
APIRET ulrc;
PUCHAR pucReport;
PULONG pulBufLen;
UCHAR ucReport[4096];
ULONG ulBufLen = sizeof(ucReport);
ULONG ulDevNumber = ulNumDev;
pucReport = &ucReport[0];
pulBufLen = &ulBufLen;
ulrc = UsbQueryDeviceReport(ulDevNumber,pulBufLen,pucReport);
printf("\nUsbQueryDeviceReport - ulrc: 0x%04X (%hu)",ulrc,ulrc);
if (!ulrc) //success
{
int i; printf(" - DeviceReport:\n");
for (i=0;i<ulBufLen;i++) printf("%02X",ucReport[i]);
}
}