Android Guides | Samples

Android.Hardware.Usb.UsbRequest Class

A class representing USB request packet.

See Also: UsbRequest

Syntax

[Android.Runtime.Register("android/hardware/usb/UsbRequest", DoNotGenerateAcw=true)]
public class UsbRequest : Object

Remarks

A class representing USB request packet. This can be used for both reading and writing data to or from a UsbDeviceConnection. UsbRequests can be used to transfer data on bulk and interrupt endpoints. Requests on bulk endpoints can be sent synchronously via UsbDeviceConnection.BulkTransfer(UsbEndpoint,Byte[],Byte[],Byte[]) or asynchronously via UsbRequest.Queue(ByteBuffer,Int32) and UsbDeviceConnection.RequestWait. Requests on interrupt endpoints are only send and received asynchronously.

Requests on endpoint zero are not supported by this class; use UsbDeviceConnection.ControlTransfer(UsbAddressing,Int32,Int32,Int32,Int32,Int32,Int32) for endpoint zero requests instead.

[Android Documentation]

Requirements

Namespace: Android.Hardware.Usb
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 12

The members of Android.Hardware.Usb.UsbRequest are listed below.

See Also: Object

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

ClientDataObject. Returns the client data for the request.
[read-only]
EndpointUsbEndpoint. Returns the endpoint for the request, or null if the request is not opened.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Cancel() : Boolean
Cancels a pending queue operation.
Close()
Releases all resources related to this request.
Initialize(UsbDeviceConnection, UsbEndpoint) : Boolean
Initializes the request so it can read or write data on the given endpoint.
Queue(ByteBuffer, Int32) : Boolean
Queues the request to send or receive data on its endpoint.