public final class Transfer extends Object
Modifier and Type | Method and Description |
---|---|
int |
actualLength()
Returns the actual length of data that was transferred.
|
ByteBuffer |
buffer()
Returns the data buffer.
|
TransferCallback |
callback()
Returns the current callback object.
|
DeviceHandle |
devHandle()
Returns the handle of the device that this transfer will be submitted to.
|
byte |
endpoint()
Returns the address of the endpoint where this transfer will be sent.
|
boolean |
equals(Object obj) |
byte |
flags()
Returns the bitwise OR combination of libusb transfer flags.
|
long |
getPointer()
Returns the native pointer.
|
int |
hashCode() |
IsoPacketDescriptor[] |
isoPacketDesc()
Array of isochronous packet descriptors, for isochronous transfers only.
|
int |
length()
Returns the length of the data buffer.
|
int |
numIsoPackets()
Returns the number of isochronous packets.
|
void |
setBuffer(ByteBuffer buffer)
Sets the data buffer.
|
void |
setCallback(TransferCallback callback)
Sets the callback object.
|
void |
setDevHandle(DeviceHandle handle)
Sets the handle of the device that this transfer will be submitted to.
|
void |
setEndpoint(byte endpoint)
Sets the address of the endpoint where this transfer will be sent.
|
void |
setFlags(byte flags)
Sets the bitwise OR combination of libusb transfer flags.
|
void |
setLength(int length)
Sets the length of the data buffer.
|
void |
setNumIsoPackets(int numIsoPackets)
Sets the number of isochronous packets.
|
void |
setStreamId(int streamId)
Set a transfer's bulk stream id.
|
void |
setTimeout(long timeout)
Sets the timeout for this transfer in milliseconds.
|
void |
setType(byte type)
Sets the type of the endpoint.
|
void |
setUserData(Object userData)
Sets the user data object, representing user context data to pass to
the callback function and that can be accessed from there.
|
int |
status()
Returns the status of the transfer.
|
int |
streamId()
Get a transfer's bulk stream id.
|
long |
timeout()
Returns the timeout for this transfer in milliseconds.
|
String |
toString() |
byte |
type()
Returns the type of the endpoint.
|
Object |
userData()
Returns the current user data object.
|
public long getPointer()
public DeviceHandle devHandle()
public void setDevHandle(DeviceHandle handle)
handle
- The handle of the device.public byte flags()
public void setFlags(byte flags)
flags
- The transfer flags to set.public byte endpoint()
public void setEndpoint(byte endpoint)
endpoint
- The endpoint address to setpublic byte type()
public void setType(byte type)
type
- The endpoint type to set.public long timeout()
public void setTimeout(long timeout)
timeout
- The timeout to set.public int status()
LibUsb.TRANSFER_COMPLETED
even if there were errors in the
frames. Use the status field in each packet to determine if errors
occurred.public int length()
public void setLength(int length)
length
- The data buffer length to set.public int actualLength()
public TransferCallback callback()
public void setCallback(TransferCallback callback)
callback
- The callback object to use.public Object userData()
public void setUserData(Object userData)
userData
- The user data object to set.public ByteBuffer buffer()
public void setBuffer(ByteBuffer buffer)
buffer
- The data buffer to set.public int numIsoPackets()
public void setNumIsoPackets(int numIsoPackets)
numIsoPackets
- The number of isochronous packets to set.public IsoPacketDescriptor[] isoPacketDesc()
public int streamId()
public void setStreamId(int streamId)
streamId
- The stream id to set.Copyright © 2011–2018 usb4java Team. All rights reserved.