Android Guides | Samples

Android.Hardware.Usb.UsbDeviceConnection Class

This class is used for sending and receiving data and control messages to a USB device.

See Also: UsbDeviceConnection

Syntax

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

Remarks

This class is used for sending and receiving data and control messages to a USB device. Instances of this class are created by UsbManager.OpenDevice(UsbDevice).

[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.UsbDeviceConnection are listed below.

See Also: Object

Protected Constructors

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

Public Properties

[read-only]
FileDescriptorInt32. Returns the native file descriptor for the device, or -1 if the device is not opened.
[read-only]
SerialString. Returns the serial number for the device.

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

BulkTransfer(UsbEndpoint, Byte[], Int32, Int32) : Int32
Performs a bulk transaction on the given endpoint.
BulkTransfer(UsbEndpoint, Byte[], Int32, Int32, Int32) : Int32
Performs a bulk transaction on the given endpoint.
BulkTransferAsync(UsbEndpoint, Byte[], Int32, Int32) : System.Threading.Tasks.Task<int>
BulkTransferAsync(UsbEndpoint, Byte[], Int32, Int32, Int32) : System.Threading.Tasks.Task<int>
ClaimInterface(UsbInterface, Boolean) : Boolean
Claims exclusive access to a UsbInterface.
Close()
Releases all system resources related to the device.
ControlTransfer(UsbAddressing, Int32, Int32, Int32, Byte[], Int32, Int32) : Int32
Performs a control transaction on endpoint zero for this device.
ControlTransfer(UsbAddressing, Int32, Int32, Int32, Byte[], Int32, Int32, Int32) : Int32
Performs a control transaction on endpoint zero for this device.
ControlTransferAsync(UsbAddressing, Int32, Int32, Int32, Byte[], Int32, Int32) : System.Threading.Tasks.Task<int>
ControlTransferAsync(UsbAddressing, Int32, Int32, Int32, Byte[], Int32, Int32, Int32) : System.Threading.Tasks.Task<int>
GetRawDescriptors() : Byte[]
Returns the raw USB descriptors for the device.
ReleaseInterface(UsbInterface) : Boolean
Releases exclusive access to a UsbInterface.
RequestWait() : UsbRequest
Waits for the result of a UsbRequest.Queue(ByteBuffer,Int32) operation Note that this may return requests queued on multiple UsbEndpoints.
RequestWaitAsync() : System.Threading.Tasks.Task<UsbRequest>
SetConfiguration(UsbConfiguration) : Boolean
Sets the device's current UsbConfiguration.
SetInterface(UsbInterface) : Boolean
Sets the current UsbInterface.