Android proprietary NCI commands

The NFC Controller Interface (NCI) is used for interacting with an NFC controller (NFCC). This page describes the specifications of Android proprietary NCI commands.

NCI definitions

The Android proprietary NCI commands use the proprietary group ID (GID) 0xF and the Android opcode identifier (OID) code space of 0xC.

Common packet format

The Android NCI packet format follows the NCI specification for control packets using the proprietary Group_ID 0xFand Opcode_ID 0x0C. For each Android proprietary message, the first byte of the packet payload must be set to the Android opcode (0x0C). The Android control packets use Message_Type and PBF for identifying commands, responses, and notifications similarly to standard commands.

The Android packet format is shown in the following table:

01234567
Message_TypePBFGroup_ID = 0xF (PROPRIETARY)
reserved for future use (RFU)Opcode_ID = 0x0C (ANDROID)
Payload_Length
Android_Opcode_ID
Android_Payload

Assigned Android opcode identifiers are listed in the following table. The specification for each packet follows in the next sections.

Android OIDMessage typeMessage name
0x00NCI_MT_CMDNCI_ANDROID_GET_CAPS_CMD
NCI_MT_RSPNCI_ANDROID_GET_CAPS_RSP
0x01NCI_MT_CMDNCI_ANDROID_POWER_SAVING_CMD
NCI_MT_RSPNCI_ANDROID_POWER_SAVING_RSP
0x02NCI_MT_CMDNCI_ANDROID_PASSIVE_OBSERVE_MODE_CMD
NCI_MT_RSPNCI_ANDROID_PASSIVE_OBSERVE_MODE_RSP
0x03NCI_MT_NTFNCI_ANDROID_POLLING_FRAME_NTF
0x04NCI_MT_CMDNCI_ANDROID_QUERY_PASSIVE_OBSERVER_STATUS_CMD
NCI_MT_RSPNCI_ANDROID_QUERY_PASSIVE_OBSERVER_STATUS_RSP

Get capabilities command

The host uses NCI_ANDROID_GET_CAPS_CMD to query the list of Android proprietary features supported by the NFCC. The NCI_ANDROID_GET_CAPS_CMD command doesn't take any parameters.

The NFCC must respond with the NCI_ANDROID_GET_CAPS_RSP response with a status of STATUS_OK and the list of supported capabilities and features.

If the NFCC doesn't support NCI_ANDROID_GET_CAPS_CMD, the host must assume that the capabilities each take the default specified value. If a specified capability isn't returned by the NFCC in the response, the host must assume that the capability has the default specified value.

NCI_ANDROID_GET_CAPS_CMD

Payload fieldsSizeValue/description
N/A0 octets

NCI_ANDROID_GET_CAPS_RSP

Payload fieldsSizeValue/description
Status1 octetSee status codes in table 140 of NCI Specification.
Android_Version2 octetsIdentifies the version of the Android requirements that is implemented by the NFCC.
0x0000Android 15
Number of capabilities1 octetNumber (n) of supported capabilities
Capabilities[0..n](m + 2) * n octetsSupported capabilities
Type1 octetThe identifier of the capability
Len1 octetLength (m) of the value
Valuem octetsThe value of the capability
Android proprietary capabilities
Capability nameIDSizeValue/description
Observe mode0x001 octetSupport for the observe mode.
0x00 (default) - Doesn't support this feature.
0x01 - Supports the feature with RF deactivation from host (required for Android 15 or higher).
All other values are RFU.
Polling frame notification0x011 octetSupport for the polling frame notifications. 0x01 if supported, 0x00 (default) if not supported. All other values are RFU.
Power saving mode0x021 octetSupport for the power saving mode. 0x01 if supported, 0x00 (default) if not supported. All other values are RFU.
Auotransact polling loop filter0x031 octetSupport for polling loop filters in the firmware to bypass observe mode for specific patterns when observe mode is globally enabled.
0x00 (default) - Doesn't support this feature
0x01 - Supports polling loop filters
All other values are RFU
0x04..0xFF0 octetsReserved for future use

Power saving command

To transition the NFCC to power saving mode, the host can use the NCI_ANDROID_POWER_SAVING_CMD command. The NFCC must respond with NCI_ANDROID_POWER_SAVING_RSP with a status code indicating success or failure.

While in power saving mode, the host must not send any command to the NFCC and the NFCC must not send any notification or response to the host. The NFCC or embeded Secure Element (eSE) can automatically accept incoming payment requests according to the routing configuration set before enabling the power saving mode.

