ACR122T – Application Programming Interface
Version 2.02
www.acs.com.hk
Page 17 of 45
5.4. Update Binary Blocks
The “Update Binary Blocks command” is used for writing a “data blocks” into the PICC. The data
block/trailer block must be authenticated.
Update Binary APDU Format (4 or 16 + 5 Bytes)
Command
Class INS P1
P2
Lc
Data In
Update Binary
Blocks
FFh
D6h 00h
Block
Number
Number
of Bytes
to
Update
Block Data
4 Bytes for Mifare
Ultralight or
16 Bytes for Mifare
1K/4K
Where:
Block Number:
1 Byte. The starting block to be updated.
Number of Bytes to Update:
1 Byte.
16 bytes for Mifare 1K/4K
4 bytes for Mifare Ultralight.
Block Data:
4 or 16 Bytes. The data to be written into the binary block/blocks.
Update Binary Block Response Codes (2 Bytes)
Results
SW1 SW2
Meaning
Success
90 00h
The operation completed successfully.
Error
63 00h
The operation failed.
Example:
1. Update the binary block
0x04h
of Mifare 1K/4K with Data {00 01 .. 0Fh}
APDU = {FF D6 00
04
10 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0Fh}
2. Update the binary block
0x04h
of Mifare Ultralight with Data {00 01 02 03}
APDU = {FF D6 00
04
04 00 01 02 03h}