#CL CONTROL instruction
Use this command to finely control the behaviour of the contactless (NFC/RFID HF) slot.
#Command format
Field |
Value |
Remark |
CLA |
FF |
|
INS |
FB |
|
P1 |
Sub command selection |
See table below |
P2 |
Sub command selection |
See table below |
Lc |
Depend on the sub command |
|
DataIn |
Depend on the sub command |
|
Le |
00 |
|
#Sub command selection
#NFC/RFID field and card-tracking control
P1 |
P2 |
Function |
Remark |
00 |
00 |
Resume card tracking |
|
01 |
00 |
Suspend card tracking |
Use this feature if the card’s authentication state is cleared by the tracking frames sent by the coupler |
10 |
00 |
RF field OFF |
|
10 |
01 |
RF field ON |
|
10 |
02 |
RF reset |
The RF field is switch OFF for about 10ms, then ON again It is possible to specify a 2-B Data field to specify an explicit timing, from 0 to 65535ms |
10 |
03 |
RF reset after removal |
When the card currently present will be removed, the RF field will reset |
#Multi-activation
P1 |
P2 |
Function |
Remark |
02 |
00 |
Status/Toggle card |
See below |
02 |
01 |
Tracking |
Detect card removal |
02 |
03 |
Tracking+Polling |
Detect card removal + detect card arrival |
#Using the multi-activation system
When multi-activation is enabled, the device’s polling loop is altered to use the anti-collision of the protocols to activate more than one card at once.
The tracking loop is also altered to verify the presence of all the cards that have already been enumerated.
The device attributes a card index to every card it finds. Indexes are released (and potentially re-used) as soon as the corresponding cards does not answer to tracking anymore.
Remark: at firmware level, the device is theoritically able to activate up to 8 cards, but, depending on the antenna, RF environment, and on the cards themselves, there is only little chance to handle more than 3 cards at once.
When P1,P2=02,00
and Lc=00
(no DataIn), the device returns the multi-activation Status in DataOut.
The multi-activation Status is formated as follow:
- 1st byte gives the index of the currently selected card
- 2nd byte is a bit field that shows the list of found card(s) (1 bit per index; for instance,
0D
means there are 3 cards, with indexes 0
, 2
and 3
).
When P1,P2=02,00
and Lc=01
, DataIn is a single byte-value to select another card index.
The Tracking INStruction (P1,P2=02,01
) runs one iteration of the tracking-loop and return the updated multi-activation Status.
This makes it possible to detect card removals.
The Tracking+Polling INStruction (P1,P2=02,03
) runs one iteration of the tracking-loop, then one iteration of the polling loop, and return the updated multi-activation Status.
This makes it possible to detect card removals and card insertions.
#ISO/IEC 15693-3 Read/Write Options, Byte 0
Bit |
Role |
Values |
7-6 |
Select extended functions |
00 : Let the device guess (Extended functions for Block Address above 255, “normal” function otherwise)
01 : Always select “normal” functions
11 : Always select Extended functions
10 : Is RFU and shall not be used |
5 |
RFU |
Shall be 0 |
4 |
RFU |
Shall be 0 |
3-2 |
Map UPDATE BINARY function |
00 : Let the device guess
01 : UPDATE BINARY maps to WriteSingleBlock or ExtendedWriteSingleBlock
10 : UPDATE BINARY maps to WriteMultipleBlocks or ExtendedWriteMultipleBlocks
11 : RFU |
0-1 |
Map READ BINARY function |
00 : Let the device guess
01 : READ BINARY maps to ReadSingleBlock or ExtendedReadSingleBlock
10 : READ BINARY maps to ReadMultipleBlocks or ExtendedReadMultipleBlocks
11 : RFU |
#ISO/IEC 15693-3 Read/Write Options, Byte 1
Bit |
Role |
Values |
7 |
RFU |
Shall be 0 |
6 |
RFU |
Shall be 0 |
5-4 |
Lock Option flag |
00 : Let the device guess
01 : Do not set the Option flag on Lock commands
11 : Set the Option flag on all Lock commands
10 : Is RFU and shall not be used |
3-2 |
Write Option flag |
00 : Let the device guess
01 : Do not set the Option flag on Write commands
11 : Set the Option flag on all Write commands
10 : Is RFU and shall not be used |
1-0 |
Read Option flag |
00 : Let the device guess
01 : Do not set the Option flag on Read commands
11 : Set the Option flag on all Read commands
10 : Is RFU and shall not be used |
#Advanced ISO/IEC 14443-3 and ISO/IEC 15693 operation
P1 |
P2 |
Function |
Remark |
12 |
01 |
HLTA |
ISO/IEC 14443 type A: send the HALT command |
12 |
04 |
QUIET |
ISO/IEC 15693: send QUIET |
13 |
01 |
Select again A |
ISO/IEC 14443 type A: send WUPA and select the current card again |
14 |
04 |
SELECT |
ISO/IEC 15693: send SELECT |
#Advanced ISO/IEC 14443-4 operation
P1 |
P2 |
Function |
Remark |
20 |
00 |
DESELECT |
ISO/IEC 14443-4: send the DESELECT command to the card |
20 |
01 |
RATS |
ISO/IEC 14443 type A: send the RATS command to the card |
20 |
02 |
ATTRIB |
ISO/IEC 14443 type B: send the ATTRIB command to the card |
20 |
03 |
Reset T=CL |
ISO/IEC 14443-4: DESELECT+RATS or DESELECT+ATTRIB sequence |
20 |
04 |
Disable T=CL (once) |
After the next SCardDisconnect, the card resets in ISO/IEC 14443-3 (not -4) |
20 |
05 |
Disable T=CL (all) |
Same as above, but persistent until the coupler is reseted |
20 |
06 |
Enable T=CL |
Restore the default behaviour (cards are operated at ISO/IEC 14443-4) |
20 |
07 |
Leave T=CL now |
Do a RF reset and keep the card in ISO/IEC 14443-3 (not -4) |
#ISO/IEC 14443-4 statistics
P1 |
P2 |
Function |
Remark |
21 |
00 |
TCL Short stats |
ISO/IEC 14443-4: get number of blocks exchanged during the last exhange (2 bytes) and the its duration in ms (4 bytes) |
#Set Contactless runtime parameters
P1 |
P2 |
Function |
Remark |
F0 |
39 |
Set VASUP frame |
Provide the VASUP frame in DataIn; this overwrites content of register 0239 |
The values that are set using these instructions are persistent until the coupler is reseted. Startup values are read from the non-volatile memory’s NFC-A specific options register.
#Set ISO/IEC 14443 type A runtime parameters
P1 |
P2 |
Function |
Remark |
FA |
01 |
Force Mifare Classic ON |
This allow to manipulate T=CL cards as is they were Mifare Classic |
FA |
02 |
Force Mifare Classic OFF |
|
The values that are set using these instructions are persistent until the coupler is reseted. Startup values are read from the non-volatile memory’s NFC-A specific options register.
#Set ISO/IEC 14443 type B runtime parameters
P1 |
P2 |
Function |
DataIn |
FB |
10 |
Set AFI |
ISO/IEC 14443-2 type B AFI (1 byte) |
The values that are set using these instructions are persistent until the coupler is reseted. Startup values are read from the non-volatile memory’s NFC-B specific options register.
#Set FeliCa runtime parameters
P1 |
P2 |
Function |
Remark |
FC |
01 |
Set READ Service Code |
Service Code (2 bytes) to be used by the READ BINARY instruction with FeliCa cards |
FC |
02 |
Set WRITE Service Code |
Service Code (2 bytes) to be used by the UPDATE BINARY instruction with FeliCa cards |
FC |
10 |
Set System Code |
System Code or SENS_RES (2 bytes) to be used for FeliCa polling |
FC |
11 |
Set Request Code |
Request Code or SENS_REQ (1 byte) to be used for FeliCa polling |
The values that are set using these instructions are persistent until the coupler is reseted. Startup values are read from the non-volatile memory’s NFC-F specific options register.
#Set ISO/IEC 15693 runtime parameters
The values that are set using these instructions are persistent until the coupler is reseted. Startup values are read from the non-volatile memory’s NFC-F specific options register.
P1 |
P2 |
Function |
DataIn |
FD |
00 |
Set Read/Write Options |
ISO/IEC 15693-3 Read/Write Options (2 bytes, see below) |
FD |
10 |
Broadcast mode |
ISO/IEC 15693: use non-addressed, non-selected mode |
FD |
11 |
Addressed mode |
ISO/IEC 15693: revert to addressed mode (default) |
FD |
12 |
Selected mode |
ISO/IEC 15693: use selected mode |
When P1,P2=FD,00
, DataIn is a two byte bit-field, defined as follow:
#ISO/IEC 15693-3 Read/Write Options, Byte 0
Bit |
Role |
Values |
7-6 |
Select extended functions |
00 : Let the device guess (Extended functions for Block Address above 255, “normal” function otherwise)
01 : Always select “normal” functions
11 : Always select Extended functions
10 : Is RFU and shall not be used |
5 |
RFU |
Shall be 0 |
4 |
RFU |
Shall be 0 |
3-2 |
Map UPDATE BINARY function |
00 : Let the device guess
01 : UPDATE BINARY maps to WriteSingleBlock or ExtendedWriteSingleBlock
10 : UPDATE BINARY maps to WriteMultipleBlocks or ExtendedWriteMultipleBlocks
11 : RFU |
0-1 |
Map READ BINARY function |
00 : Let the device guess
01 : READ BINARY maps to ReadSingleBlock or ExtendedReadSingleBlock
10 : READ BINARY maps to ReadMultipleBlocks or ExtendedReadMultipleBlocks
11 : RFU |
#ISO/IEC 15693-3 Read/Write Options, Byte 1
Bit |
Role |
Values |
7 |
RFU |
Shall be 0 |
6 |
RFU |
Shall be 0 |
5-4 |
Lock Option flag |
00 : Let the device guess
01 : Do not set the Option flag on Lock commands
11 : Set the Option flag on all Lock commands
10 : Is RFU and shall not be used |
3-2 |
Write Option flag |
00 : Let the device guess
01 : Do not set the Option flag on Write commands
11 : Set the Option flag on all Write commands
10 : Is RFU and shall not be used |
1-0 |
Read Option flag |
00 : Let the device guess
01 : Do not set the Option flag on Read commands
11 : Set the Option flag on all Read commands
10 : Is RFU and shall not be used |
#Response
Field |
Value |
Remark |
SW |
9000 on success |
Other values are documented in Status Words |