|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.usb.util.DefaultUsbIrp
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
.
Constructor Summary | |
DefaultUsbIrp()
Constructor. |
|
DefaultUsbIrp(byte[] data)
Constructor. |
|
DefaultUsbIrp(byte[] data,
int offset,
int length,
boolean shortPacket)
Constructor. |
Method Summary | |
void |
complete()
Complete this submission. |
boolean |
getAcceptShortPacket()
Get the Short Packet policy. |
int |
getActualLength()
Get the actual length. |
byte[] |
getData()
Get the data. |
int |
getLength()
Get the length. |
int |
getOffset()
Get the offset. |
UsbException |
getUsbException()
Get the UsbException. |
boolean |
isComplete()
If this is complete. |
boolean |
isUsbException()
If a UsbException occurred. |
void |
setAcceptShortPacket(boolean accept)
Set the Short Packet policy. |
void |
setActualLength(int l)
Set the actual length. |
void |
setComplete(boolean b)
Set this as complete (or not). |
void |
setData(byte[] d)
Set the data. |
void |
setData(byte[] d,
int o,
int l)
Set the data, offset, and length. |
void |
setLength(int l)
Set the length. |
void |
setOffset(int o)
Set the offset. |
void |
setUsbException(UsbException exception)
Set the UsbException. |
void |
waitUntilComplete()
Wait until complete .
|
void |
waitUntilComplete(long timeout)
Wait until complete , or the timeout has expired.
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultUsbIrp()
public DefaultUsbIrp(byte[] data)
data
- The data.
java.lang.IllegalArgumentException
- If the data is null.public DefaultUsbIrp(byte[] data, int offset, int length, boolean shortPacket)
data
- The data.offset
- The offset.length
- The length.shortPacket
- The Short Packet policy.
java.lang.IllegalArgumentException
- If the data is null, or the offset and/or length is negative.Method Detail |
public byte[] getData()
getData
in interface UsbIrp
public int getOffset()
getOffset
in interface UsbIrp
public int getLength()
getLength
in interface UsbIrp
public int getActualLength()
getActualLength
in interface UsbIrp
public void setData(byte[] d, int o, int l) throws java.lang.IllegalArgumentException
setData
in interface UsbIrp
d
- The data.o
- The offset.l
- The length.
java.lang.IllegalArgumentException
- If the data is null, or the offset and/or length is negative.public void setData(byte[] d) throws java.lang.IllegalArgumentException
setData
in interface UsbIrp
d
- The data.
java.lang.IllegalArgumentException
- If the data is null.public void setOffset(int o) throws java.lang.IllegalArgumentException
setOffset
in interface UsbIrp
o
- The offset.
java.lang.IllegalArgumentException
- If the offset is negative.public void setLength(int l) throws java.lang.IllegalArgumentException
setLength
in interface UsbIrp
l
- The length.
java.lang.IllegalArgumentException
- If the length is negative.public void setActualLength(int l) throws java.lang.IllegalArgumentException
setActualLength
in interface UsbIrp
l
- The actual length.
java.lang.IllegalArgumentException
- If the length is negative.public boolean isUsbException()
isUsbException
in interface UsbIrp
public UsbException getUsbException()
getUsbException
in interface UsbIrp
public void setUsbException(UsbException exception)
setUsbException
in interface UsbIrp
exception
- The UsbException.public boolean getAcceptShortPacket()
getAcceptShortPacket
in interface UsbIrp
public void setAcceptShortPacket(boolean accept)
setAcceptShortPacket
in interface UsbIrp
accept
- The Short Packet policy.public boolean isComplete()
isComplete
in interface UsbIrp
public void setComplete(boolean b)
setComplete
in interface UsbIrp
b
- If this is complete (or not).public void complete()
This will:
Set
this complete
.waiting Threads
.
complete
in interface UsbIrp
public void waitUntilComplete()
complete
.
This will block until this is complete
.
waitUntilComplete
in interface UsbIrp
public void waitUntilComplete(long timeout)
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
.
waitUntilComplete
in interface UsbIrp
timeout
- The maximum number of milliseconds to wait.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |