Android Guides | Samples

Android.Hardware.Usb.UsbDevice Class

This class represents a USB device attached to the android device with the android device acting as the USB host.

See Also: UsbDevice

Syntax

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

Remarks

This class represents a USB device attached to the android device with the android device acting as the USB host. Each device contains one or more UsbInterfaces, each of which contains a number of UsbEndpoints (the channels via which data is transmitted over USB).

This class contains information (along with UsbInterface and UsbEndpoint) that describes the capabilities of the USB device. To communicate with the device, you open a UsbDeviceConnection for the device and use UsbRequest to send and receive data on an endpoint. UsbDeviceConnection.ControlTransfer(UsbAddressing,Int32,Int32,Int32,Int32,Int32,Int32) is used for control requests on endpoint zero.

Developer Guides

For more information about communicating with USB hardware, read the USB developer guide.

[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.UsbDevice 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]
ConfigurationCountInt32. Returns the number of UsbConfigurations this device contains.
[read-only]
static
CreatorIParcelableCreator.
[read-only]
DeviceClassUsbClass. Returns the devices's class field.
[read-only]
DeviceIdInt32. Returns a unique integer ID for the device.
[read-only]
DeviceNameString. Returns the name of the device.
[read-only]
DeviceProtocolInt32. Returns the device's protocol field.
[read-only]
DeviceSubclassUsbClass. Returns the device's subclass field.
[read-only]
InterfaceCountInt32. Returns the number of UsbInterfaces this device contains.
[read-only]
ManufacturerNameString. Returns the manufacturer name of the device.
[read-only]
ProductIdInt32. Returns a product ID for the device.
[read-only]
ProductNameString. Returns the product name of the device.
[read-only]
SerialNumberString. Returns the serial number of the device.
[read-only]
VendorIdInt32. Returns a vendor ID 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

DescribeContents() : Int32
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
GetConfiguration(Int32) : UsbConfiguration
Returns the UsbConfiguration at the given index.
static
GetDeviceId(String) : Int32
static
GetDeviceName(Int32) : String
GetInterface(Int32) : UsbInterface
Returns the UsbInterface at the given index.
WriteToParcel(Parcel, ParcelableWriteFlags)
Flatten this object in to a Parcel.