Condividi tramite


UsbDeviceConnection.ClaimInterface(UsbInterface, Boolean) Method

Definition

Claims exclusive access to a android.hardware.usb.UsbInterface.

[Android.Runtime.Register("claimInterface", "(Landroid/hardware/usb/UsbInterface;Z)Z", "GetClaimInterface_Landroid_hardware_usb_UsbInterface_ZHandler")]
public virtual bool ClaimInterface (Android.Hardware.Usb.UsbInterface? intf, bool force);
[<Android.Runtime.Register("claimInterface", "(Landroid/hardware/usb/UsbInterface;Z)Z", "GetClaimInterface_Landroid_hardware_usb_UsbInterface_ZHandler")>]
abstract member ClaimInterface : Android.Hardware.Usb.UsbInterface * bool -> bool
override this.ClaimInterface : Android.Hardware.Usb.UsbInterface * bool -> bool

Parameters

intf
UsbInterface

the interface to claim

force
Boolean

true to disconnect kernel driver if necessary

Returns

true if the interface was successfully claimed

Attributes

Remarks

Claims exclusive access to a android.hardware.usb.UsbInterface. This must be done before sending or receiving data on any android.hardware.usb.UsbEndpoints belonging to the interface.

Java documentation for android.hardware.usb.UsbDeviceConnection.claimInterface(android.hardware.usb.UsbInterface, boolean).

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