Skip to content

Commit 85c640e

Browse files
matter: Implement NFC commissioning manger
Updated sdk-connectedhomeip to fetch nRFConnect commissioning manager implementation. Adjusted Matter Init and Event Handler to work with NFC commissioning. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
1 parent 7b257de commit 85c640e

19 files changed

Lines changed: 128 additions & 4 deletions

File tree

docs/bridge/matter_bridge_description.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,12 @@ The |matter_type| supports the following build configurations:
422422

423423
.. include:: /includes/configuration/basic_internal_53ek.txt
424424

425+
Advanced configuration options
426+
==============================
427+
428+
.. include:: /includes/configuration/advanced/intro.txt
429+
.. include:: /includes/configuration/advanced/nfc_commissioning.txt
430+
425431
.. _matter_bridge_app_bridged_support_configs:
426432

427433
Bridged device configuration
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
NFC-based commissioning
2+
-----------------------
3+
4+
.. toggle::
5+
6+
You can commission a Matter accessory over NFC using the Matter NFC Transport Layer (NTL).
7+
The device emulates a Type 4 Tag and exposes both the Matter application and a standard NDEF Tag Application with the onboarding payload.
8+
9+
NFC tags can support either ``powered mode``, in which the device is fully powered on by its own power supply during NFC operation, or ``unpowered mode``, where the tag operates exclusively using energy harvested from the NFC polling device (such as a phone).
10+
The NFC-based commissioning feature in Nordic Matter SDK supports only ``powered mode``.
11+
The Nordic SoC must be on and running (not only powered by NFC field) for NFC-based commissioning to work.
12+
Ensure that your application's power arrangements match this requirement, as many NFC use cases commonly advertise unpowered operation, but this implementation does not.
13+
14+
This feature requires a board with the on-chip NFCT peripheral and an NFC antenna connected.
15+
It is supported on Nordic DK targets that provide NFCT, such as the nRF52840 DK, nRF5340 DK, nRF54L15 DK, and nRF54LM20 DK.
16+
17+
.. note::
18+
You cannot use NFC-based commissioning if the :kconfig:option:`CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` Kconfig option is enabled.
19+
This Kconfig option may be enabled in Matter samples by default.
20+
21+
To enable NFC-based commissioning, set the :kconfig:option:`CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` kconfig option to ``n`` and the :kconfig:option:`CONFIG_CHIP_NFC_BASED_COMMISSIONING` Kconfig option to ``y``
22+
23+
You can also use the following related option:
24+
25+
* :kconfig:option:`CONFIG_CHIP_NFC_BASED_COMMISSIONING_APDU_DEBUG` - Enables additional debug logging of ISO-DEP APDU traffic.
26+
27+
Commissioning flow:
28+
29+
* As soon as the Matter server finishes initializing, the NFC tag serves an NDEF onboarding payload that advertises the NFC rendezvous flag.
30+
Tap the tag with a commissioner that supports Matter NTL to start commissioning; no button press is required.
31+
The setup code is also printed to the UART log with the NFC rendezvous flag.
32+
* Once commissioning completes successfully, NFC tag emulation is automatically stopped.
33+
34+
.. note::
35+
While NFC-based commissioning is active, commissioning over Bluetooth LE might take longer than usual.
36+
The device first attempts to use NFC and only falls back to Bluetooth LE afterwards, which delays the Bluetooth LE pairing.
37+
A log message is printed when Bluetooth LE commissioning is attempted while NFC commissioning is still active.
38+
39+
Build a |matter_type| with NFC-based commissioning support as follows:
40+
41+
.. tabs::
42+
43+
.. group-tab:: |nRFVSC|
44+
45+
Add ``-DCONFIG_CHIP_NFC_BASED_COMMISSIONING=y``, and ``-DCONFIG_CHIP_NFC_ONBOARDING_PAYLOAD=n`` to :guilabel:`Extra CMake arguments` in your build configuration.
46+
47+
.. group-tab:: Command line
48+
49+
.. code-block:: console
50+
51+
west build -p -b <board_target> -- -DCONFIG_CHIP_NFC_ONBOARDING_PAYLOAD=n -DCONFIG_CHIP_NFC_BASED_COMMISSIONING=y
52+
53+
Replace ``<board_target>`` with a supported board target, for example ``nrf52840dk/nrf52840``.

docs/matter/getting_started/advanced_kconfigs.rst

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,33 @@ You can configure when the device will start advertising and how long it will ad
3737
Commissioning with NFC
3838
======================
3939

40-
You can configure the Matter protocol to use NFC tag for commissioning, instead of the default QR code.
40+
The Matter protocol can be configured to utilize an NFC tag for the following purposes:
4141

