次の方法で共有


UsbDeviceConnection.BulkTransfer Method

Definition

Overloads

BulkTransfer(UsbEndpoint, Byte[], Int32, Int32)

Performs a bulk transaction on the given endpoint.

BulkTransfer(UsbEndpoint, Byte[], Int32, Int32, Int32)

Performs a bulk transaction on the given endpoint.

BulkTransfer(UsbEndpoint, Byte[], Int32, Int32)

Performs a bulk transaction on the given endpoint.

[Android.Runtime.Register("bulkTransfer", "(Landroid/hardware/usb/UsbEndpoint;[BII)I", "GetBulkTransfer_Landroid_hardware_usb_UsbEndpoint_arrayBIIHandler")]
public virtual int BulkTransfer (Android.Hardware.Usb.UsbEndpoint? endpoint, byte[]? buffer, int length, int timeout);
[<Android.Runtime.Register("bulkTransfer", "(Landroid/hardware/usb/UsbEndpoint;[BII)I", "GetBulkTransfer_Landroid_hardware_usb_UsbEndpoint_arrayBIIHandler")>]
abstract member BulkTransfer : Android.Hardware.Usb.UsbEndpoint * byte[] * int * int -> int
override this.BulkTransfer : Android.Hardware.Usb.UsbEndpoint * byte[] * int * int -> int

Parameters

endpoint
UsbEndpoint

the endpoint for this transaction

buffer
Byte[]

buffer for data to send or receive; can be null to wait for next transaction without reading data

length
Int32

the length of the data to send or receive. Before Build.VERSION_CODES#P, a value larger than 16384 bytes would be truncated down to 16384. In API Build.VERSION_CODES#P and after, any value of length is valid.

timeout
Int32

in milliseconds, 0 is infinite

Returns

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

Attributes

Remarks

Performs a bulk transaction on the given endpoint. The direction of the transfer is determined by the direction of the endpoint.

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

Java documentation for android.hardware.usb.UsbDeviceConnection.bulkTransfer(android.hardware.usb.UsbEndpoint, 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

BulkTransfer(UsbEndpoint, Byte[], Int32, Int32, Int32)

Performs a bulk transaction on the given endpoint.

[Android.Runtime.Register("bulkTransfer", "(Landroid/hardware/usb/UsbEndpoint;[BIII)I", "GetBulkTransfer_Landroid_hardware_usb_UsbEndpoint_arrayBIIIHandler")]
public virtual int BulkTransfer (Android.Hardware.Usb.UsbEndpoint? endpoint, byte[]? buffer, int offset, int length, int timeout);
[<Android.Runtime.Register("bulkTransfer", "(Landroid/hardware/usb/UsbEndpoint;[BIII)I", "GetBulkTransfer_Landroid_hardware_usb_UsbEndpoint_arrayBIIIHandler")>]
abstract member BulkTransfer : Android.Hardware.Usb.UsbEndpoint * byte[] * int * int * int -> int
override this.BulkTransfer : Android.Hardware.Usb.UsbEndpoint * byte[] * int * int * int -> int

Parameters

endpoint
UsbEndpoint

the endpoint for this transaction

buffer
Byte[]

buffer for data to send or receive

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. Before Build.VERSION_CODES#P, a value larger than 16384 bytes would be truncated down to 16384. In API Build.VERSION_CODES#P and after, any value of length is valid.

timeout
Int32

in milliseconds, 0 is infinite

Returns

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

Attributes

Remarks

Performs a bulk transaction on the given endpoint. The direction of the transfer is determined by the direction of the endpoint.

Java documentation for android.hardware.usb.UsbDeviceConnection.bulkTransfer(android.hardware.usb.UsbEndpoint, 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