This can be used for input and output. This may only be called when the pipe is {@link #isOpen() open}. The implementation must support multiple (queued) submissions. There is no maximum size restriction; the implementation will segment the buffer into multiple transactions if required. There may be a minimum size, but it will not be more than the {@link javax.usb.UsbEndpointDescriptor#wMaxPacketSize() maximum packet size}.
This will block until either all data is transferred or an error occurrs. Short packets indicate either the end of data or an error.
The return value will indicate the number of bytes sucessfully transferred to or from the target endpoint (depending on direction). The return value will never exceed the total size of the provided buffer. If the operation was not sucessful the UsbException will accurately reflect the cause of the error.
Short packets are accepted. There is no way to disable short packet acceptance using this method. See the USB 1.1 specification sec 5.3.2 for details on short packets and short packet detection. @param data The buffer to use. @return The number of bytes actually transferred. @exception UsbException If an error occurs. @exception UsbNotActiveException If the pipe is not {@link #isActive() active}. @exception UsbNotOpenException If the pipe is not {@link #isOpen() open}. @exception IllegalArgumentException If the data is null. @exception UsbDisconnectedException If this pipe (device) has been disconnected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|