42-
To enable NFC for sharing the onboarding payload in an NFC tag, set the :kconfig:option:`CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` Kconfig option.
42+
* Device onboarding, as an alternative to using a QR code.
43+
* Complete device commissioning, providing an option other than Bluetooth LE.
44+
45+
To share the onboarding payload in a simple NFC Type 2 Tag, set the :kconfig:option:`CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` Kconfig option.
46+
This mode only emulates the setup code in an NDEF message and still uses Bluetooth LE for the commissioning session.
47+
48+
For full commissioning over NFC on Nordic Semiconductor DKs with the NFCT peripheral, set the :kconfig:option:`CONFIG_CHIP_NFC_BASED_COMMISSIONING` Kconfig option instead.
49+
This enables the Matter NFC Transport Layer (NTL) on the accessory side and serves the onboarding payload from the NDEF Tag Application, in addition to the regular Bluetooth LE commissioning.
50+
As soon as the Matter server finishes initializing, the onboarding payload with the NFC rendezvous flag is written to the NFC tag.
51+
Commission the device by tapping the tag with an NFC commissioner that supports Matter NTL; no button press is required.
52+
The setup code is also printed to the UART log with the NFC rendezvous flag.
53+
Once commissioning completes successfully, NFC tag emulation is automatically stopped.
54+
See the :ref:`matter_template_sample` for an example build configuration with the :kconfig:option:`CONFIG_CHIP_NFC_BASED_COMMISSIONING` Kconfig option set to ``y``
55+
56+
.. note::
57+
:kconfig:option:`CONFIG_CHIP_NFC_BASED_COMMISSIONING` and :kconfig:option:`CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` are mutually exclusive.
58+
59+
For more details about enabling and using NFC-based commissioning in |NCS| Matter samples, see the :ref:`matter_template_sample` advanced configuration section.
4360

4461
.. _ug_matter_configuring_optional_persistent_subscriptions:
4562

4663
Persistent subscriptions
4764
========================
4865

49-
You can configure the Matter protocol to keep Matter subscriptions on the publisher node.
66+
The Matter protocol can be configured to use an NFC tag for the following purposes:
5067
This allows the device to save information about subscriptions and use it to re-establish the subscriptions immediately when coming back online after being offline for a longer time, for example due to a power outage.
5168
This is a much faster way than waiting for the subscriber node to notice that the publisher node is again available in the network.
5269

docs/release_notes/release_notes_v100.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ Added:
1919
* The Matter samples and applications migrated from the |NCS|.
2020
* The Matter configuration options migrated from the |NCS|.
2121
* The Matter software maturity levels migrated from the |NCS|.
22+
* The NFC Commissioning Manager implementation.
23+
See :ref:`ug_matter_configuring_optional_nfc` for more details.
2224

2325
* Integration of |addon| with the |NCS| v3.4.0.

samples/closure/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Advanced configuration options
8383
.. include:: /includes/configuration/advanced/factory_data.txt
8484
.. include:: /includes/configuration/advanced/custom_board.txt
8585
.. include:: /includes/configuration/advanced/internal_memory.txt
86+
.. include:: /includes/configuration/advanced/nfc_commissioning.txt
8687

8788
User interface
8889
**************

samples/contact_sensor/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Advanced configuration options
7575
.. include:: /includes/configuration/advanced/factory_data.txt
7676
.. include:: /includes/configuration/advanced/custom_board.txt
7777
.. include:: /includes/configuration/advanced/internal_memory.txt
78+
.. include:: /includes/configuration/advanced/nfc_commissioning.txt
7879

7980
User interface
8081
**************

samples/light_bulb/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Advanced configuration options
8080
.. include:: /includes/configuration/advanced/factory_data.txt
8181
.. include:: /includes/configuration/advanced/custom_board.txt
8282
.. include:: /includes/configuration/advanced/internal_memory.txt
83+
.. include:: /includes/configuration/advanced/nfc_commissioning.txt
8384

8485
User interface
8586
**************

samples/light_switch/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Advanced configuration options
9797
.. include:: /includes/configuration/advanced/factory_data.txt
9898
.. include:: /includes/configuration/advanced/custom_board.txt
9999
.. include:: /includes/configuration/advanced/internal_memory.txt
100+
.. include:: /includes/configuration/advanced/nfc_commissioning.txt
100101

101102
.. _matter_light_switch_sample_lit_icd:
102103

samples/manufacturer_specific/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Advanced configuration options
8787
.. include:: /includes/configuration/advanced/factory_data.txt
8888
.. include:: /includes/configuration/advanced/custom_board.txt
8989
.. include:: /includes/configuration/advanced/internal_memory.txt
90+
.. include:: /includes/configuration/advanced/nfc_commissioning.txt
9091

9192
User interface
9293
**************

samples/smoke_co_alarm/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Advanced configuration options
9797
.. include:: /includes/configuration/advanced/factory_data.txt
9898
.. include:: /includes/configuration/advanced/custom_board.txt
9999
.. include:: /includes/configuration/advanced/internal_memory.txt
100+
.. include:: /includes/configuration/advanced/nfc_commissioning.txt
100101

101102
User interface
102103
**************

0 commit comments

Comments
 (0)