READ BINARY instruction
The READ BINARY instruction retrieves data from a memory card (wired-logic PICC or VICC).
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 onthe card's sector. The application must therefore invoke GENERAL AUTHENTICATE instruction (with a valid key A or key B for the sector) before invoking the READ BINARY instruction. Using the MIFARE CLASSIC READ instruction instead can be easier and may shorten thetransaction time.
P1 and P2 form the address that will be sent to the PICC/VICC in its specific read 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 Le depend on the capabilities of thePICC/VICC. Please always refer to its datasheet for details. Note that Le =
00 should always work,provided that the address is valid.
For Mifare Classic, P1,P2 is the address of the block (
00FF), but remember that theauthentication is made on a per-sector basis. A new authentication must be performed every timeyou have to access another sector.For a NFC Type 2 Tag, P2 is the block number, and P1 the sector number if the PICC supports thisfeature. Set P1 to
00if it is not the case.
|DataOut||The expected data|
||Other values are documented in Status Words|