Home    Prev Next    
Contents
Programming For USB Device
Overview
Programmers Guide
Scenario
Data transfer
Synchronous Transfer
Asynchronous Transfer
Reading Descriptors
USB Support Routines And Structures
Common Procedures
UsbEnumerateDevices
OpenRapidUsb
IsRapidUsbOpened
CloseRapidUsb
Descriptors
UsbGetDescriptor
UsbGetDeviceDescriptor
UsbGetStringDescriptor
UsbGetConfigDescriptor
UsbFreeConfigDescriptor
UsbGetInterfaceDescriptor
UsbFreeInterfaceDescriptor
UsbGetEndpointDescriptor
Configure Device
UsbGetDeviceInfo
UsbUnconfigureDevice
UsbSelectConfig
UsbGetConfig
UsbSelectInterface
UsbGetInterface
UsbResetDevice
UsbGetBandwidthInfo
UsbCyclePort
Features and Status
UsbSetFeature
UsbClearFeature
UsbGetStatus
Vendor/Class Requests
UsbVendorRequestIn
UsbVendorRequestOut
UsbClassRequestIn
UsbClassRequestOut
Pipes
IsRapidUsbPipeOpened
UsbPipeOpen
UsbPipeClose
UsbGetPipeCount
UsbPipeGetInfo
UsbPipeDirectionIn
UsbPipeGetType
UsbTransfer
UsbTransferAsync
TRANSFER_COMPLETION_ROUTINE
UsbCancelTransfer
UsbPipeReset
UsbPipeAbort
Other
UsbGetPortStatus
UsbGetCurrentFrameNumber
USB Structures and Types
RDUSB_DEVICE_INFORMATION
RDUSB_PIPE_INFORMATION
RDUSB_PIPE_TYPE
RDUSB_BANDWIDTH_INFORMATION
UsbGetEndpointDescriptor
Go to RapidDriver Main Page


Language

Description

C/C++
BOOL UsbGetEndpointDescriptor(IN USB_DEVICE_HANDLE hUsb,  
IN UCHAR Index,   
IN UCHAR InterfaceIndex,  
IN UCHAR AlternateIndex,   
OUT PUSB_ENDPOINT_DESCRIPTOR pEndDescr);  

Delphi
function UsbGetEndpointDescriptor(hUsb           : USB_DEVICE_HANDLE;
                                  Index          : UCHAR;
                                  InterfaceIndex : UCHAR;
                                  AlternateIndex :UCHAR;
                                  var EndDescr   : USB_ENDPOINT_DESCRIPTOR) : BOOL; stdcall;

VB
Function UsbGetEndpointDescriptor (ByVal hUsb As Long, _
                                   ByVal EndpointIndex As Byte, _
                                   ByVal MainIndex As Byte, _
                                   ByVal AlternateIndex As Byte, _
                                   ByRef pDesc As USB_ENDPOINT_DESCRIPTOR) As Boolean



Parameters
 
hUsb  
Specifies handle to USB device.  
 
Index  
Endpoint descriptor index.  
 
IntefaceIndex  
Index of interface containing endpoint descriptor.  
 
AlternateIndex  
Index of alternate settings.  
 
pEndDescr  
Speicifies pointer to endpoint descriptor.  

Description

Use this function to retrieve endpoint descriptor. This function can be used only after getting valid handle from OpenRapidUsb function.  


Example

   // open first RapidUSB device

   USB_HANDLE hUsb = OpenRapidUsb(0
);

   USB_ENDPOINT_DESCRIPTOR EndDesc;
   
   // getting second endpoint descriptor from first interface

   if (UsbGetEndpointDescriptor(hUsb, 0
0
1
, &EndDesc))
      // Descriptor retrieved successfully

   else
      // Error! Check if hUsb and Index are valid

   CloseRapidUsb(hUsb);