public class USBRequest extends Object
SystemCapability.Usb#USB_MANAGER| 构造器 | 说明 |
|---|---|
USBRequest() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
abort() |
Aborts a pending queue operation.
|
void |
dequeue(boolean useBufferOverflowInsteadOfIllegalArg) |
Dequeues a request to send or receive data on its endpoint.
|
void |
free() |
Frees all resources related to this request.
|
Object |
getClientData() |
Gets client data of the
USBRequst instance. |
boolean |
initialize(USBDevicePipe connection,
USBEndpoint ep) |
Initializes a specified endpoint for data transfer.
|
boolean |
queue(ByteBuffer buffer) |
Transfers data on the requested endpoint, and queues the request.
|
boolean |
queue(ByteBuffer buffer,
int length) |
Transfers data on the requested endpoint, and queues the request.
|
void |
setClientData(Object data) |
Sets client data of the
USBRequst instance. |
public void abort()
public void free()
public boolean initialize(USBDevicePipe connection, USBEndpoint ep)
connection - Indicates a USBDevicePipe instance.ep - Indicates an instance of the USBEndpoint class.true if the initialization is successful; returns false otherwise.public boolean queue(ByteBuffer buffer)
buffer - Indicates the buffer from which data is to be transferred.true if the data transfer is successful; returns false otherwise.public boolean queue(ByteBuffer buffer, int length)
buffer - Indicates the buffer from which data is to be transferred.length - Indicates the length of buffer.true if the data transfer is successful; returns false otherwise.public void dequeue(boolean useBufferOverflowInsteadOfIllegalArg)
useBufferOverflowInsteadOfIllegalArg - Specifies whether to replace the illegal parameter
with a buffer overflow.public void setClientData(Object data)
USBRequst instance.data - The client data to be set.public Object getClientData()
USBRequst instance.