Share via


IssueBulkTransfer (Windows Embedded CE 6.0)

1/6/2010

This function initiates a bulk transfer to a universal serial bus (USB) device on the specified endpoint.

Syntax

DWORD IssueBulkTransfer(
  LPCUSB_FUNCS UsbFuncs, 
  USB_PIPE hPipe,
  LPTRANSFER_NOTIFY_ROUTINE NotifyRoutine,
  PVOID NotifyContext,
  DWORD Flags,
  LPVOID pBuffer,
  ULONG PhysAddr,
  DWORD BufferLength,
  LPDWORD pBytesTransferred,
  DWORD dwTimeout, 
  PUSB_ERROR pUsbRc
);

Parameters

  • pUsbFuncs
    [in] Pointer to a USB_FUNCS structure.
  • hPipe
    [in] Handle to an open USB pipe.
  • NotifyRoutine
    [in] Pointer to a transfer completion function of type LPTRANSFER_NOTIFY_ROUTINE, or NULL if no callback function is necessary.
  • NotifyContext
    [in] Pointer to the parameter to pass to the transfer completion routine.
  • Flags
    [in] USB_XXX flags for the transfer. Usbtypes.h declares these values.
  • pBuffer
    [in] Pointer to the transfer buffer. If a physical buffer address, PhysAddr, is specified. This parameter must contain the virtual address of the buffer.
  • PhysAddr
    [in] Physical address of pBuffer, which might be NULL.
  • BufferLength
    [in] Length of transfer buffer in bytes.
  • pBytesTransferred
    [out] Number of bytes transferred by the USB host to the USB host client device.
  • dwTimeout
    [in] Timeout in milliseconds.
  • pUsbRc
    [out] USB_ERROR or USB_TRANSFER.

Return Value

Microsoft® Win32® error code. For more information, see GetLastError.

Remarks

The caller must determine whether the correct number of bytes were transferred. The caller must also determine any Win32 error codes or USB error codes, and handle any USB errors.

IssueBulkTransfer behaves either synchronously or asynchronously, depending on the value you provide for NotifyRoutine and whether Flags contains the USB_NO_WAIT flag. If NotifyRoutine and NotifyContext are NULL, then the call is made synchronously. If NotifyRoutine and NotifyContext are not NULL, then the call is made asynchronously with some restrictions. The following list shows these restrictions:

  • If dwTimeout is not zero, then IssueBulkTransfer waits for either the NotifyContext, which must be an initialized EVENT, or the timeout duration.
  • If dwTimeout is zero, then IssueBulkTransfer returns immediately.
    The Transfer handle is returned in the pUsbError parameter. It is up to the caller to check transfer status, close the transfer handle, and so on.

When behaving asynchronously, this function invokes the callback function optionally specified by NotifyRoutine when the transfer is complete.

To maximize speed, USB host client drivers should fill pBuffer and use asynchronous mode.

Requirements

Header usbclient.h
Windows Embedded CE Windows CE 2.10 and later

See Also

Reference

USB Host Client Driver Functions
AbortTransfer
GetTransferStatus
LPIS_TRANSFER_COMPLETE
LPTRANSFER_NOTIFY_ROUTINE
USB_FUNCS