To return to full power mode, the host can reset or reinitialize the NFCC.

NCI_ANDROID_POWER_SAVING_CMD

Payload fieldsSizeValue/description
Power saving mode1 octet0x00Disable power saving mode
0x01Enable power saving mode

NCI_ANDROID_POWER_SAVING_RSP

Payload fieldsSizeValue/description
Status1 octetSee status codes in table 140 of NCI Specification,

Set observe mode command

To activate or deactivate observe mode, the host can use the NCI_ANDROID_PASSIVE_OBSERVE_MODE_CMD command. The NFCC must respond with NCI_ANDROID_PASSIVE_OBSERVE_MODE_RSP with a status code indicating success or failure.

When the observe mode is disabled, the NFCC must implement the standard listen mode activity as per the Activity Technical Specification.

When the observe mode is active, the NFCC must not respond to any poll requests during the polling loop in listen mode, until explicitly authorized by the host. The NFCC must send the RF_FIELD_INFO_NTF notification (as defined by section 5.3 of the NCI specification) when it detects field activation. If poll mode discovery is active, the NFCC must implement poll mode activity as per the Activity Technical Specification. The NFCC can cache the poll information so as to proceed immediately with device activation as soon as the observe mode is deactivated.

The NFCC should turn off observe mode if the host shuts down for any reason (for example, out of battery or user initiated shutdown) so that SE transactions can proceed.

NCI_ANDROID_PASSIVE_OBSERVE_MODE_CMD

Payload fieldsSizeValue/description
observe mode1 octet0x00Disable observe mode (default)
0x01Enable observe mode

NCI_ANDROID_PASSIVE_OBSERVE_MODE_RSP

Payload fieldsSizeValue/description
Status1 octetSee status codes in table 140 of NCI Specification.

Polling loop notification

The NFCC must send the NCI_ANDROID_POLLING_FRAME_NTF notification to the host after each polling loop frame. When both the RF_FIELD_INFO_NTF and NCI_ANDROID_POLLING_FRAME_NTF notifications are generated, the NFCC must send NCI_ANDROID_POLLING_FRAME_NTF after RF_FIELD_INFO_NTF.

The NCI_ANDROID_POLLING_FRAME_NTF notification is independent of whether observe mode is active or not. When observe mode is active, the NFCC must always send a NCI_ANDROID_POLLING_FRAME_NTF notification before proceeding with the transaction.

NCI_ANDROID_POLLING_FRAME_NTF

Payload fieldsSizeValue/description
Polling Data[0..n](m +3) * n octetsList of polling requests received since the last notification. Each result gives the type (technology) of the received requests and identifiable data from the request depending on the technology.
Type1 octetSee frame types.
Flags1 octetSee flag byte.
Length1 octetLength (m) of polling data report including timestamp and gain fields.
Timestamp4 octetsTimestamp measured in milliseconds of the reception of the polling requests, big endian.
Gain1 octetStrength of the polling request.
0xFF indicates that the value is not available.
Datam - 5 octetsReturns the identifiable data present in the polling request
Frame types
Polling frameTypeSizeValue/Description
Remote field0x001 octet0x00Field off
0x01Field on
0x02..0xFFRFU
NFC-A0x01n octetsValue must include an ISO 14443-3 command (for example, REQ or WUP)
NFC-B0x02n octetsValue must include an AIF byte and an ISO 14443-3 command (for example, REQ or WUP)
NFC-F0x03n octetsValue must include an ISO 14443-3 command (for example, REQ or WUP)
NFC-V0x04n octetsValue must include an ISO 14443-3 command (for example, REQ or WUP)
Unknown0x07n octetsRaw frame data
Flag byte definition
Flags
b0b1b2b3b4b5b6b7
0Short frameRFURFURFURFURFURFURFU
1Long frame

Query observe mode status command

To retrieve the current status of the passive order mode, the host can use the NCI_ANDROID_QUERY_PASSIVE_OBSERVER_STATUS_CMD command. The NFCC must respond with NCI_ANDROID_QUERY_PASSIVE_OBSERVER_STATUS_RSP with a status code indicating success of failure.

NCI_ANDROID_QUERY_PASSIVE_OBSERVER_STATUS_CMD

Payload fieldsSizeValue/description
N/A0 octets

NCI_ANDROID_QUERY_PASSIVE_OBSERVER_STATUS_RSP

Payload fieldsSizeValue/description
Status1 octetSee status codes in table 140 of NCI Specification,
observe mode1 octet0x00Observe mode disabled
0x01Observe mode enabled