Page
43
of
70
Copyright © Access-IS 2016
7.7.3 Example
This command successfully increments the previously created value field at block number 4 by
0x00000001. The command uses the loaded key and authenticates against Key A in the media.
Command:
[0x00][0x4C][0x04][0x00][0x00][0x00][0x01]
Response:
[0x00][0x4D][0x04][0x90][0x00]
7.8 MIFARE decrement value block (key A or key B)
Use this command to authenticate the specified MIFARE block against the MIFARE
media’s internal
Key A or B and then decrease the value stored in the value block.
You must load the MIFARE key using
(on page 37) before sending this command.
The specified block number must also be a value block or the command will fail. To create a value
block, use the
MIFARE create value block (key A or key B)
command (on page 41).
Note:
This command is NOT applicable to MIFARE Ultralight cards and fails if executed on
Ultralight cards. Ultralight cards do not support value blocks.
7.8.1 MIFARE command bytes
MIFARE command bytes
Command header
Command code
Block number
Initial value
[0x00]
[0x0E]
Decrement value block (Key A)
Block number
32-bit
decrement
value
(MSB first)
[0x1E]
Decrement value block (Key B)
[0x4E]
Authenticate and decrement value block (Key A)
[0x5E]
Authenticate and decrement value block (Key B)
[0x8E]
or
[0xCE]
RF select, authenticate and decrement value
block (Key A)
[0x9E]
or
[0xDE]
RF select, authenticate and decrement value
block (Key B)
7.8.2 MIFARE response bytes
MIFARE response bytes
Response header
Response code
Block number
Status bytes
[0x00]
Any one of the following
values
(Command code + 1)
[0x0F]
or
[0x1F]
[0x4F]
or
[0x5F]
[0x8F]
or
[0xCF]
[0x9F]
or
[0xDF]
Block number
[0x90][0x00]
Success
Failure
Refer to page 48 for information on MIFARE failure status codes.