C API for BALTECH SDK

§ brp_Mif_ChangeValue()

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 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.

Parameters
[in]protocolused to execute the command
[in]ModeAccess mode. Possible values, 0x00: decrement, 0x01: increment, 0x02: restore/load.
[in]BlockSector to load data from (only value sectors are supported).
[in]ValueValue to add/subtract. This parameter is ignored when Mode = 0x02.