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
TRANSFER_COMPLETION_ROUTINE
Go to RapidDriver Main Page


Language

Description

C/C++
typedef void (__stdcall *PTRANSFER_COMPLETION_ROUTINE)(
ULONG dwErrorCode,  
ULONG dwNumberOfBytesTransfered);  

Delphi
TTRANSFER_COMPLETION_ROUTINE = procedure (ErrorCode : Longint;
                                          NumberOfBytesTransfered : Longint); stdcall;

VB
Sub CompletionRoutine(ByVal ErrorCode As Long, ByVal NumberOfBytesTransfered As Long)


Parameters
 
dwErrorCode  
If transfer was successful error code is zero.  
 
dwNumberOfBytesTransfered  
Number of bytes that were transferred during operation.  
 

Description
 
This function is callback that is used with UsbTransferAsync function. It is called when the asynchronous input and output (I/O) operation is completed or canceled.

Note

In Visual Basic use AddressOf operator to handle callback to UsbTransferAsync.