Dela via


UsbRequest.Queue Method

Definition

Overloads

Queue(ByteBuffer)

Queues the request to send or receive data on its endpoint.

Queue(ByteBuffer, Int32)

Queues the request to send or receive data on its endpoint.

Queue(ByteBuffer)

Queues the request to send or receive data on its endpoint.

[Android.Runtime.Register("queue", "(Ljava/nio/ByteBuffer;)Z", "GetQueue_Ljava_nio_ByteBuffer_Handler", ApiSince=26)]
public virtual bool Queue (Java.Nio.ByteBuffer? buffer);
[<Android.Runtime.Register("queue", "(Ljava/nio/ByteBuffer;)Z", "GetQueue_Ljava_nio_ByteBuffer_Handler", ApiSince=26)>]
abstract member Queue : Java.Nio.ByteBuffer -> bool
override this.Queue : Java.Nio.ByteBuffer -> bool

Parameters

buffer
ByteBuffer

the buffer containing the bytes to send, or the buffer to fill. The state of the buffer is undefined until the request is returned by UsbDeviceConnection#requestWait. If the request failed the buffer will be unchanged; if the request succeeded the position of the buffer is incremented by the number of bytes sent/received. Before Build.VERSION_CODES#P, a buffer of length larger than 16384 bytes would throw IllegalArgumentException. In API Build.VERSION_CODES#P and after, any size buffer is valid.

Returns

true if the queueing operation succeeded

Attributes

Remarks

Queues the request to send or receive data on its endpoint.

For OUT endpoints, the remaining bytes of the buffer will be sent on the endpoint. For IN endpoints, the endpoint will attempt to fill the remaining bytes of the buffer. If the queueing operation is successful, return true. The result will be returned via UsbDeviceConnection#requestWait

Java documentation for android.hardware.usb.UsbRequest.queue(java.nio.ByteBuffer).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Queue(ByteBuffer, Int32)

Queues the request to send or receive data on its endpoint.

[Android.Runtime.Register("queue", "(Ljava/nio/ByteBuffer;I)Z", "GetQueue_Ljava_nio_ByteBuffer_IHandler")]
public virtual bool Queue (Java.Nio.ByteBuffer? buffer, int length);
[<Android.Runtime.Register("queue", "(Ljava/nio/ByteBuffer;I)Z", "GetQueue_Ljava_nio_ByteBuffer_IHandler")>]
abstract member Queue : Java.Nio.ByteBuffer * int -> bool
override this.Queue : Java.Nio.ByteBuffer * int -> bool

Parameters

buffer
ByteBuffer

the buffer containing the bytes to write, or location to store the results of a read. Position and array offset will be ignored and assumed to be 0. Limit and capacity will be ignored. Once the request UsbDeviceConnection#requestWait() is processed the position will be set to the number of bytes read/written.

length
Int32

number of bytes to read or write. Before Build.VERSION_CODES#P, a value larger than 16384 bytes would be truncated down to 16384. In API Build.VERSION_CODES#P and after, any value of length is valid.

Returns

true if the queueing operation succeeded

Attributes

Remarks

Queues the request to send or receive data on its endpoint.

For OUT endpoints, the given buffer data will be sent on the endpoint. For IN endpoints, the endpoint will attempt to read the given number of bytes into the specified buffer. If the queueing operation is successful, return true. The result will be returned via UsbDeviceConnection#requestWait

This member is deprecated. Use #queue(ByteBuffer) instead.

Java documentation for android.hardware.usb.UsbRequest.queue(java.nio.ByteBuffer, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to