BALTECH Docs |
C API for BALTECH SDK
|
brp_errcode brp_Mif_ChangeValue | ( | brp_protocol | protocol, |
unsigned | Mode, | ||
unsigned | Block, | ||
unsigned | Value | ||
) |
This command uses the value block specified by the Block parameter and performs an operation given by the Mode parameter.
The result is stored in the card's Transfer Buffer.
Mode = 1 increments the value , Mode = 0 decrements the value, Mode = 0x02 simply transfers the value to the Transfer Buffer - the Value parameter is ignored.
In order to persistently store the calculated value on the card, a transfer operation, using the brp_Mif_TransferBlock() command, has to be performed directly after the completion of this command.
This command can be used for MIFARE Classic cards and only works on value sectors.
This command is not supported by LEGIC readers.
[in] | protocol | used to execute the command |
[in] | Mode | Access mode. Possible values, 0x00: decrement, 0x01: increment, 0x02: restore/load. |
[in] | Block | Sector to load data from (only value sectors are supported). |
[in] | Value | Value to add/subtract. This parameter is ignored when Mode = 0x02. |