Top Description Fields Constructors Methods
javax.usb.util

public Class DefaultUsbIrp

extends Object
implements UsbIrp
Class Inheritance
All Implemented Interfaces
javax.usb.UsbIrp
Known Direct Subclasses
javax.usb.util.DefaultUsbControlIrp
Imports
java.util.*, javax.usb.*

UsbIrp default implementation.

The behavior and defaults follow those defined in the interface. Any of the fields may be updated if the default is not appropriate; in most cases the data will be the only field that needs to be set.

Author
Dan Streetman

Field Summary

Modifier and TypeField and Description
protected boolean
protected int
protected boolean
protected byte[]
protected int
protected int
protected UsbException
private Object

Constructor Summary

AccessConstructor and Description
public
DefaultUsbIrp()

Constructor.

public
DefaultUsbIrp(byte[]
The data.
data
)

Constructor.

public
DefaultUsbIrp(byte[]
The data.
data
,
int
The offset.
offset
,
int
The length.
length
,
boolean
The Short Packet policy.
shortPacket
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
complete()

Implements javax.usb.UsbIrp.complete.

Complete this submission.
public boolean

Returns:

The Short Packet policy.
getAcceptShortPacket
()

Implements javax.usb.UsbIrp.getAcceptShortPacket.

Get the Short Packet policy.
public int

Returns:

The actual length.
getActualLength
()

Implements javax.usb.UsbIrp.getActualLength.

Get the actual length.
public byte[]

Returns:

The data.
getData
()

Implements javax.usb.UsbIrp.getData.

Get the data.
public int

Returns:

The length.
getLength
()

Implements javax.usb.UsbIrp.getLength.

Get the length.
public int

Returns:

The offset.
getOffset
()

Implements javax.usb.UsbIrp.getOffset.

Get the offset.
public UsbException

Returns:

The UsbException, or null.
getUsbException
()

Implements javax.usb.UsbIrp.getUsbException.

Get the UsbException.
public boolean

Returns:

If this is complete.
isComplete
()

Implements javax.usb.UsbIrp.isComplete.

If this is complete.
public boolean

Returns:

If a UsbException occurred.
isUsbException
()

Implements javax.usb.UsbIrp.isUsbException.

If a UsbException occurred.
public void
setAcceptShortPacket(boolean
The Short Packet policy.
accept
)

Implements javax.usb.UsbIrp.setAcceptShortPacket.

Set the Short Packet policy.
public void
setActualLength(int
The actual length.
l
)

Implements javax.usb.UsbIrp.setActualLength.

Set the actual length.
public void
setComplete(boolean
If this is complete (or not).
b
)

Implements javax.usb.UsbIrp.setComplete.

Set this as complete (or not).
public void
setData(byte[]
The data.
d
,
int
The offset.
o
,
int
The length.
l
)

Implements javax.usb.UsbIrp.setData.

Set the data, offset, and length.
public void
setData(byte[]
The data.
d
)

Implements javax.usb.UsbIrp.setData.

Set the data.
public void
setLength(int
The length.
l
)

Implements javax.usb.UsbIrp.setLength.

Set the length.
public void
setOffset(int
The offset.
o
)

Implements javax.usb.UsbIrp.setOffset.

Set the offset.
public void
setUsbException(UsbException
The UsbException.
exception
)

Implements javax.usb.UsbIrp.setUsbException.

Set the UsbException.
public void
public void
waitUntilComplete(long
The maximum number of milliseconds to wait.
timeout
)

Implements javax.usb.UsbIrp.waitUntilComplete.

Wait until complete, or the timeout has expired.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

acceptShortPacketback to summary
protected boolean acceptShortPacket
actualLengthback to summary
protected int actualLength
completeback to summary
protected boolean complete
databack to summary
protected byte[] data
lengthback to summary
protected int length
offsetback to summary
protected int offset
usbExceptionback to summary
protected UsbException usbException
waitLockback to summary
private Object waitLock

Constructor Detail

DefaultUsbIrpback to summary
public DefaultUsbIrp()

Constructor.

DefaultUsbIrpback to summary
public DefaultUsbIrp(byte[] data)

Constructor.

Parameters
data:byte[]

The data.

Exceptions
IllegalArgumentException:
If the data is null.
DefaultUsbIrpback to summary
public DefaultUsbIrp(byte[] data, int offset, int length, boolean shortPacket)

Constructor.

Parameters
data:byte[]

The data.

offset:int

The offset.

length:int

The length.

shortPacket:boolean

The Short Packet policy.

Exceptions
IllegalArgumentException:
If the data is null, or the offset and/or length is negative.

Method Detail

completeback to summary
public void complete()

Implements javax.usb.UsbIrp.complete.

Complete this submission.

This will:

getAcceptShortPacketback to summary
public boolean getAcceptShortPacket()

Implements javax.usb.UsbIrp.getAcceptShortPacket.

Get the Short Packet policy.

Returns:boolean

The Short Packet policy.

getActualLengthback to summary
public int getActualLength()

Implements javax.usb.UsbIrp.getActualLength.

Get the actual length.

Returns:int

The actual length.

getDataback to summary
public byte[] getData()

Implements javax.usb.UsbIrp.getData.

Get the data.

Returns:byte[]

The data.

getLengthback to summary
public int getLength()

Implements javax.usb.UsbIrp.getLength.

Get the length.

Returns:int

The length.

getOffsetback to summary
public int getOffset()

Implements javax.usb.UsbIrp.getOffset.

Get the offset.

Returns:int

The offset.

getUsbExceptionback to summary
public UsbException getUsbException()

Implements javax.usb.UsbIrp.getUsbException.

Get the UsbException.

Returns:UsbException

The UsbException, or null.

isCompleteback to summary
public boolean isComplete()

Implements javax.usb.UsbIrp.isComplete.

If this is complete.

Returns:boolean

If this is complete.

isUsbExceptionback to summary
public boolean isUsbException()

Implements javax.usb.UsbIrp.isUsbException.

If a UsbException occurred.

Returns:boolean

If a UsbException occurred.

setAcceptShortPacketback to summary
public void setAcceptShortPacket(boolean accept)

Implements javax.usb.UsbIrp.setAcceptShortPacket.

Set the Short Packet policy.

Parameters
accept:boolean

The Short Packet policy.

setActualLengthback to summary
public void setActualLength(int l) throws IllegalArgumentException

Implements javax.usb.UsbIrp.setActualLength.

Set the actual length.

Parameters
l:int

The actual length.

Exceptions
IllegalArgumentException:
If the length is negative.
setCompleteback to summary
public void setComplete(boolean b)

Implements javax.usb.UsbIrp.setComplete.

Set this as complete (or not).

Parameters
b:boolean

If this is complete (or not).

setDataback to summary
public void setData(byte[] d, int o, int l) throws IllegalArgumentException

Implements javax.usb.UsbIrp.setData.

Set the data, offset, and length.

Parameters
d:byte[]

The data.

o:int

The offset.

l:int

The length.

Exceptions
IllegalArgumentException:
If the data is null, or the offset and/or length is negative.
setDataback to summary
public void setData(byte[] d) throws IllegalArgumentException

Implements javax.usb.UsbIrp.setData.

Set the data.

Parameters
d:byte[]

The data.

Exceptions
IllegalArgumentException:
If the data is null.
setLengthback to summary
public void setLength(int l) throws IllegalArgumentException

Implements javax.usb.UsbIrp.setLength.

Set the length.

Parameters
l:int

The length.

Exceptions
IllegalArgumentException:
If the length is negative.
setOffsetback to summary
public void setOffset(int o) throws IllegalArgumentException

Implements javax.usb.UsbIrp.setOffset.

Set the offset.

Parameters
o:int

The offset.

Exceptions
IllegalArgumentException:
If the offset is negative.
setUsbExceptionback to summary
public void setUsbException(UsbException exception)

Implements javax.usb.UsbIrp.setUsbException.

Set the UsbException.

Parameters
exception:UsbException

The UsbException.

waitUntilCompleteback to summary
public void waitUntilComplete()

Implements javax.usb.UsbIrp.waitUntilComplete.

Wait until complete.

This will block until this is complete.

waitUntilCompleteback to summary
public void waitUntilComplete(long timeout)

Implements javax.usb.UsbIrp.waitUntilComplete.

Wait until complete, or the timeout has expired.

This will block until this is complete, or the timeout has expired. If the timeout is 0 or less, this behaves as the no-timeout method.

Parameters
timeout:long

The maximum number of milliseconds to wait.