
26
4.2.4
Read Data Block (0x04)
Table 4.4
The Read Data Block command takes as arguments the first block address to read (Block Address), the number of
blocks to read (Read Length), the byte offset in the data buffer (Data Buffer Offset), the Authentication Key Number
and (optionally) the Authentication Key. If the Authentication Key is set-up, the command first tries to authenticate
the sector which contains the first buffer. If authentication fails, the Result Register is updated with
the ‘
error
’
value
and command execution finishes. After successful authentication, the first block is read and stored in the data
buffer. The command continues to read subsequent blocks if the Read Length is higher than 1. The difference
between the Read Data Block command and the Read Block Command is that the first one omits blocks with
authentication keys and lock bits. It only reads the data blocks from Mifare tags. If the subsequent blocks read fall
into another tag memory sector, this sector is authenticated using the same key. If everything goes well all block
bytes are copied to the Data Buffer starting from the Data Buffer Offset and the Result Register is updated with a
‘
No
Error
’
value. If the RFID Module is unable to read the block an
‘
error
’
value is stored in the Result Register.
Command Number
Command Name
Valid Tag Types
Argument Offset [bytes]
0x00
0x01
0x02
0x03
0x04
Argument Name
Block Address
Read Length
Data Buffer Offset
Authentication Key
Number
Authentication Key
Argument Size [bytes]
0x01
0x01
0x01
0x01
0x06
Argument Description
Address of the first
block in the memory
that is to be read.
Number of blocks to
read. Value has to be
larger than 0.
Buffer offset in bytes of
where the data from
the tag is to be stored.
The total read size and
the offset must not
exceed the data buffer
length (number of
bytes).
The 6 least significant
bits define the
Authentication Key
Number from 0 to 39
that is to be used to
decrypt the data read.
If the most significant
bit (bit 7) is set, then
the key will be used as
key B. If bit 7 is zero it
will be used as key A. If
bit 6 is set, then the
key will be taken from
the following argument
list (next 6 bytes).
Optional parameter
used when bit 6 in
Authentication Key
Number argument is
set. This Key will be
used as Key B if bit 7 in
Authentication Key
Number is set or as Key
A if bit 7 is not set. The
byte order is the least
significant byte first.
0x04
Read Data Block
Mifare Classic
Содержание RFID A1
Страница 58: ...58 6 Mechanical 6 1 Dimensions Drawing 1 Table 6 1...
Страница 59: ...59 6 2 Recommended Footprint Drawing 2...
Страница 60: ...60...