Near field communications (NFC)

Overview of the Near field communications (NFC) technology.

To develop Near field communications (NFC), you need these headers:

For the programming guide, see Near field communications (NFC).

IOCTLs

 
IOCTL_NFCRM_QUERY_RADIO_STATE

This IOCTL is used by the radio management application or service to query the current radio power state of the proximity device.
IOCTL_NFCRM_SET_RADIO_STATE

This IOCTL is used by the radio management application or service to set the radio power state of the proximity device.
IOCTL_NFCSE_ENUM_ENDPOINTS

Returns information regarding the list of all the secure elements attached to the NFC controller.
IOCTL_NFCSE_GET_NEXT_EVENT

The IOCTL_NFCSE_GET_NEXT_EVENT control code returns the next event available in the buffer, or if there are no more buffered events remains pending until a secure element event is available. The event details must then be returned to the caller.
IOCTL_NFCSE_GET_NFCC_CAPABILITIES

The IOCTL_NFCSE_GET_NFCC_CAPABILITIES control code returns information about the current NFC controller capabilities, including the maximum Listen Mode Routing table size (defined in section 4.2 of the NFC Controller Interface (NCI) Technical Specification Version 1.1) and supported routing modes.
IOCTL_NFCSE_GET_ROUTING_TABLE

Returns information regarding the current configuration of listen mode routing table.
IOCTL_NFCSE_HCE_REMOTE_RECV

Either returns the next data buffer available, or if there are no more buffered data, the request shall stay pending until an APDU buffer is available for reading.
IOCTL_NFCSE_HCE_REMOTE_SEND

Transmits response APDU from DeviceHost NFCEE to remote device. The caller must be sure that response APDU is conformant to ISO-IEC 7816-4.
IOCTL_NFCSE_SET_CARD_EMULATION_MODE

The IOCTL_NFCSE_SET_CARD_EMULATION_MODE control code sets whether the specified secure element is exposed in card emulation mode.
IOCTL_NFCSE_SET_ROUTING_TABLE

Configures NFC controller listen mode routing table.
IOCTL_NFCSE_SUBSCRIBE_FOR_EVENT

The IOCTL_NFCSE_SUBSCRIBE_FOR_EVENT control code is issued by a client to subscribe to a specific event.
IOCTL_NFCSERM_QUERY_RADIO_STATE

The IOCTL_NFCSERM_QUERY_RADIO_STATE is used by the SE radio management application or service to query the current radio power state of the proximity device.
IOCTL_NFCSERM_SET_RADIO_STATE

The IOCTL_NFCSERM_SET_RADIO_STATE is used by the SE radio management application or service to set the current radio power state of the proximity device.
IOCTL_NFP_DISABLE

A client sends the IOCTL_NFP_DISABLE request to temporarily disable subscriptions, publications, and presence events.
IOCTL_NFP_ENABLE

The client sends the IOCTL_NFP_ENABLE request to re-enable previously disabled subscriptions, publications, and presence events.
IOCTL_NFP_GET_KILO_BYTES_PER_SECOND

A client sends the IOCTL_NFP_GET_KILO_BYTES_PER_SECOND request to any generic handle, one that is non-published and non-subscribed, to the provider device.
IOCTL_NFP_GET_MAX_MESSAGE_BYTES

A client sends the IOCTL_NFP_GET_MAX_MESSAGE_BYTES request to any generic handle, one that is non-published and non-subscribed, to the provider device to determine the maximum message size supported.
IOCTL_NFP_GET_NEXT_SUBSCRIBED_MESSAGE

The client sends the IOCTL_NFP_GET_NEXT_SUBSCRIBED_MESSAGE request to the subscription handle repeatedly in order to receive subscribed messages as they arrive.
IOCTL_NFP_GET_NEXT_TRANSMITTED_MESSAGE

A client interested in receiving notifications that a message has been transmitted will send the IOCTL_NFP_GET_NEXT_TRANSMITTED_MESSAGE request to the proximity driver.
IOCTL_NFP_SET_PAYLOAD

A client application sends message data and confirms publication with the IOCTL_NFP_SET_PAYLOAD request.
IOCTL_SMARTCARD_GET_ATTRIBUTE

The IOCTL_SMARTCARD_GET_ATTRIBUTE control code queries for smart card attributes.
IOCTL_SMARTCARD_GET_STATE

The IOCTL_SMARTCARD_GET_STATE control code gets the current status of the smart card.
IOCTL_SMARTCARD_IS_ABSENT

