Language
|
Description
|
C/C++
|
BOOL UsbGetDeviceDescriptor(IN USB_DEVICE_HANDLE hUsb,
| OUT PUSB_DEVICE_DESCRIPTOR pDevDescr);
|
|
Delphi
|
function UsbGetDeviceDescriptor(hUsb : USB_DEVICE_HANDLE;
var DevDescr : USB_DEVICE_DESCRIPTOR) : BOOL; stdcall;
|
VB
|
Function UsbGetDeviceDescriptor (ByVal hUsb As Long, _
ByRef DevDescr As USB_DEVICE_DESCRIPTOR) As Boolean
|
Parameters
| Specifies handle to USB device.
|
| Pointer to device descriptor.
|
Return Value
| If function fails it return FALSE. To detect error call GetLastError function.
|
Description
| Use this function to retrieve device descriptor. This function can be used only after getting valid handle from OpenRapidUsb function.
|
Example
if (UsbEnumerateDevices())
{
// open first RapidUSB device
USB_HANDLE hUsb = OpenRapidUsb(0);
USB_DEVICE_DESCRIPTOR DeviceDescriptor;
if (UsbGetDeviceDescriptor(hUsb, &DeviceDescriptor))
// Descriptor retrieved successfully
else
// Error! Check if hUsb is valid
CloseRapidUsb(hUsb);
}
|