Language

NfcF.TransceiveAsync(Byte[]) Method

Definition

Sends NFC-F commands to the tag and receives its response on a thread-pool thread.

public System.Threading.Tasks.Task<byte[]?> TransceiveAsync(byte[]? data);
member this.TransceiveAsync : byte[] -> System.Threading.Tasks.Task<byte[]>

Parameters

data
Byte[]

The NFC-F frame bytes, including the length, command, IDm, and parameters, but not the preamble, sync code, or CRC. The length must not exceed MaxTransceiveLength.

Returns

Task<Byte[]>

A task whose result contains the response bytes.

Remarks

This managed wrapper uses Task.Run to call Transceive(Byte[]). Connect first and await the task before starting another operation. Android supplies the preamble, sync code, and CRC. A typical supplied frame has one length byte, one command byte, eight IDm bytes, and any command parameters.

The method has no cancellation-token parameter. Calling Close() from another thread cancels blocked I/O with IOException. Exceptions from the synchronous call are reported through the task. The NFC permission is required.

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