See the USB 1.1 specification sec 5.3.2 for details on USB pipes.
Data flows in the
direction
defined by the associated endpoint, except for Control
type pipes.
The implementation is not required to be Thread-safe. If a Thread-safe UsbPipe is
required, use a synchronizedUsbPipe.
This pipe's configuration and interface setting must be active to use this pipe. Any attempt to use a UsbPipe belonging to an inactive configuration or interface setting will throw a UsbNotActiveException.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public UsbIrp | Returns: A UsbIrp representing the submission.The buffer to use. data)Asynchonously submit a byte[] to the UsbPipe. |
| public void | asyncSubmit(UsbIrp
The UsbIrp to use for the submission. irp)Asynchonously submit a UsbIrp to the UsbPipe. |
| public void | |
| public void | |
| public UsbControlIrp | Returns: A UsbControlIrp ready for use.The bmRequestType. bmRequestType, byte The bRequest. bRequest, short The wValue. wValue, short The wIndex. wIndex)Create a UsbControlIrp. |
| public UsbIrp | |
| public UsbEndpoint | |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| public int | Returns: The number of bytes actually transferred.The buffer to use. data)Synchonously submit a byte[] to the UsbPipe. |
| public void | syncSubmit(UsbIrp
A UsbIrp to use for the submission. irp)Synchonously submit a UsbIrp to the UsbPipe. |
| public void |
| abortAllSubmissions | back to summary |
|---|---|
| public void abortAllSubmissions() throws UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException Stop all submissions in progress. This will abort all submission in progress on the pipe, and block until all submissions are complete. There will be no submissions pending after this returns.
| |
| addUsbPipeListener | back to summary |
|---|---|
| public void addUsbPipeListener(UsbPipeListener listener) Adds the listener.
| |
| asyncSubmit | back to summary |
|---|---|
| public UsbIrp asyncSubmit(byte[] data) throws UsbException, UsbNotActiveException, UsbNotOpenException, IllegalArgumentException, UsbDisconnectedException Asynchonously submit a byte[] to the UsbPipe.
This can be used for input and output.
This may only be called when the pipe is The implementation should only place this on a queue, or perform whatever minimal processing is required, and then return. This method will not block until the submission is complete. The returned UsbIrp will represent the submission. 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.
| |
| asyncSubmit | back to summary |
|---|---|
| public void asyncSubmit(UsbIrp irp) throws UsbException, UsbNotActiveException, UsbNotOpenException, IllegalArgumentException, UsbDisconnectedException Asynchonously submit a UsbIrp to the UsbPipe.
This can be used for input and output.
This may only be called when the pipe is The implementation should only place this on a queue, or perform whatever minimal processing is required, and then return. This method will not block until the submission is complete.
If this is a Control
| |
| asyncSubmit | back to summary |
|---|---|
| public void asyncSubmit(List<E> list) throws UsbException, UsbNotActiveException, UsbNotOpenException, IllegalArgumentException, UsbDisconnectedException Asynchonously submit a List of UsbIrps to the UsbPipe.
This is exactly the same as calling
If this is a Control
| |
| close | back to summary |
|---|---|
| public void close() throws UsbException, UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException Close this UsbPipe.
The pipe can only be closed while no submissions are pending.
All submissions can be aborted by If the pipe is already closed, this fails.
| |
| createUsbControlIrp | back to summary |
|---|---|
| public UsbControlIrp createUsbControlIrp(byte bmRequestType, byte bRequest, short wValue, short wIndex) Create a UsbControlIrp.
This creates a UsbControlIrp that may be optimized for use on
this UsbPipe. Using this UsbControlIrp instead of a
The UsbPipe cannot require this UsbControlIrp to be used, all submit methods must accept any UsbControlIrp implementation. Note that if this is not a Control-type UsbPipe, none of the setup packet fields will be used.
| |
| createUsbIrp | back to summary |
|---|---|
| public UsbIrp createUsbIrp() Create a UsbIrp.
This creates a UsbIrp that may be optimized for use on
this UsbPipe. Using this UsbIrp instead of a
The UsbPipe cannot require this UsbIrp to be used, all submit methods must accept any UsbIrp implementation (or UsbControlIrp implementation if this is a Control-type UsbPipe).
| |
| getUsbEndpoint | back to summary |
|---|---|
| public UsbEndpoint getUsbEndpoint() Get this pipe's UsbEndpoint.
| |
| isActive | back to summary |
|---|---|
| public boolean isActive() If this pipe is active.
This pipe is active only if it belongs to an
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() If this pipe is open.
This is true after a sucessful
If this pipe is not
| |
| open | back to summary |
|---|---|
| public void open() throws UsbException, UsbNotActiveException, UsbNotClaimedException, UsbDisconnectedException Open this UsbPipe. The pipe cannot be used for communication until it is open. The implementation should, to whatever extent the platform allows, try to ensure the pipe is usable (not in error) before returning successfully. If the pipe has already been opened, this will not succeed.
| |
| removeUsbPipeListener | back to summary |
|---|---|
| public void removeUsbPipeListener(UsbPipeListener listener) Removes the listener.
| |
| syncSubmit | back to summary |
|---|---|
| public int syncSubmit(byte[] data) throws UsbException, UsbNotActiveException, UsbNotOpenException, IllegalArgumentException, UsbDisconnectedException Synchonously submit a byte[] to the UsbPipe.
This can be used for input and output.
This may only be called when the pipe is 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.
| |
| syncSubmit | back to summary |
|---|---|
| public void syncSubmit(UsbIrp irp) throws UsbException, UsbNotActiveException, UsbNotOpenException, IllegalArgumentException, UsbDisconnectedException Synchonously submit a UsbIrp to the UsbPipe.
This can be used for input and output.
This may only be called when the pipe is This will block until either all data is transferred or an error occurrs. Short packets indicate either the end of data or an error.
If this is a Control
| |
| syncSubmit | back to summary |
|---|---|
| public void syncSubmit(List<E> list) throws UsbException, UsbNotActiveException, UsbNotOpenException, IllegalArgumentException, UsbDisconnectedException Synchonously submit a List of UsbIrps to the UsbPipe.
This is exactly the same as calling
If this is a Control
| |