USBDev_PipeWrExt

Description

Write data to device over the specified pipe.

Files

usbdev_api.cs

Prototype

DWORD  USBDev_PipeWrExt (HANDLE   pipe,
                         UCHAR   *p_buf,
                         DWORD    buf_len,
                         BOOL     end,
                         DWORD    timeout,
                         DWORD   *p_err);


Arguments

pipe

Pipe handle.

p_buf

Pointer to transmit buffer.

buf_len

Transmit buffer length.

end

End-of-transfer flag (see Note #1).

timeout

Timeout in milliseconds. A value of 0 indicates a wait forever.

p_err

Pointer to variable that will receive the return error code from this function:

ERROR_SUCCESS
ERROR_INVALID_HANDLE
ERROR_INVALID_USER_BUFFER
ERROR_BAD_PIPE
ERROR_INVALID_PARAMETER
ERROR_NOT_ENOUGH_MEMORY
ERROR_SEM_TIMEOUT

Returned Value

Number of bytes written, if NO error(s).

0, otherwise.

Callers

Application.

Notes / Warnings

If end-of-transfer is set and transfer length is multiple of maximum packet size, a zero-length packet is transferred to indicate a short transfer to the device.