public class UsbIso.Request
extends java.lang.Object
The sequence of actions on a Request
object is typically:
UsbIso.getRequest() Request.initialize() ... For output: Set packet data to be sent to device ... Request.submit() repeatedly: UsbIso.reapRequest() ... For input: Check status and process received packet data ... ... For output: Check status ... Request.initialize() ... For output: Set packet data to be sent to device ... Request.submit()
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels a queued request.
|
int |
getEndpointAddr()
Returns the endpoint address associated with this request.
|
int |
getPacketActualLength(int packetNo)
Returns the amount of data that was actually transferred for the packet.
|
int |
getPacketCount()
Returns the packet count of this request.
|
void |
getPacketData(int packetNo,
byte[] buf,
int len)
Used to retrieve data that has been received from the device.
|
int |
getPacketStatus(int packetNo)
Returns the completion status code of a packet.
|
void |
initialize(int endpointAddr)
Initializes this
Request object for the next submit() . |
void |
setPacketCount(int n)
May be used to modify the packet count.
|
void |
setPacketData(int packetNo,
byte[] buf,
int len)
Used to provide data to be sent to the device.
|
void |
setPacketLength(int packetNo,
int length)
May be used to modify the length of data to request for the packet.
|
void |
submit()
Submits this request to the USB device driver.
|
public void initialize(int endpointAddr)
Request
object for the next submit()
.
For input, an initialized Request
object can usually be submitted without change.
For output, data has to be copied into the packet data buffers before the Request
object is submitted.endpointAddr
- The address of an isochronous USB endpoint.
For Android, this is the value returned by UsbEndpoint.getAddress()
.public void submit() throws java.io.IOException
java.io.IOException
public void cancel() throws java.io.IOException
UsbIso.reapRequest(boolean)
.java.io.IOException
public int getEndpointAddr()
public void setPacketCount(int n)
maxPacketsPerRequest
(see UsbIso
constructor).public int getPacketCount()
public int getPacketStatus(int packetNo)
public void setPacketLength(int packetNo, int length)
maxPacketSize
(see UsbIso
constructor).public int getPacketActualLength(int packetNo)
public void setPacketData(int packetNo, byte[] buf, int len)
public void getPacketData(int packetNo, byte[] buf, int len)