Page
36
of
70
Copyright © Access-IS 2016
7. MIFARE media commands and responses
This section describes the MIFARE media commands and responses for the NFC module.
Note:
The commands and responses in the examples in this section omit trailing zeroes.
The command bytes have a command code, which is bit encoded as follows:
Bit
7
6
5
4
3
2
1
0
1 - RF selection prior to
command operation
1 - Authentication after RF
selection (if enabled) but
before the command operation
Command function code
0 - No RF selection
0 - No authentication*
* Some commands will automatically perform authentication if you enable RF selection.
When you enable RF selection, the reader resets each time it polls.
When you disable RF selection, the reader polls using the Universally Unique Identifier (UUID) that
it had last time it polled; the reader looks for the same card.
Note:
The MIFARE command code has two possible values depending on whether the command
includes authentication (bit 6). For example, RF select and no authentication: binary =
10000000
,
hex =
[0x80]
, RF select with authentication: binary =
11000000
, hex =
[0xC0]
. Authentication
may or may not apply depending on the command.
7.1 MIFARE get media type
Use this command to return the MIFARE media type.
7.1.1 MIFARE command bytes
MIFARE command bytes
Command header
Command code
[0x00]
[0x00]
or
[0x40]
Get type
[0x80]
or
[0xC0]
RF select and get type (No authentication performed)
7.1.2 MIFARE response bytes
MIFARE response bytes
Response header
Response code (1)
MIFARE type (2)
Media UID (2)
Status bytes
[0x00]
Any one of the
following values
[0x01]
[0x41]
[0x81]
[0xC1]
[0x03]
MIFARE Classic 1K
[0x04]
MIFARE Classic 4K
[0x05]
MIFARE Ultralight
4 bytes for
cascade level 1
7 bytes for
cascade level 2
10 bytes for
cascade level 3
[0x90][0x00]
Success
Failure
(1)
The response code is the command code plus one (for example, command
[0x00]
- response
[0x01]
).
(2)
This field is only present if the command is successful. Refer to page 48 for
information on MIFARE failure status codes.