The IOCTL_SMARTCARD_IS_ABSENT control code returns immediately with STATUS_SUCCESS if no smart card is currently detected.
IOCTL_SMARTCARD_IS_PRESENT

The IOCTL_SMARTCARD_IS_PRESENT control code detects whether a smart card is currently detected.
IOCTL_SMARTCARD_POWER

Windows may require a driver to have this IOCTL to be NOP and return success.
IOCTL_SMARTCARD_SET_ATTRIBUTE

The IOCTL_SMARTCARD_SET_ATTRIBUTE control code sets an attribute and returns STATUS_SUCCESS on SCARD_ATTR_DEVICE_IN_USE; otherwise, it returns STATUS_NOT_SUPPORTED.
IOCTL_SMARTCARD_SET_PROTOCOL

Sets the procotol the driver communicates to the smart card with after the card is detected.
IOCTL_SMARTCARD_TRANSMIT

Transmits data from the client to the detected smart card in ISO7816-4 compliant APDU.

Enumerations

 
NFC_CX_CE_MODE_CONFIG

This enumeration specifies CE listening mode flags.
NFC_CX_DEVICE_MODE

Specifies device mode flags.
NFC_CX_DRIVER_FLAGS

Specifies run-time driver flags.
NFC_CX_HOST_ACTION

The NFC_CX_HOST_ACTION enumeration specifies host actions.
NFC_CX_NFCIP_MODE_CONFIG

The NFC_CX_NFCIP_MODE_CONFIG enumeration specifies the NFC-IP initiator mode.
NFC_CX_NFCIP_TGT_MODE_CONFIG

The NFC_CX_NFCIP_TGT_MODE_CONFIG enumeration specifies NFC-IP target mode.
NFC_CX_POLL_BAILOUT_CONFIG

The NFC_CX_POLL_BAILOUT_CONFIG enumeration specifies poll mode bail out.
NFC_CX_POLL_MODE_CONFIG

The NFC_CX_POLL_MODE_CONFIG enumeration specifies poll mode.
NFC_CX_SEQUENCE

The NFC_CX_SEQUENCE enumeration specifies sequences.
NFC_CX_TRANSPORT_TYPE

The NFC_CX_TRANSPORT_TYPE enumeration specifies transport types.
SECURE_ELEMENT_CARD_EMULATION_MODE

This enumeration indicates the card emulation mode of a secure element.
SECURE_ELEMENT_EVENT_TYPE

Indicates the type of secure element events.
SECURE_ELEMENT_ROUTING_TYPE

SECURE_ELEMENT_ROUTING_TYPE is a member of SECURE_ELEMENT_ROUTING_TABLE_ENTRY.
SECURE_ELEMENT_TYPE

Indicates the type of a secure element.

Functions

 
EVT_NFC_CX_DEVICE_IO_CONTROL

Called by the NFC CX to send an unhandled IOCTL to the client driver.
EVT_NFC_CX_SEQUENCE_HANDLER

Called by the NFC CX to notify the client driver to handle the specific registered sequence.
EVT_NFC_CX_WRITE_NCI_PACKET

Called by the NFC CX to send a write packet to the client driver.
NFC_CX_CLIENT_CONFIG_INIT

The NFC_CX_CLIENT_CONFIG_INIT function initializes the NFC_CX_CLIENT_CONFIG structure.
NFC_CX_LLCP_CONFIG_INIT

The NFC_CX_LLCP_CONFIG_INIT function initializes the NFC_CX_LLCP_CONFIG structure.
NFC_CX_RF_DISCOVERY_CONFIG_INIT

The NFC_CX_RF_DISCOVERY_CONFIG_INIT function initializes the NFC_CX_RF_DISCOVERY_CONFIG structure.
NfcCxDeviceDeinitialize

The NfcCxDeviceDeinitialize function (nfccx.h) deinitializes a WDF device that was created during the AddDevice routine.
NfcCxDeviceInitConfig

Called by the client driver during its AddDevice routine to perform DeviceInit functions. During this process the following I/O callback functions are also exchanged.
NfcCxDeviceInitialize

The NfcCxDeviceInitialize function (nfccx.h) initializes a WDF device that was created during the AddDevice routine.
NfcCxHardwareEvent

Called by the client driver when a hardware event occurs like D0Entry and D0Exit callbacks to start or stop the device. For drivers that require firmware download on initialization or boot-up, it is recommended to move this call to a separate work item. However, the client driver is responsible for the following.
NfcCxNciReadNotification

