Language
|
Description
|
C/C++
|
BOOL UsbTransfer(IN USB_PIPE_HANDLE hPipe,
| IN DWORD nNumberOfBytesToTransfer,
|
| OUT LPDWORD pNumberOfBytesTransfered);
|
|
Delphi
|
function UsbWrite(hPipe : USB_PIPE_HANDLE;
const Buffer : LPVOID;
nNumberOfBytesToTransfer : DWORD;
var lpNumberOfBytesTransfered : DWORD) : BOOL; stdcall;
function UsbRead(hPipe : USB_PIPE_HANDLE;
var Buffer;
nNumberOfBytesToTransfer : DWORD;
var lpNumberOfBytesTransfered : DWORD) : BOOL; stdcall;
|
VB
|
Function UsbTransfer (ByVal hPipe As Long, _
ByRef Buffer As Any, _
ByVal NumberOfBytesToTransfer As Long, _
ByRef NumberOfBytesTransferred As Long) As Boolean
|
Parameters
| Pipe handle. This handle can be obtained with UsbPipeOpen.
|
| Pointer to a resident buffer for the transfer. The contents of this buffer depend on pipe direction. If pipe direction is IN (from device to host) this buffer will contain data read from the device. Otherwise, this buffer contains user-supplied data for transfer to the device.
|
| Specifies the length, in bytes, of the buffer specified in lpBuffer.
|
| Function returns the number of bytes sent to or read from the pipe in this parameter.
|
Return Value
| If function fails it return FALSE. To detect error call GetLastError function.
|
Description
| Use this function to transfer data to/from USB device pipe. Function performs transfer with bulk, interrupt and isochronous pipes. Transfer is made in blocking mode. Thread calling this function is blocked until transfer completes.
|
|