Bernecker&Rainer Industrie-Elektronik Ges.m.b.H 5E903029 ユーザーズマニュアル

ページ / 29
MIFARE 
16
Data sheet V 1.00 5E9030.29
5 MIFARE
5.1 MIFARE commands
Command
Description
Parameter 1 Parameter 2 Parameter 3 Parameter 4 Parameter 5
Read
Reads a 16-byte block from PICC
"A" or "B"
See  table 
(parameter 2)
Source block --
--
Read_Blocks
Reads the specified range of blocks from PICC
"A" or "B"
See  table 
(parameter 2)
Starting block Ending block
--
Write
Writes a 16-byte block to PICC
"A" or "B"
See  table 
(parameter 2)
Destination
block
16-byte data in
hex 00h
--
Decr
Takes the value of the source value block, subtracts the
specified value and writes the result to the destination
block
"A" or "B"
See  table 
(parameter 2)
Source block Destination
block
Value
Incr
Takes  the  value  of  the  source  value  block,  adds  the
specified value and writes the result to the destination
block
"A" or "B"
See  table 
(parameter 2)
Source block Destination
block
Value
Restore
Copies a value block
"A" or "B"
See  table 
(parameter 2)
Source block Destination
block
--
InitZero
Initializes a value block with the value 0
"A" or "B"
See  table 
(parameter 2)
Destination
block
--
--
Store_Key_EEPROM Stores a 6-byte key in EEPROM
"A" or "B"
Sector  for  key
in 
reader's
EEPROM
6-byte key
Store_Key_Temp
Stores a 6-byte key in the transponder reader temporar-
ily until switched off
6-byte key
--
--
--
--
Connect
Connects manually to a specific tag
4-byte SNr
--
--
--
--
Disconnect
Automatically restores a connection to the best tag
--
--
--
--
--
Key_CMD
Sends a key directly with each command (default)
--
--
--
--
--
Key_EEPROM
Uses the key from EEPROM
--
--
--
--
--
Key_TEMP
Uses the temporary key
--
--
--
--
--
Table 6: MIFARE commands
5.2 Authentication
The keys needed for authentication can be stored either in EEPROM or temporarily in the transponder. Alterna-
tively, the authentication keys can be transferred with the command.
The Key_EEPROM, Key_TEMP and Key_CMD commands are used to set the storage location or to send the
authentication keys.
The following commands are used to store the authentication key in the transponder.
MIFARE commands - Authentication key storage
Command
Parameter 1
Parameter 2
Parameter 3
Parameter 4 Parameter 5
Store_key_eeprom
"A" or "B"
Sector for key in reader's EEPROM
6-byte key
--
--
Store_key_temp
6-byte key
--
--
--
--
Table 7: MIFARE commands - Authentication key storage
store_key_eeprom,a,0,ff ff ff ff ff ff
"store_key_eeprom" command: The key is written to EEPROM sector 0.
Default key (when tags are delivered): 0xFF FF FF FF FF FF
Up to 16 keys (0 to 15) can be stored in EEPROM for each key (A and B).
5.3 Access rights and memory organization
The tag is divided into 16 sectors of 4 blocks each. Each block contains 16 bytes. The 4th block in each sector
contains the keys and access rights for the respective sector (sector trailer). Access rights can be assigned indi-
vidually to each block. Each sector can be assigned one of two different keys (A or B).