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

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