SPRINGCARD SAS PRNHSP01 用户手册

下载
页码 118
PMD2271-BA
page 30 of 118
S
PRING
C
ARD
 PC/SC C
OUPLERS
 - H663 
GROUP
 - Developer's reference manual
3.2.5.
UPDATE BINARY instruction
The UPDATE BINARY instruction writes data into a memory card (wired-logic PICC or VICC). Refer
to chapter 4 for details.
For any PICC/VICC but Mifare Classic, this instruction is executed without any prerequisite.
For Mifare Classic, to be able to read the sector's data, the application must be authenticated on
the card's sector. Your application must always invoke GENERAL AUTHENTICATE instruction (with
a valid key A or key B for the sector) before invoking the UPDATE BINARY instruction. Using the
MIFARE   CLASSIC   WRITE   instruction   instead   (§  3.3.2)   could   be   easier   and   may   shorten   the
transaction time.
UPDATE BINARY command APDU
CLA
INS
P1
P2
Lc
Data In
Le
h
FF
h
D6
Address
MSB
Address
LSB
XX
Data
-
P1 and P2 form the address that will be sent to the PICC/VICC in its specific write command. Most
PICC/VICC are divided into small blocks (sometimes called pages). The address is a block number,
and not to an absolute byte offset in memory.
Both the allowed range for the address and the value for Lc depend on the capabilities of the PICC.
Please always refer to its datasheet for details.
For Mifare Classic, P1,P2 is the address of the block (
h
0000 to  
h
00FF), but remember that the
authentication is made on a per-sector basis. A new authentication must be performed every time
you have to access another sector. Lc must be 
h
10 (a block is 16-B long).
For a NFC Type 2 Tag, P2 is the block number, and P1 the sector number if the PICC does support
this feature. Set P1 to 
h
00 if it is not the case. Lc must be 
h
04 (a block is 4-B long).
UPDATE BINARY response
SW1
SW2
See below
SPRINGCARD, the SPRINGCARD logo, PRO ACTIVE and the PRO ACTIVE logo are registered trademarks of PRO ACTIVE SAS.
All other brand names, product names, or trademarks belong to their respective holders.
Information in this document is subject to change without notice. Reproduction without written permission of PRO ACTIVE is forbidden.