Partager via


UsbDeviceConnection.ControlTransfer Method

Definition

Overloads

ControlTransfer(UsbAddressing, Int32, Int32, Int32, Byte[], Int32, Int32)

Performs a control transaction on endpoint zero for this 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)

Performs a control transaction on endpoint zero for this device.

[Android.Runtime.Register("controlTransfer", "(IIII[BII)I", "GetControlTransfer_IIIIarrayBIIHandler")]
public virtual int ControlTransfer (Android.Hardware.Usb.UsbAddressing requestType, int request, int value, int index, byte[]? buffer, int length, int timeout);
[<Android.Runtime.Register("controlTransfer", "(IIII[BII)I", "GetControlTransfer_IIIIarrayBIIHandler")>]
abstract member ControlTransfer : Android.Hardware.Usb.UsbAddressing * int * int * int * byte[] * int * int -> int
override this.ControlTransfer : Android.Hardware.Usb.UsbAddressing * int * int * int * byte[] * int * int -> int

Parameters

requestType
UsbAddressing

request type for this transaction

request
Int32

request ID for this transaction

value
Int32

value field for this transaction

index
Int32

index field for this transaction

buffer
Byte[]

buffer for data portion of transaction, or null if no data needs to be sent or received

length
Int32

the length of the data to send or receive

timeout
Int32

in milliseconds

Returns

length of data transferred (or zero) for success, or negative value for failure

Attributes

Remarks

Performs a control transaction on endpoint zero for this device. The direction of the transfer is determined by the request type. If requestType & UsbConstants#USB_ENDPOINT_DIR_MASK is UsbConstants#USB_DIR_OUT, then the transfer is a write, and if it is UsbConstants#USB_DIR_IN, then the transfer is a read.

This method transfers data starting from index 0 in the buffer. To specify a different offset, use #controlTransfer(int, int, int, int, byte[], int, int, int).

Java documentation for android.hardware.usb.UsbDeviceConnection.controlTransfer(int, int, int, int, byte[], int, 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

ControlTransfer(UsbAddressing, Int32, Int32, Int32, Byte[], Int32, Int32, Int32)

Performs a control transaction on endpoint zero for this device.

[Android.Runtime.Register("controlTransfer", "(IIII[BIII)I", "GetControlTransfer_IIIIarrayBIIIHandler")]
public virtual int ControlTransfer (Android.Hardware.Usb.UsbAddressing requestType, int request, int value, int index, byte[]? buffer, int offset, int length, int timeout);
[<Android.Runtime.Register("controlTransfer", "(IIII[BIII)I", "GetControlTransfer_IIIIarrayBIIIHandler")>]
abstract member ControlTransfer : Android.Hardware.Usb.UsbAddressing * int * int * int * byte[] * int * int * int -> int
override this.ControlTransfer : Android.Hardware.Usb.UsbAddressing * int * int * int * byte[] * int * int * int -> int

Parameters

requestType
UsbAddressing

request type for this transaction

request
Int32

request ID for this transaction

value
Int32

value field for this transaction

index
Int32

index field for this transaction

buffer
Byte[]

buffer for data portion of transaction, or null if no data needs to be sent or received

offset
Int32

the index of the first byte in the buffer to send or receive

length
Int32

the length of the data to send or receive

timeout
Int32

in milliseconds

Returns

length of data transferred (or zero) for success, or negative value for failure

Attributes

Remarks

Performs a control transaction on endpoint zero for this device. The direction of the transfer is determined by the request type. If requestType & UsbConstants#USB_ENDPOINT_DIR_MASK is UsbConstants#USB_DIR_OUT, then the transfer is a write, and if it is UsbConstants#USB_DIR_IN, then the transfer is a read.

Java documentation for android.hardware.usb.UsbDeviceConnection.controlTransfer(int, int, int, int, byte[], int, int, 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