Called by the client driver when a read packet is available.
NfcCxRegisterSequenceHandler

Called by the client driver during initialization to register for handling specific sequences.
NfcCxSetLlcpConfig

Called by the client driver to configure the LLCP parameters.
NfcCxSetRfDiscoveryConfig

Called by the client driver to configure the RF discovery parameters.
NfcCxUnregisterSequenceHandler

Called by the client driver during device shutdown to unregister for the previously registered sequence handler callback.

Structures

 
NFC_CX_CLIENT_CONFIG

The NFC_CX_CLIENT_CONFIG structure is an input parameter to NfcCxDeviceInitConfig.
NFC_CX_HARDWARE_EVENT

The NFC_CX_HARDWARE_EVENT structure is an input parameter to NfcCxHardwareEvent.
NFC_CX_LLCP_CONFIG

The NFC_CX_LLCP_CONFIG structure is an input parameter to NfcCxSetLlcpConfig.
NFC_CX_RF_DISCOVERY_CONFIG

The NFC_CX_RF_DISCOVERY_CONFIG structure contains RF discovery configuration settings. Discovery configuration should be completed during initialization after calling NfcDxDeviceInitialize, otherwise an error is returned.
NFCCX_DRIVER_GLOBALS

The _NFCCX_DRIVER_GLOBALS structure contains global values for the Near Field Communications (NFC) CX driver.
NFCRM_RADIO_STATE

This structure is used to indicate the radio state.
NFCRM_SET_RADIO_STATE

This structure is used to set the radio state. The driver, in the case of airplane mode, has to persist the radio state and restore it when airplane mode is disabled.
SCARD_IO_REQUEST

This structure is used to identify a smart card I/O request.
SECURE_ELEMENT_AID_ROUTING_INFO

SECURE_ELEMENT_AID_ROUTING_INFO is a member of SECURE_ELEMENT_ROUTING_TABLE_ENTRY.
SECURE_ELEMENT_ENDPOINT_INFO

SECURE_ELEMENT_ENDPOINT_INFO is a member of SECURE_ELEMENT_ENDPOINT_LIST.
SECURE_ELEMENT_ENDPOINT_LIST

The output parameter for IOCTL_NFCSE_ENUM_ENDPOINTS.
SECURE_ELEMENT_EVENT_INFO

This structure provides information about a secure element event.
SECURE_ELEMENT_EVENT_SUBSCRIPTION_INFO

The SECURE_ELEMENT_EVENT_SUBSCRIPTION_INFO structure is an input parameter to IOCTL_NFCSE_SUBSCRIBE_FOR_EVENT.
SECURE_ELEMENT_HCE_ACTIVATION_PAYLOAD

The _SECURE_ELEMENT_HCE_ACTIVATION_PAYLOAD structure contains a unique connection identifier and NFC Forum RF technology and protocol types.
SECURE_ELEMENT_HCE_DATA_PACKET

SECURE_ELEMENT_HCE_DATA_PACKET is an input buffer to IOCTL_NFCSE_HCE_REMOTE_SEND and output buffer for IOCTL_NFCSE_HCE_REMOTE_RECV.
SECURE_ELEMENT_NFCC_CAPABILITIES

SECURE_ELEMENT_NFCC_CAPABILITIES contains NFC controller capabilities.
SECURE_ELEMENT_PROTO_ROUTING_INFO

SECURE_ELEMENT_PROTO_ROUTING_INFO is a member of SECURE_ELEMENT_ROUTING_TABLE_ENTRY.
SECURE_ELEMENT_ROUTING_TABLE

SECURE_ELEMENT_ROUTING_TABLE is an input parameter for IOCTL_NFCSE_SET_ROUTING_TABLE.
SECURE_ELEMENT_ROUTING_TABLE_ENTRY

SECURE_ELEMENT_ROUTING_TABLE_ENTRY is a member of SECURE_ELEMENT_ROUTING_TABLE.
SECURE_ELEMENT_SET_CARD_EMULATION_MODE_INFO

SECURE_ELEMENT_SET_CARD_EMULATION_MODE_INFO is the input parameter for IOCTL_NFCSE_SET_CARD_EMULATION_MODE.
SECURE_ELEMENT_TECH_ROUTING_INFO

SECURE_ELEMENT_TECH_ROUTING_INFO is a member of SECURE_ELEMENT_ROUTING_TABLE_ENTRY.