Language

MifareClassic.DecrementAsync(Int32, Int32) Method

Definition

Decreases a value block and stores the result in the tag's temporary block on a thread-pool thread.

public System.Threading.Tasks.Task DecrementAsync(int blockIndex, int value);
member this.DecrementAsync : int * int -> System.Threading.Tasks.Task

Parameters

blockIndex
Int32

The zero-based index of the value block, from 0 through 255. The block must be available on the tag.

value
Int32

The non-negative amount to subtract.

Returns

A task that represents the decrement operation.

Remarks

This managed wrapper uses Task.Run to call Decrement(Int32, Int32). Connect and authenticate the block's sector first. Await the task, then use TransferAsync(Int32) to copy the temporary result to a value block.

The synchronous method's connection, access, and NFC permission requirements apply. 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.

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