public class UsbIrpImp extends DefaultUsbIrp implements UsbIrp
If the user provided their own UsbIrp implementation, then the UsbPipeImp will 'wrap' their
implementation with this UsbIrpImp by setting the local
UsbIrp. If this has a local UsbIrp when it is
complete, this will set the proper fields on the wrapped UsbIrp.
| Modifier and Type | Class and Description |
|---|---|
static interface |
UsbIrpImp.UsbIrpImpListener |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
createShortPacketException |
protected UsbIrp |
usbIrp |
protected UsbIrpImp.UsbIrpImpListener |
usbIrpImpListener |
acceptShortPacket, actualLength, complete, data, length, offset, usbException| Constructor and Description |
|---|
UsbIrpImp()
Constructor.
|
UsbIrpImp(UsbIrp irp)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkShortPacketException()
If createShortPacketException is true, this will check for a short packet condition.
|
static void |
checkUsbIrp(UsbIrp irp)
Check the specified UsbIrp.
|
void |
complete()
Complete this submission.
|
protected void |
completeUsbIrp()
If there is a wrapped UsbIrp, set its fields and complete it.
|
UsbIrp |
getUsbIrp()
Get the UsbIrp this is wrapping.
|
UsbIrpImp.UsbIrpImpListener |
getUsbIrpImpListener()
Get the UsbIrpImpListener.
|
boolean |
hasUsbIrp()
If this UsbIrpImp has a wrapped UsbIrp.
|
void |
setCreateShortPacketException(boolean setting)
This should be set by the UsbPipeImp or UsbDeviceImp if this UsbIrpImp should check/set ShortPacketExceptions.
|
void |
setUsbIrp(UsbIrp irp)
Set the UsbIrp to wrap.
|
void |
setUsbIrpImpListener(UsbIrpImp.UsbIrpImpListener listener)
Set the UsbIrpImpListener.
|
getAcceptShortPacket, getActualLength, getData, getLength, getOffset, getUsbException, isComplete, isUsbException, setAcceptShortPacket, setActualLength, setComplete, setData, setData, setLength, setOffset, setUsbException, waitUntilComplete, waitUntilCompleteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAcceptShortPacket, getActualLength, getData, getLength, getOffset, getUsbException, isComplete, isUsbException, setAcceptShortPacket, setActualLength, setComplete, setData, setData, setLength, setOffset, setUsbException, waitUntilComplete, waitUntilCompleteprotected UsbIrp usbIrp
protected UsbIrpImp.UsbIrpImpListener usbIrpImpListener
protected boolean createShortPacketException
public UsbIrpImp()
public UsbIrpImp(UsbIrp irp)
irp - The UsbIrp this should wrap.public void complete()
The order of events must be as follows:
complete in interface UsbIrpcomplete in class DefaultUsbIrpprotected void completeUsbIrp()
public void setUsbIrp(UsbIrp irp)
irp - The UsbIrp.public boolean hasUsbIrp()
public UsbIrp getUsbIrp()
public void setUsbIrpImpListener(UsbIrpImp.UsbIrpImpListener listener)
If there is already a Listener, this will clobber it!
public UsbIrpImp.UsbIrpImpListener getUsbIrpImpListener()
public static void checkUsbIrp(UsbIrp irp) throws IllegalArgumentException, UsbException
This may be used to check the validity of an UsbIrp. This will throw an IllegalArgumentException if the UsbIrp does not behave as specified in the UsbIrp interface documentation. This will throw an UsbException if the UsbIrp is in a state not ready for submission, such as being complete or having a UsbException.
IllegalArgumentException - If the UsbIrp is not valid.UsbException - If the UsbIrp is not ready for submission.protected void checkShortPacketException()
If there is a short packet condition but no exception is set, this will create and set one.
public void setCreateShortPacketException(boolean setting)
If this is set to true, the checkShortPacketException method
will create and set a UsbShortPacketException during {#link #complete() complete}, if appropriate.
setting - The setting.Copyright © 2014 LSST. All Rights Reserved.