Language
|
Description
|
C/C++
|
BOOL UsbGetInterfaceDescriptor(IN USB_DEVICE_HANDLE hUsb,
| OUT PUSB_INTERFACE_DESCRIPTOR* pIntDescr);
|
|
Delphi
|
function UsbGetInterfaceDescriptor(hUsb : USB_DEVICE_HANDLE;
Index : UCHAR;
AltIndex : UCHAR;
var pIntDescr : PUSB_INTERFACE_DESCRIPTOR) : BOOL; stdcall;
|
VB
|
Function UsbGetInterfaceDescriptor (ByVal hUsb As Long, _
ByVal MainIndex As Byte, _
ByVal AlternateIndex As Byte, _
ByRef pDesc As Long) As Boolean
|
Parameters
| Specifies handle to USB device.
|
| Number of alternate setting.
|
| Pointer to retrieved interface descriptor.
|
Return Value
| If function fails it return FALSE. To detect error call GetLastError function.
|
Description
| Use this function to retrieve interface descriptor. This function can be used only after getting valid handle from OpenRapidUsb function. Do not forget to free descriptor after use with UsbFreeInterfaceDescriptor.
|
Example
// open first RapidUSB device
USB_HANDLE hUsb = OpenRapidUsb(0);
PUSB_INTERFACE_DESCRIPTOR pIntDesc;
UsbGetInterfaceDescriptor(hUsb, 0, 0, pIntDesc);
if (pIntDesc != NULL)
{
// interface retrieved successfully
// Free descriptor when it is not needed
UsbFreeInterfaceDescriptor(pIntDesc);
}
else
{
// Error! Check if hUsb is valid
}
CloseRapidUsb(hUsb);
|