From 196bf00712463ab14a257154429a653f3f25391e Mon Sep 17 00:00:00 2001 From: Olivier Lorente Date: Tue, 19 Nov 2024 13:30:11 +0100 Subject: [PATCH 01/15] Renaming prior to the delivery of the work about "NFC Commissioning". In current code, "NFC Commissioning" was used for Onboarding Payload data put into an NFC Tag. This naming will create confusion with the new "NFC Commissioning" feature where NFC is used as the commissioning channel. We propose to use the folllowing names: - "NFC onboarding payload" when an NFC Tag is used to store the onboarding payload data (as an alternate solution to QRCode) - "NFC commissioning" when an NFC Tag is used to perform the first commissioning phase (as an alternate solution to BLE) Defines, variables and files have been renamed to reflect this. The following renaming have been done: - CHIP_DEVICE_CONFIG_ENABLE_NFC -> CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD - CONFIG_CHIP_NFC_COMMISSIONING -> CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD - chip_enable_nfc -> chip_enable_nfc_onboarding_payload - NFCManager -> NFCOnboardingPayloadManager - NFCManagerImpl -> NFCOnboardingPayloadManagerImpl - NFCMgr -> NFCOnboardingMgr - NFCMgrImpl -> NFCOnboardingPayloadMgrImpl The following files have been renamed for the platforms Zephyr, nrfconnect, nxp/k32w0 and telink: NFCManagerImpl.cpp -> NFCOnboardingPayloadManagerImpl.cpp NFCManagerImpl.h -> NFCOnboardingPayloadManagerImpl.h NFCManager.h -> NFCOnboardingPayloadManager.h --- config/nrfconnect/chip-module/CMakeLists.txt | 4 +- config/qpg/chip-gn/args.gni | 2 +- config/telink/chip-module/CMakeLists.txt | 4 +- .../nrf/nrfconnect_examples_configuration.md | 10 ++-- .../nrfconnect/main/AppTask.cpp | 6 +- .../nrfconnect/main/AppTask.cpp | 6 +- .../nxp/k32w0/main/AppTask.cpp | 8 +-- .../k32w1/include/config/CHIPProjectConfig.h | 8 +-- .../mcxw71/include/config/CHIPProjectConfig.h | 8 +-- .../nrfconnect/main/AppTask.cpp | 6 +- .../lighting-app/nrfconnect/main/AppTask.cpp | 6 +- .../lighting-app/nxp/k32w0/main/AppTask.cpp | 8 +-- .../k32w1/include/config/CHIPProjectConfig.h | 8 +-- .../mcxw71/include/config/CHIPProjectConfig.h | 8 +-- .../lit-icd-app/nrfconnect/main/AppTask.cpp | 6 +- examples/lock-app/nrfconnect/main/AppTask.cpp | 6 +- .../lock-app/nxp/k32w/k32w0/main/AppTask.cpp | 8 +-- .../k32w1/include/config/CHIPProjectConfig.h | 8 +-- .../mcxw71/include/config/CHIPProjectConfig.h | 8 +-- .../telink/common/src/AppTaskCommon.cpp | 6 +- examples/pump-app/nrfconnect/main/AppTask.cpp | 6 +- .../nrfconnect/main/AppTask.cpp | 6 +- .../window-app/nrfconnect/main/AppTask.cpp | 6 +- src/app/server/OnboardingCodesUtil.cpp | 4 +- src/include/platform/CHIPDeviceConfig.h | 6 +- src/include/platform/CHIPDeviceLayer.h | 4 +- ...anager.h => NFCOnboardingPayloadManager.h} | 58 +++++++++---------- .../internal/GenericPlatformManagerImpl.ipp | 8 +-- src/lib/shell/Engine.cpp | 2 +- src/lib/shell/commands/BUILD.gn | 2 +- src/lib/shell/commands/NFC.cpp | 4 +- src/platform/BUILD.gn | 6 +- src/platform/Zephyr/BUILD.gn | 6 +- ...pp => NFCOnboardingPayloadManagerImpl.cpp} | 10 ++-- ...pl.h => NFCOnboardingPayloadManagerImpl.h} | 22 +++---- src/platform/device.gni | 4 +- src/platform/nrfconnect/BUILD.gn | 6 +- ...pl.h => NFCOnboardingPayloadManagerImpl.h} | 4 +- .../nxp/common/ble/BLEManagerCommon.cpp | 2 +- src/platform/nxp/k32w0/BUILD.gn | 4 +- ...pp => NFCOnboardingPayloadManagerImpl.cpp} | 26 ++++----- ...pl.h => NFCOnboardingPayloadManagerImpl.h} | 22 +++---- src/platform/stm32/args.gni | 4 +- src/platform/telink/BUILD.gn | 6 +- ...pp => NFCOnboardingPayloadManagerImpl.cpp} | 10 ++-- ...pl.h => NFCOnboardingPayloadManagerImpl.h} | 20 +++---- 46 files changed, 196 insertions(+), 196 deletions(-) rename src/include/platform/{NFCManager.h => NFCOnboardingPayloadManager.h} (54%) rename src/platform/Zephyr/{NFCManagerImpl.cpp => NFCOnboardingPayloadManagerImpl.cpp} (89%) rename src/platform/Zephyr/{NFCManagerImpl.h => NFCOnboardingPayloadManagerImpl.h} (63%) rename src/platform/nrfconnect/{NFCManagerImpl.h => NFCOnboardingPayloadManagerImpl.h} (82%) rename src/platform/nxp/k32w0/{NFCManagerImpl.cpp => NFCOnboardingPayloadManagerImpl.cpp} (89%) rename src/platform/nxp/k32w0/{NFCManagerImpl.h => NFCOnboardingPayloadManagerImpl.h} (77%) rename src/platform/telink/{NFCManagerImpl.cpp => NFCOnboardingPayloadManagerImpl.cpp} (87%) rename src/platform/telink/{NFCManagerImpl.h => NFCOnboardingPayloadManagerImpl.h} (66%) diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 448287f0ecd4cf..e904da06e0db25 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -88,7 +88,7 @@ matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD}) # Set up custom OpenThread configuration if (CONFIG_CHIP_OPENTHREAD_CONFIG) - get_filename_component(CHIP_OPENTHREAD_CONFIG + get_filename_component(CHIP_OPENTHREAD_CONFIG ${CONFIG_CHIP_OPENTHREAD_CONFIG} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR} @@ -125,7 +125,7 @@ matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_ matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_CHIP_IPV4) -matter_add_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING) +matter_add_gn_arg_bool ("chip_enable_nfc_onboarding_payload" CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD) matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) matter_add_gn_arg_bool ("chip_persist_subscriptions" CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS) matter_add_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS) diff --git a/config/qpg/chip-gn/args.gni b/config/qpg/chip-gn/args.gni index cccb41016a6bd2..2e5afbbfa98f10 100644 --- a/config/qpg/chip-gn/args.gni +++ b/config/qpg/chip-gn/args.gni @@ -24,7 +24,7 @@ lwip_debug = false chip_enable_openthread = true chip_config_network_layer_ble = true chip_inet_config_enable_ipv4 = false -chip_enable_nfc = false +chip_enable_nfc_onboarding_payload = false chip_build_tests = false chip_monolithic_tests = false chip_inet_config_enable_tcp_endpoint = false diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 0f925cdeffc904..bb42a26b6ffc06 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -69,7 +69,7 @@ matter_add_flags(-DMBEDTLS_USER_CONFIG_FILE=) # Set up custom OpenThread configuration if (CONFIG_CHIP_OPENTHREAD_CONFIG) - get_filename_component(CHIP_OPENTHREAD_CONFIG + get_filename_component(CHIP_OPENTHREAD_CONFIG ${CONFIG_CHIP_OPENTHREAD_CONFIG} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR} @@ -96,7 +96,7 @@ matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_ matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_CHIP_IPV4) -matter_add_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING) +matter_add_gn_arg_bool ("chip_enable_nfc_onboarding_payload" CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD) matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" FALSE) matter_add_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1) diff --git a/docs/platforms/nrf/nrfconnect_examples_configuration.md b/docs/platforms/nrf/nrfconnect_examples_configuration.md index d2a135ebdf6d9a..1f05c747f895ee 100644 --- a/docs/platforms/nrf/nrfconnect_examples_configuration.md +++ b/docs/platforms/nrf/nrfconnect_examples_configuration.md @@ -194,13 +194,13 @@ intervals: - `CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL` - `CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL` -#### Commissioning with NFC support +#### Onboarding with NFC support -You can configure the Matter protocol to use an NFC tag for commissioning, -instead of using a QR code, which is the default configuration. +You can configure the Matter protocol to use an NFC tag for onboarding, instead +of using a QR code, which is the default configuration. -To enable NFC for commissioning and share the onboarding payload in an NFC tag, -set the `CONFIG_CHIP_NFC_COMMISSIONING` option. +To enable NFC for onboarding and share the onboarding payload in an NFC tag, set +the `CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` option. #### Factory reset behavior diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp index 44a0a056bf44f2..f0f096ffcc398c 100644 --- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp @@ -489,10 +489,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -503,7 +503,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp index 9254d52d270ee4..64331a3200c9c5 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp @@ -408,10 +408,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -422,7 +422,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp index f9fe8ef8cd5c7a..9ac0c918159fa9 100644 --- a/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp +++ b/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp @@ -781,23 +781,23 @@ void AppTask::MatterEventHandler(const ChipDeviceEvent * event, intptr_t) } #endif -#if CONFIG_CHIP_NFC_COMMISSIONING +#if CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange && event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - if (!NFCMgr().IsTagEmulationStarted()) + if (!NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { K32W_LOG("NFC Tag emulation is already stopped!"); } else { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); K32W_LOG("Stopped NFC Tag Emulation!"); } } else if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange && event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { K32W_LOG("NFC Tag emulation is already started!"); } diff --git a/examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h index a16c1bb8b3341c..3f788402286da6 100644 --- a/examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h +++ b/examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h @@ -173,12 +173,12 @@ #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) /** - * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC commissioning is not supported on K32W1 + * NFC onboarding is not supported on K32W1 */ -#define CONFIG_CHIP_NFC_COMMISSIONING 0 -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 +#define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 /** * @def CHIP_CONFIG_MAX_FABRICS diff --git a/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h index 9e5cee6eb7b695..1386b9fbf80d00 100644 --- a/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h +++ b/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -172,12 +172,12 @@ #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) /** - * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC commissioning is not supported on K32W1 + * NFC onboarding is not supported on K32W1 */ -#define CONFIG_CHIP_NFC_COMMISSIONING 0 -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 +#define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 /** * @def CHIP_CONFIG_MAX_FABRICS diff --git a/examples/light-switch-app/nrfconnect/main/AppTask.cpp b/examples/light-switch-app/nrfconnect/main/AppTask.cpp index 152e175afd1ad6..a7420e44c44f5b 100644 --- a/examples/light-switch-app/nrfconnect/main/AppTask.cpp +++ b/examples/light-switch-app/nrfconnect/main/AppTask.cpp @@ -468,10 +468,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ { case DeviceEventType::kCHIPoBLEAdvertisingChange: UpdateStatusLED(); -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -482,7 +482,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/examples/lighting-app/nrfconnect/main/AppTask.cpp b/examples/lighting-app/nrfconnect/main/AppTask.cpp index 754b8db0b5d892..93f5cf44c0f26e 100644 --- a/examples/lighting-app/nrfconnect/main/AppTask.cpp +++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp @@ -601,10 +601,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -615,7 +615,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/examples/lighting-app/nxp/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w0/main/AppTask.cpp index c6d3baf575a254..62221a23f1a6f1 100644 --- a/examples/lighting-app/nxp/k32w0/main/AppTask.cpp +++ b/examples/lighting-app/nxp/k32w0/main/AppTask.cpp @@ -680,23 +680,23 @@ void AppTask::MatterEventHandler(const ChipDeviceEvent * event, intptr_t) } #endif -#if CONFIG_CHIP_NFC_COMMISSIONING +#if CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange && event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - if (!NFCMgr().IsTagEmulationStarted()) + if (!NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { K32W_LOG("NFC Tag emulation is already stopped!"); } else { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); K32W_LOG("Stopped NFC Tag Emulation!"); } } else if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange && event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { K32W_LOG("NFC Tag emulation is already started!"); } diff --git a/examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h index ad5d876dc650ab..997e0265cc2a9a 100644 --- a/examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h @@ -188,12 +188,12 @@ #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) /** - * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC commissioning is not supported on K32W1 + * NFC onboarding is not supported on K32W1 */ -#define CONFIG_CHIP_NFC_COMMISSIONING 0 -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 +#define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 /** * @def CHIP_CONFIG_MAX_FABRICS diff --git a/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h index 20f126aa23a0d5..0ac0af934b29e1 100644 --- a/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -188,12 +188,12 @@ #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) /** - * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC commissioning is not supported on K32W1 + * NFC onboarding is not supported on K32W1 */ -#define CONFIG_CHIP_NFC_COMMISSIONING 0 -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 +#define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 /** * @def CHIP_CONFIG_MAX_FABRICS diff --git a/examples/lit-icd-app/nrfconnect/main/AppTask.cpp b/examples/lit-icd-app/nrfconnect/main/AppTask.cpp index ca16beda30de8a..64000faa677b23 100644 --- a/examples/lit-icd-app/nrfconnect/main/AppTask.cpp +++ b/examples/lit-icd-app/nrfconnect/main/AppTask.cpp @@ -489,10 +489,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -503,7 +503,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index 9919fd8374f2d4..0706374befff8b 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -549,10 +549,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -563,7 +563,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp index 4cfcd3942369f4..cda08552ca2edf 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -610,23 +610,23 @@ void AppTask::MatterEventHandler(const ChipDeviceEvent * event, intptr_t) } } -#if CONFIG_CHIP_NFC_COMMISSIONING +#if CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange && event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - if (!NFCMgr().IsTagEmulationStarted()) + if (!NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { K32W_LOG("NFC Tag emulation is already stopped!"); } else { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); K32W_LOG("Stopped NFC Tag Emulation!"); } } else if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange && event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { K32W_LOG("NFC Tag emulation is already started!"); } diff --git a/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h index 6bb18eef5a0fc9..bc28103d1f63e0 100644 --- a/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h @@ -172,12 +172,12 @@ #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) /** - * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC commissioning is not supported on K32W1 + * NFC onboarding is not supported on K32W1 */ -#define CONFIG_CHIP_NFC_COMMISSIONING 0 -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 +#define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 /** * @def CHIP_CONFIG_MAX_FABRICS diff --git a/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h index 984dd98b3adb6c..d5bc4891f53cb8 100644 --- a/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -172,12 +172,12 @@ #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000) /** - * CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC + * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC commissioning is not supported on K32W1 + * NFC onboarding is not supported on K32W1 */ -#define CONFIG_CHIP_NFC_COMMISSIONING 0 -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 +#define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 +#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 /** * @def CHIP_CONFIG_MAX_FABRICS diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index df1d3086ef2543..860fc7115ecc93 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -729,10 +729,10 @@ void AppTaskCommon::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* case DeviceEventType::kCHIPoBLEAdvertisingChange: sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; UpdateStatusLED(); -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -743,7 +743,7 @@ void AppTaskCommon::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif break; diff --git a/examples/pump-app/nrfconnect/main/AppTask.cpp b/examples/pump-app/nrfconnect/main/AppTask.cpp index 526f3b67531ad9..45fcc3d5492338 100644 --- a/examples/pump-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-app/nrfconnect/main/AppTask.cpp @@ -470,10 +470,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -484,7 +484,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp index a986a2c2ceca75..0fe9554ceafe76 100644 --- a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp @@ -444,10 +444,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -458,7 +458,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index 2cfbab9a6b6c47..1ec6df1c88ee81 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -563,10 +563,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: -#ifdef CONFIG_CHIP_NFC_COMMISSIONING +#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) { - if (NFCMgr().IsTagEmulationStarted()) + if (NFCOnboardingPayloadMgr().IsTagEmulationStarted()) { LOG_INF("NFC Tag emulation is already started"); } @@ -577,7 +577,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */ } else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) { - NFCMgr().StopTagEmulation(); + NFCOnboardingPayloadMgr().StopTagEmulation(); } #endif sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; diff --git a/src/app/server/OnboardingCodesUtil.cpp b/src/app/server/OnboardingCodesUtil.cpp index e851fb96aec332..7f78da41695ff4 100644 --- a/src/app/server/OnboardingCodesUtil.cpp +++ b/src/app/server/OnboardingCodesUtil.cpp @@ -88,7 +88,7 @@ void PrintQrCodeURL(const chip::MutableCharSpan qrCode) } } -#if CHIP_DEVICE_CONFIG_ENABLE_NFC +#if CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD void ShareQRCodeOverNFC(chip::RendezvousInformationFlags aRendezvousFlags) { // Get QR Code and emulate its content using NFC tag @@ -97,7 +97,7 @@ void ShareQRCodeOverNFC(chip::RendezvousInformationFlags aRendezvousFlags) ReturnOnFailure(GetQRCode(qrCode, chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE))); - ReturnOnFailure(NFCMgr().StartTagEmulation(qrCode.data(), qrCode.size())); + ReturnOnFailure(NFCOnboardingPayloadMgr().StartTagEmulation(qrCode.data(), qrCode.size())); } #endif diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index 87fdfad76a531c..b077868cb3423f 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -1579,10 +1579,10 @@ static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN <= CHIP_DEVICE #endif /** - * CHIP_DEVICE_CONFIG_ENABLE_NFC enables NFC communication for commissioning. + * CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD enables configuration of NFC onboarding payload. */ -#ifndef CHIP_DEVICE_CONFIG_ENABLE_NFC -#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 +#ifndef CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD +#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 #endif /** diff --git a/src/include/platform/CHIPDeviceLayer.h b/src/include/platform/CHIPDeviceLayer.h index 5d4348cc269948..fdd5de438dbcce 100644 --- a/src/include/platform/CHIPDeviceLayer.h +++ b/src/include/platform/CHIPDeviceLayer.h @@ -34,8 +34,8 @@ #if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD -#if CHIP_DEVICE_CONFIG_ENABLE_NFC -#include +#if CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD +#include #endif namespace chip { diff --git a/src/include/platform/NFCManager.h b/src/include/platform/NFCOnboardingPayloadManager.h similarity index 54% rename from src/include/platform/NFCManager.h rename to src/include/platform/NFCOnboardingPayloadManager.h index 08a0dbbb9ce82e..71a720be1838a2 100644 --- a/src/include/platform/NFCManager.h +++ b/src/include/platform/NFCOnboardingPayloadManager.h @@ -29,20 +29,20 @@ namespace chip { namespace DeviceLayer { -class NFCManagerImpl; +class NFCOnboardingPayloadManagerImpl; /** - * @brief Defines an abstract interface for programming an NFC Tag. + * @brief Defines an abstract interface for programming onboarding data in an NFC Tag. * - * NFC Tag can be used in Project CHIP to share commissioning information such + * NFC Tag can be used in Project CHIP to share onboarding information such * as the device discriminator and PIN code with a commissioner. This class * provides an interface to set contents of a programmable NFC Tag. */ -class NFCManager +class NFCOnboardingPayloadManager { public: /** - * Initializes the NFCManager singleton object. + * Initializes the NFCOnboardingPayloadManager singleton object. * * @return CHIP_NO_ERROR On success. */ @@ -75,70 +75,70 @@ class NFCManager protected: // Construction/destruction limited to subclasses. - NFCManager() = default; - ~NFCManager() = default; + NFCOnboardingPayloadManager() = default; + ~NFCOnboardingPayloadManager() = default; // No copy, move or assignment. - NFCManager(const NFCManager &) = delete; - NFCManager(NFCManager &&) = delete; - void operator=(const NFCManager &) = delete; + NFCOnboardingPayloadManager(const NFCOnboardingPayloadManager &) = delete; + NFCOnboardingPayloadManager(NFCOnboardingPayloadManager &&) = delete; + void operator=(const NFCOnboardingPayloadManager &) = delete; - // NFCManager implementation getters. - NFCManagerImpl * Impl(); - const NFCManagerImpl * Impl() const; + // NFCOnboardingPayloadManager implementation getters. + NFCOnboardingPayloadManagerImpl * Impl(); + const NFCOnboardingPayloadManagerImpl * Impl() const; }; /** - * Returns a reference to the public interface of the NFCManager singleton object. + * Returns a reference to the public interface of the NFCOnboardingPayloadManager singleton object. */ -extern NFCManager & NFCMgr(); +extern NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr(); /** - * Returns a reference to the platform-specific NFCManager singleton object. + * Returns a reference to the platform-specific NFCOnboardingPayloadManager singleton object. */ -extern NFCManagerImpl & NFCMgrImpl(); +extern NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl(); } // namespace DeviceLayer } // namespace chip -#ifdef EXTERNAL_NFCMANAGERIMPL_HEADER -#include EXTERNAL_NFCMANAGERIMPL_HEADER +#ifdef EXTERNAL_NFC_ONBOARDING_PAYLOAD_MANAGER_IMPL_HEADER +#include EXTERNAL_NFC_ONBOARDING_PAYLOAD_MANAGER_IMPL_HEADER #elif defined(CHIP_DEVICE_LAYER_TARGET) -#define NFCMANAGERIMPL_HEADER -#include NFCMANAGERIMPL_HEADER +#define NFC_ONBOARDING_PAYLOAD_MANAGER_IMPL_HEADER +#include NFC_ONBOARDING_PAYLOAD_MANAGER_IMPL_HEADER #endif // defined(CHIP_DEVICE_LAYER_TARGET) namespace chip { namespace DeviceLayer { -inline CHIP_ERROR NFCManager::Init() +inline CHIP_ERROR NFCOnboardingPayloadManager::Init() { return Impl()->_Init(); } -inline CHIP_ERROR NFCManager::StartTagEmulation(const char * payload, size_t payloadLength) +inline CHIP_ERROR NFCOnboardingPayloadManager::StartTagEmulation(const char * payload, size_t payloadLength) { return Impl()->_StartTagEmulation(payload, payloadLength); } -inline CHIP_ERROR NFCManager::StopTagEmulation() +inline CHIP_ERROR NFCOnboardingPayloadManager::StopTagEmulation() { return Impl()->_StopTagEmulation(); } -inline bool NFCManager::IsTagEmulationStarted() const +inline bool NFCOnboardingPayloadManager::IsTagEmulationStarted() const { return Impl()->_IsTagEmulationStarted(); } -inline NFCManagerImpl * NFCManager::Impl() +inline NFCOnboardingPayloadManagerImpl * NFCOnboardingPayloadManager::Impl() { - return static_cast(this); + return static_cast(this); } -inline const NFCManagerImpl * NFCManager::Impl() const +inline const NFCOnboardingPayloadManagerImpl * NFCOnboardingPayloadManager::Impl() const { - return static_cast(this); + return static_cast(this); } } // namespace DeviceLayer diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.ipp b/src/include/platform/internal/GenericPlatformManagerImpl.ipp index 589dd4ccbe4584..b955fd27417cca 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl.ipp @@ -119,11 +119,11 @@ CHIP_ERROR GenericPlatformManagerImpl::_InitChipStack() } SuccessOrExit(err); - // Initialize the NFC Manager. -#if CHIP_DEVICE_CONFIG_ENABLE_NFC - err = NFCMgr().Init(); + // Initialize the CHIP NFC manager for NFC Onboarding +#if CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD + err = NFCOnboardingPayloadMgr().Init(); VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(DeviceLayer, "NFC Manager initialization failed: %" CHIP_ERROR_FORMAT, err.Format())); + ChipLogError(DeviceLayer, "NFC Onboarding Manager initialization failed: %" CHIP_ERROR_FORMAT, err.Format())); #endif // TODO Initialize CHIP Event Logging. diff --git a/src/lib/shell/Engine.cpp b/src/lib/shell/Engine.cpp index ac914012819d66..4ed8f83c48a8e6 100644 --- a/src/lib/shell/Engine.cpp +++ b/src/lib/shell/Engine.cpp @@ -119,7 +119,7 @@ void Engine::RegisterDefaultCommands() RegisterDeviceCommands(); RegisterOnboardingCodesCommands(); #endif -#if CHIP_DEVICE_CONFIG_ENABLE_NFC +#if CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD RegisterNFCCommands(); #endif RegisterDnsCommands(); diff --git a/src/lib/shell/commands/BUILD.gn b/src/lib/shell/commands/BUILD.gn index f3da2760f641b1..a0a8052a6402c6 100644 --- a/src/lib/shell/commands/BUILD.gn +++ b/src/lib/shell/commands/BUILD.gn @@ -46,7 +46,7 @@ source_set("commands") { sources += [ "BLE.cpp" ] } - if (chip_enable_nfc && chip_device_platform != "none") { + if (chip_enable_nfc_onboarding_payload && chip_device_platform != "none") { sources += [ "NFC.cpp" ] } diff --git a/src/lib/shell/commands/NFC.cpp b/src/lib/shell/commands/NFC.cpp index 78d2cc841b66df..5311c638e88944 100644 --- a/src/lib/shell/commands/NFC.cpp +++ b/src/lib/shell/commands/NFC.cpp @@ -37,7 +37,7 @@ static CHIP_ERROR NFCHandler(int argc, char ** argv) VerifyOrReturnError(argc == 1, error = CHIP_ERROR_INVALID_ARGUMENT); - nfcEnabled = chip::DeviceLayer::NFCMgr().IsTagEmulationStarted(); + nfcEnabled = chip::DeviceLayer::NFCOnboardingPayloadMgr().IsTagEmulationStarted(); if (strcmp(argv[0], "start") == 0) { @@ -55,7 +55,7 @@ static CHIP_ERROR NFCHandler(int argc, char ** argv) { if (nfcEnabled) { - chip::DeviceLayer::NFCMgr().StopTagEmulation(); + chip::DeviceLayer::NFCOnboardingPayloadMgr().StopTagEmulation(); streamer_printf(sout, "NFC tag emulation stopped\r\n"); } else diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 7f0b7ff87a1b16..0851d4e7e66681 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -152,10 +152,10 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ] } - if (chip_enable_nfc) { + if (chip_enable_nfc_onboarding_payload) { defines += [ - "CHIP_DEVICE_CONFIG_ENABLE_NFC=1", - "CONFIG_CHIP_NFC_COMMISSIONING=1", + "CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD=1", + "CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD=1", ] } diff --git a/src/platform/Zephyr/BUILD.gn b/src/platform/Zephyr/BUILD.gn index 035c13a1cd7a5f..2e13df9f3ebfec 100644 --- a/src/platform/Zephyr/BUILD.gn +++ b/src/platform/Zephyr/BUILD.gn @@ -72,10 +72,10 @@ static_library("Zephyr") { } } - if (chip_enable_nfc) { + if (chip_enable_nfc_onboarding_payload) { sources += [ - "NFCManagerImpl.cpp", - "NFCManagerImpl.h", + "NFCOnboardingPayloadManagerImpl.cpp", + "NFCOnboardingPayloadManagerImpl.h", ] } diff --git a/src/platform/Zephyr/NFCManagerImpl.cpp b/src/platform/Zephyr/NFCOnboardingPayloadManagerImpl.cpp similarity index 89% rename from src/platform/Zephyr/NFCManagerImpl.cpp rename to src/platform/Zephyr/NFCOnboardingPayloadManagerImpl.cpp index dd28457af12198..f14a4f9ede9bbd 100644 --- a/src/platform/Zephyr/NFCManagerImpl.cpp +++ b/src/platform/Zephyr/NFCOnboardingPayloadManagerImpl.cpp @@ -17,7 +17,7 @@ #include -#include +#include #include #include @@ -34,15 +34,15 @@ namespace { void nfcCallback(void * /* context */, nfc_t2t_event_t, const uint8_t * /* data */, size_t /* data_length */) {} } // namespace -NFCManagerImpl NFCManagerImpl::sInstance; +NFCOnboardingPayloadManagerImpl NFCOnboardingPayloadManagerImpl::sInstance; -CHIP_ERROR NFCManagerImpl::_Init() +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_Init() { mIsStarted = false; return nfc_t2t_setup(nfcCallback, nullptr) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR; } -CHIP_ERROR NFCManagerImpl::_StartTagEmulation(const char * payload, size_t payloadLength) +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_StartTagEmulation(const char * payload, size_t payloadLength) { CHIP_ERROR error = CHIP_NO_ERROR; int result = 0; @@ -85,7 +85,7 @@ CHIP_ERROR NFCManagerImpl::_StartTagEmulation(const char * payload, size_t paylo return error; } -CHIP_ERROR NFCManagerImpl::_StopTagEmulation() +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_StopTagEmulation() { VerifyOrReturnError(mIsStarted, CHIP_NO_ERROR); diff --git a/src/platform/Zephyr/NFCManagerImpl.h b/src/platform/Zephyr/NFCOnboardingPayloadManagerImpl.h similarity index 63% rename from src/platform/Zephyr/NFCManagerImpl.h rename to src/platform/Zephyr/NFCOnboardingPayloadManagerImpl.h index 7d60cde505da40..845df88b9d409e 100644 --- a/src/platform/Zephyr/NFCManagerImpl.h +++ b/src/platform/Zephyr/NFCOnboardingPayloadManagerImpl.h @@ -17,7 +17,7 @@ /** * @file - * Platform-specific NFCManager implementation for Zephyr RTOS. + * Platform-specific NFCOnboardingPayloadManager implementation for Zephyr RTOS. */ #pragma once @@ -28,12 +28,12 @@ namespace chip { namespace DeviceLayer { -class NFCManagerImpl final : public NFCManager +class NFCOnboardingPayloadManagerImpl final : public NFCOnboardingPayloadManager { - friend class NFCManager; + friend class NFCOnboardingPayloadManager; private: - // ===== Members that implement the NFCManager internal interface. + // ===== Members that implement the NFCOnboardingPayloadManager internal interface. CHIP_ERROR _Init(); CHIP_ERROR _StartTagEmulation(const char * payload, size_t payloadLength); @@ -49,20 +49,20 @@ class NFCManagerImpl final : public NFCManager // ===== Members for internal use by the following friends. - friend NFCManager & NFCMgr(); - friend NFCManagerImpl & NFCMgrImpl(); + friend NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr(); + friend NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl(); - static NFCManagerImpl sInstance; + static NFCOnboardingPayloadManagerImpl sInstance; }; -inline NFCManager & NFCMgr() +inline NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr() { - return NFCManagerImpl::sInstance; + return NFCOnboardingPayloadManagerImpl::sInstance; } -inline NFCManagerImpl & NFCMgrImpl() +inline NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl() { - return NFCManagerImpl::sInstance; + return NFCOnboardingPayloadManagerImpl::sInstance; } } // namespace DeviceLayer diff --git a/src/platform/device.gni b/src/platform/device.gni index 87e2eb12e8d0d2..1be2cb9e3baaf6 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -85,8 +85,8 @@ declare_args() { chip_enable_ble = chip_config_network_layer_ble } - # Enable NFC support - chip_enable_nfc = false + # Enable NFC Onboarding Payload support + chip_enable_nfc_onboarding_payload = false # Enable OTA requestor support chip_enable_ota_requestor = false diff --git a/src/platform/nrfconnect/BUILD.gn b/src/platform/nrfconnect/BUILD.gn index 9be90fe6b7b0da..82b5be883c7d63 100644 --- a/src/platform/nrfconnect/BUILD.gn +++ b/src/platform/nrfconnect/BUILD.gn @@ -112,10 +112,10 @@ static_library("nrfconnect") { ] } - if (chip_enable_nfc) { + if (chip_enable_nfc_onboarding_payload) { sources += [ - "../Zephyr/NFCManagerImpl.cpp", - "NFCManagerImpl.h", + "../Zephyr/NFCOnboardingPayloadManagerImpl.cpp", + "NFCOnboardingPayloadManagerImpl.h", ] } diff --git a/src/platform/nrfconnect/NFCManagerImpl.h b/src/platform/nrfconnect/NFCOnboardingPayloadManagerImpl.h similarity index 82% rename from src/platform/nrfconnect/NFCManagerImpl.h rename to src/platform/nrfconnect/NFCOnboardingPayloadManagerImpl.h index a034e0bb74510a..2f33887ab746fe 100644 --- a/src/platform/nrfconnect/NFCManagerImpl.h +++ b/src/platform/nrfconnect/NFCOnboardingPayloadManagerImpl.h @@ -17,10 +17,10 @@ /** * @file - * Provides an implementation of the NFCManager interface for nRF Connect + * Provides an implementation of the NFCOnboardingPayloadManager interface for nRF Connect * SDK platform, by including Zephyr platform implementation. */ #pragma once -#include +#include diff --git a/src/platform/nxp/common/ble/BLEManagerCommon.cpp b/src/platform/nxp/common/ble/BLEManagerCommon.cpp index baba33ecdab48c..3b72bdc1229725 100644 --- a/src/platform/nxp/common/ble/BLEManagerCommon.cpp +++ b/src/platform/nxp/common/ble/BLEManagerCommon.cpp @@ -771,7 +771,7 @@ CHIP_ERROR BLEManagerCommon::StopAdvertising(void) CancelBleAdvTimeoutTimer(); } -#if CONFIG_CHIP_NFC_COMMISSIONING +#if CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD /* schedule NFC emulation stop */ ChipDeviceEvent advChange; advChange.Type = DeviceEventType::kCHIPoBLEAdvertisingChange; diff --git a/src/platform/nxp/k32w0/BUILD.gn b/src/platform/nxp/k32w0/BUILD.gn index c7a1c94ddba441..77d53f62de7bbd 100644 --- a/src/platform/nxp/k32w0/BUILD.gn +++ b/src/platform/nxp/k32w0/BUILD.gn @@ -50,8 +50,8 @@ static_library("nxp_platform") { "K32W0Config.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "NFCManagerImpl.cpp", - "NFCManagerImpl.h", + "NFCOnboardingPayloadManagerImpl.cpp", + "NFCOnboardingPayloadManagerImpl.h", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "RamStorage.cpp", diff --git a/src/platform/nxp/k32w0/NFCManagerImpl.cpp b/src/platform/nxp/k32w0/NFCOnboardingPayloadManagerImpl.cpp similarity index 89% rename from src/platform/nxp/k32w0/NFCManagerImpl.cpp rename to src/platform/nxp/k32w0/NFCOnboardingPayloadManagerImpl.cpp index f6254515312d5b..706796edaad246 100644 --- a/src/platform/nxp/k32w0/NFCManagerImpl.cpp +++ b/src/platform/nxp/k32w0/NFCOnboardingPayloadManagerImpl.cpp @@ -17,8 +17,8 @@ #include -#if CHIP_DEVICE_CONFIG_ENABLE_NFC -#include +#if CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD +#include #include #include @@ -30,14 +30,14 @@ namespace chip { namespace DeviceLayer { -NFCManagerImpl NFCManagerImpl::sInstance; +NFCOnboardingPayloadManagerImpl NFCOnboardingPayloadManagerImpl::sInstance; -CHIP_ERROR NFCManagerImpl::_Init() +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_Init() { return CHIP_NO_ERROR; } -CHIP_ERROR NFCManagerImpl::_StartTagEmulation(const char * payload, size_t payloadLength) +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_StartTagEmulation(const char * payload, size_t payloadLength) { ntagDriverHandleInstance = NTAG_InitDevice((NTAG_ID_T) 0, I2C2); assert(ntagDriverHandleInstance); @@ -75,7 +75,7 @@ CHIP_ERROR NFCManagerImpl::_StartTagEmulation(const char * payload, size_t paylo return CHIP_NO_ERROR; } -CHIP_ERROR NFCManagerImpl::_StopTagEmulation() +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_StopTagEmulation() { uint8_t ndefUriRecordSize = AppNdefUriRecordGetSize(sInstance.ndefUriRecord); @@ -95,7 +95,7 @@ CHIP_ERROR NFCManagerImpl::_StopTagEmulation() return CHIP_NO_ERROR; } -bool NFCManagerImpl::IsNtagConfigured(eAppNtagError * pNtagError, const char * payload) +bool NFCOnboardingPayloadManagerImpl::IsNtagConfigured(eAppNtagError * pNtagError, const char * payload) { uint32_t addrToRead = NTAG_I2C_BLOCK_SIZE; uint8_t eepromDataBuf[NDEF_URI_ID_MAX_LENGTH + TERMINATOR_TLV_LEN] = { 0 }; @@ -129,7 +129,7 @@ bool NFCManagerImpl::IsNtagConfigured(eAppNtagError * pNtagError, const char * p !memcmp((uint8_t *) &(sInstance.ndefUriRecord), eepromDataBuf, ndefUriRecordSize)); } -NFCManagerImpl::eAppNtagError NFCManagerImpl::AppNtagWrite(const char * payload) +NFCOnboardingPayloadManagerImpl::eAppNtagError NFCOnboardingPayloadManagerImpl::AppNtagWrite(const char * payload) { eAppNtagError ntagErr = E_APP_NTAG_NO_ERROR; uint8_t byte0 = 0; @@ -190,7 +190,7 @@ NFCManagerImpl::eAppNtagError NFCManagerImpl::AppNtagWrite(const char * payload) return ntagErr; } -bool NFCManagerImpl::AppNtagEepromWrite(uint8_t originalSize) +bool NFCOnboardingPayloadManagerImpl::AppNtagEepromWrite(uint8_t originalSize) { bool wasWritten = FALSE; uint32_t ndefSize = AppNdefUriRecordGetSize(sInstance.ndefUriRecord); @@ -238,7 +238,7 @@ bool NFCManagerImpl::AppNtagEepromWrite(uint8_t originalSize) return wasWritten; } -NFCManagerImpl::eAppNtagError NFCManagerImpl::AppNtagEepromUnlockThenWrite(uint8_t originalSize) +NFCOnboardingPayloadManagerImpl::eAppNtagError NFCOnboardingPayloadManagerImpl::AppNtagEepromUnlockThenWrite(uint8_t originalSize) { eAppNtagError ntagErr = E_APP_NTAG_NO_ERROR; @@ -264,14 +264,14 @@ NFCManagerImpl::eAppNtagError NFCManagerImpl::AppNtagEepromUnlockThenWrite(uint8 return ntagErr; } -uint8_t NFCManagerImpl::AppNdefUriRecordGetSize(NdefUriRecord_t ndefUriRecord) +uint8_t NFCOnboardingPayloadManagerImpl::AppNdefUriRecordGetSize(NdefUriRecord_t ndefUriRecord) { return sizeof(sInstance.ndefUriRecord.recordType) + sizeof(sInstance.ndefUriRecord.recordTypeLen) + sizeof(sInstance.ndefUriRecord.payloadLen) + sInstance.ndefUriRecord.payloadLen + sizeof(sInstance.ndefUriRecord.recordName); } -NFCManagerImpl::eAppNtagError NFCManagerImpl::AppNtagLockWriteAccess(void) +NFCOnboardingPayloadManagerImpl::eAppNtagError NFCOnboardingPayloadManagerImpl::AppNtagLockWriteAccess(void) { eAppNtagError ntagErr = E_APP_NTAG_NO_ERROR; @@ -302,7 +302,7 @@ NFCManagerImpl::eAppNtagError NFCManagerImpl::AppNtagLockWriteAccess(void) return ntagErr; } -NFCManagerImpl::eAppNtagError NFCManagerImpl::AppNtagUnlockWriteAccess(void) +NFCOnboardingPayloadManagerImpl::eAppNtagError NFCOnboardingPayloadManagerImpl::AppNtagUnlockWriteAccess(void) { eAppNtagError ntagErr = E_APP_NTAG_NO_ERROR; diff --git a/src/platform/nxp/k32w0/NFCManagerImpl.h b/src/platform/nxp/k32w0/NFCOnboardingPayloadManagerImpl.h similarity index 77% rename from src/platform/nxp/k32w0/NFCManagerImpl.h rename to src/platform/nxp/k32w0/NFCOnboardingPayloadManagerImpl.h index 5a69375b74e29c..f2253ee2f91987 100644 --- a/src/platform/nxp/k32w0/NFCManagerImpl.h +++ b/src/platform/nxp/k32w0/NFCOnboardingPayloadManagerImpl.h @@ -17,7 +17,7 @@ /** * @file - * Platform-specific NFCManager implementation for NXP K32W. + * Platform-specific NFCOnboardingPayloadManager implementation for NXP K32W. */ #pragma once @@ -39,12 +39,12 @@ namespace { #define TERMINATOR_TLV_LEN 1 } // namespace -class NFCManagerImpl final : public NFCManager +class NFCOnboardingPayloadManagerImpl final : public NFCOnboardingPayloadManager { - friend class NFCManager; + friend class NFCOnboardingPayloadManager; private: - // ===== Members that implement the NFCManager internal interface. + // ===== Members that implement the NFCOnboardingPayloadManager internal interface. CHIP_ERROR _Init(); CHIP_ERROR _StartTagEmulation(const char * payload, size_t payloadLength); @@ -60,8 +60,8 @@ class NFCManagerImpl final : public NFCManager // ===== Members for internal use by the following friends. - friend NFCManager & NFCMgr(); - friend NFCManagerImpl & NFCMgrImpl(); + friend NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr(); + friend NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl(); typedef enum { @@ -91,18 +91,18 @@ class NFCManagerImpl final : public NFCManager static uint8_t AppNdefUriRecordGetSize(NdefUriRecord_t ndefUriRecord); NdefUriRecord_t ndefUriRecord; - static NFCManagerImpl sInstance; + static NFCOnboardingPayloadManagerImpl sInstance; NTAG_HANDLE_T ntagDriverHandleInstance; }; -inline NFCManager & NFCMgr() +inline NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr() { - return NFCManagerImpl::sInstance; + return NFCOnboardingPayloadManagerImpl::sInstance; } -inline NFCManagerImpl & NFCMgrImpl() +inline NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl() { - return NFCManagerImpl::sInstance; + return NFCOnboardingPayloadManagerImpl::sInstance; } } // namespace DeviceLayer diff --git a/src/platform/stm32/args.gni b/src/platform/stm32/args.gni index 4357e8ea8fa20f..c3270d863ee635 100644 --- a/src/platform/stm32/args.gni +++ b/src/platform/stm32/args.gni @@ -41,8 +41,8 @@ chip_build_libshell = false # OPENTHREAD CONFIG chip_enable_openthread = true -# NFC CONFIG -chip_enable_nfc = false +# NFC ONBOARDING CONFIG +chip_enable_nfc_onboarding_payload = false # INET CONFIG for thread chip_inet_config_enable_ipv4 = false diff --git a/src/platform/telink/BUILD.gn b/src/platform/telink/BUILD.gn index 93f6aaef5ed94e..a41c5e4e2790fc 100644 --- a/src/platform/telink/BUILD.gn +++ b/src/platform/telink/BUILD.gn @@ -103,10 +103,10 @@ static_library("telink") { ] } - if (chip_enable_nfc) { + if (chip_enable_nfc_onboarding_payload) { sources += [ - "NFCManagerImpl.cpp", - "NFCManagerImpl.h", + "NFCOnboardingPayloadManagerImpl.cpp", + "NFCOnboardingPayloadManagerImpl.h", ] } diff --git a/src/platform/telink/NFCManagerImpl.cpp b/src/platform/telink/NFCOnboardingPayloadManagerImpl.cpp similarity index 87% rename from src/platform/telink/NFCManagerImpl.cpp rename to src/platform/telink/NFCOnboardingPayloadManagerImpl.cpp index 084b297dfb8c46..868a72290d9ee2 100644 --- a/src/platform/telink/NFCManagerImpl.cpp +++ b/src/platform/telink/NFCOnboardingPayloadManagerImpl.cpp @@ -17,7 +17,7 @@ #include -#include +#include #include @@ -35,14 +35,14 @@ void nfc_callback(const struct device * dev, enum nfc_tag_event event, const uin namespace chip { namespace DeviceLayer { -NFCManagerImpl NFCManagerImpl::sInstance; +NFCOnboardingPayloadManagerImpl NFCOnboardingPayloadManagerImpl::sInstance; -CHIP_ERROR NFCManagerImpl::_Init() +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_Init() { return CHIP_NO_ERROR; } -CHIP_ERROR NFCManagerImpl::_StartTagEmulation(const char * payload, size_t payloadLength) +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_StartTagEmulation(const char * payload, size_t payloadLength) { /* Set up NFC driver*/ uint8_t ndef_msg_buf[NDEF_MSG_BUF_SIZE]; @@ -89,7 +89,7 @@ CHIP_ERROR NFCManagerImpl::_StartTagEmulation(const char * payload, size_t paylo return CHIP_NO_ERROR; } -CHIP_ERROR NFCManagerImpl::_StopTagEmulation() +CHIP_ERROR NFCOnboardingPayloadManagerImpl::_StopTagEmulation() { if (nfc_tag_stop(dev)) { diff --git a/src/platform/telink/NFCManagerImpl.h b/src/platform/telink/NFCOnboardingPayloadManagerImpl.h similarity index 66% rename from src/platform/telink/NFCManagerImpl.h rename to src/platform/telink/NFCOnboardingPayloadManagerImpl.h index 27ba6e0f7c5c5d..065c33a8836251 100644 --- a/src/platform/telink/NFCManagerImpl.h +++ b/src/platform/telink/NFCOnboardingPayloadManagerImpl.h @@ -26,12 +26,12 @@ namespace { #define NDEF_MSG_BUF_SIZE 128 } // namespace -class NFCManagerImpl final : public NFCManager +class NFCOnboardingPayloadManagerImpl final : public NFCOnboardingPayloadManager { - friend class NFCManager; + friend class NFCOnboardingPayloadManager; private: - // ===== Members that implement the NFCManager internal interface. + // ===== Members that implement the NFCOnboardingPayloadManager internal interface. CHIP_ERROR _Init(); CHIP_ERROR _StartTagEmulation(const char * payload, size_t payloadLength); @@ -43,20 +43,20 @@ class NFCManagerImpl final : public NFCManager const struct device * dev = DEV_PTR; // ===== Members for internal use by the following friends. - friend NFCManager & NFCMgr(); - friend NFCManagerImpl & NFCMgrImpl(); + friend NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr(); + friend NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl(); - static NFCManagerImpl sInstance; + static NFCOnboardingPayloadManagerImpl sInstance; }; -inline NFCManager & NFCMgr() +inline NFCOnboardingPayloadManager & NFCOnboardingPayloadMgr() { - return NFCManagerImpl::sInstance; + return NFCOnboardingPayloadManagerImpl::sInstance; } -inline NFCManagerImpl & NFCMgrImpl() +inline NFCOnboardingPayloadManagerImpl & NFCOnboardingPayloadMgrImpl() { - return NFCManagerImpl::sInstance; + return NFCOnboardingPayloadManagerImpl::sInstance; } } // namespace DeviceLayer From 93d2adf3b9cdc6fd5d67d5c2b44c1d1d20867a92 Mon Sep 17 00:00:00 2001 From: Olivier Lorente Date: Thu, 12 Dec 2024 14:49:46 +0100 Subject: [PATCH 02/15] Changes suggested by Damian from Nordic. --- src/include/platform/NFCOnboardingPayloadManager.h | 2 +- src/include/platform/internal/GenericPlatformManagerImpl.ipp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/platform/NFCOnboardingPayloadManager.h b/src/include/platform/NFCOnboardingPayloadManager.h index 71a720be1838a2..66a1fda6222537 100644 --- a/src/include/platform/NFCOnboardingPayloadManager.h +++ b/src/include/platform/NFCOnboardingPayloadManager.h @@ -32,7 +32,7 @@ namespace DeviceLayer { class NFCOnboardingPayloadManagerImpl; /** - * @brief Defines an abstract interface for programming onboarding data in an NFC Tag. + * @brief Defines an abstract interface for programming an NFC Tag with onboarding payload. * * NFC Tag can be used in Project CHIP to share onboarding information such * as the device discriminator and PIN code with a commissioner. This class diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.ipp b/src/include/platform/internal/GenericPlatformManagerImpl.ipp index b955fd27417cca..f714bb413a9201 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl.ipp @@ -119,7 +119,7 @@ CHIP_ERROR GenericPlatformManagerImpl::_InitChipStack() } SuccessOrExit(err); - // Initialize the CHIP NFC manager for NFC Onboarding + // Initialize the NFC onboarding payload manager #if CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD err = NFCOnboardingPayloadMgr().Init(); VerifyOrExit(err == CHIP_NO_ERROR, From f436b30bf558d8a4cc8b3718c797f9b533d116d3 Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:44:32 +0100 Subject: [PATCH 03/15] Update docs/platforms/nrf/nrfconnect_examples_configuration.md Co-authored-by: Boris Zbarsky --- docs/platforms/nrf/nrfconnect_examples_configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/nrf/nrfconnect_examples_configuration.md b/docs/platforms/nrf/nrfconnect_examples_configuration.md index 1f05c747f895ee..700d51cefd08d5 100644 --- a/docs/platforms/nrf/nrfconnect_examples_configuration.md +++ b/docs/platforms/nrf/nrfconnect_examples_configuration.md @@ -194,7 +194,7 @@ intervals: - `CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL` - `CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL` -#### Onboarding with NFC support +#### Onboarding payload delivered over NFC You can configure the Matter protocol to use an NFC tag for onboarding, instead of using a QR code, which is the default configuration. From 0d3bdc9a630c784732c034e554a1612b9b7c9fd5 Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:45:03 +0100 Subject: [PATCH 04/15] Update docs/platforms/nrf/nrfconnect_examples_configuration.md Co-authored-by: Boris Zbarsky --- docs/platforms/nrf/nrfconnect_examples_configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/nrf/nrfconnect_examples_configuration.md b/docs/platforms/nrf/nrfconnect_examples_configuration.md index 700d51cefd08d5..0d4ca7c1c39015 100644 --- a/docs/platforms/nrf/nrfconnect_examples_configuration.md +++ b/docs/platforms/nrf/nrfconnect_examples_configuration.md @@ -196,7 +196,7 @@ intervals: #### Onboarding payload delivered over NFC -You can configure the Matter protocol to use an NFC tag for onboarding, instead +You can configure the Matter protocol to use an NFC tag for delivering the onboarding payload, instead of using a QR code, which is the default configuration. To enable NFC for onboarding and share the onboarding payload in an NFC tag, set From 77f77311a2461f77f002ebfdbee864b5b77b50c3 Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:45:27 +0100 Subject: [PATCH 05/15] Update docs/platforms/nrf/nrfconnect_examples_configuration.md Co-authored-by: Boris Zbarsky --- docs/platforms/nrf/nrfconnect_examples_configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/nrf/nrfconnect_examples_configuration.md b/docs/platforms/nrf/nrfconnect_examples_configuration.md index 0d4ca7c1c39015..4770e662e2caa1 100644 --- a/docs/platforms/nrf/nrfconnect_examples_configuration.md +++ b/docs/platforms/nrf/nrfconnect_examples_configuration.md @@ -199,7 +199,7 @@ intervals: You can configure the Matter protocol to use an NFC tag for delivering the onboarding payload, instead of using a QR code, which is the default configuration. -To enable NFC for onboarding and share the onboarding payload in an NFC tag, set +To enable sharing the onboarding payload in an NFC tag, set the `CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` option. #### Factory reset behavior From d0e0fe1d3e8b3042157dcbb48356600914dea11f Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:45:40 +0100 Subject: [PATCH 06/15] Update examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h Co-authored-by: Boris Zbarsky --- .../nxp/mcxw71/include/config/CHIPProjectConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h index 1386b9fbf80d00..570b1da4968cae 100644 --- a/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h +++ b/examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -174,7 +174,7 @@ /** * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC onboarding is not supported on K32W1 + * NFC onboarding payload is not supported on K32W1 */ #define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 #define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 From 1b67312516ed39b0ee0075befc63c17adc3c219a Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:45:53 +0100 Subject: [PATCH 07/15] Update examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h Co-authored-by: Boris Zbarsky --- examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h index bc28103d1f63e0..4ba7f2f907f05e 100644 --- a/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w1/include/config/CHIPProjectConfig.h @@ -174,7 +174,7 @@ /** * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC onboarding is not supported on K32W1 + * NFC onboarding payload is not supported on K32W1 */ #define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 #define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 From 1b5d46c5df91c641a51206429e2768cffc3f7037 Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:46:34 +0100 Subject: [PATCH 08/15] Update examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h Co-authored-by: Boris Zbarsky --- .../nxp/k32w1/include/config/CHIPProjectConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h index 3f788402286da6..3e87008bffc0fb 100644 --- a/examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h +++ b/examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h @@ -175,7 +175,7 @@ /** * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC onboarding is not supported on K32W1 + * NFC onboarding payload is not supported on K32W1 */ #define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 #define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 From b49d1e8faf8d2705bee969f8a4287bce7f6a38b4 Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:46:57 +0100 Subject: [PATCH 09/15] Update src/platform/stm32/args.gni Co-authored-by: Boris Zbarsky --- src/platform/stm32/args.gni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/stm32/args.gni b/src/platform/stm32/args.gni index c3270d863ee635..ea96a58e1c1306 100644 --- a/src/platform/stm32/args.gni +++ b/src/platform/stm32/args.gni @@ -41,7 +41,7 @@ chip_build_libshell = false # OPENTHREAD CONFIG chip_enable_openthread = true -# NFC ONBOARDING CONFIG +# NFC ONBOARDING PAYLOAD CONFIG chip_enable_nfc_onboarding_payload = false # INET CONFIG for thread From 7d1e2ef18a00f335fbb5944be29822b248a22c51 Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:47:14 +0100 Subject: [PATCH 10/15] Update src/include/platform/internal/GenericPlatformManagerImpl.ipp Co-authored-by: Boris Zbarsky --- src/include/platform/internal/GenericPlatformManagerImpl.ipp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.ipp b/src/include/platform/internal/GenericPlatformManagerImpl.ipp index f714bb413a9201..acd50c2e692135 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl.ipp @@ -123,7 +123,7 @@ CHIP_ERROR GenericPlatformManagerImpl::_InitChipStack() #if CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD err = NFCOnboardingPayloadMgr().Init(); VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(DeviceLayer, "NFC Onboarding Manager initialization failed: %" CHIP_ERROR_FORMAT, err.Format())); + ChipLogError(DeviceLayer, "NFC onboarding payload manager initialization failed: %" CHIP_ERROR_FORMAT, err.Format())); #endif // TODO Initialize CHIP Event Logging. From a08d479ee4454697bee977347ea52052993d4a06 Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:47:39 +0100 Subject: [PATCH 11/15] Update src/include/platform/NFCOnboardingPayloadManager.h Co-authored-by: Boris Zbarsky --- src/include/platform/NFCOnboardingPayloadManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/platform/NFCOnboardingPayloadManager.h b/src/include/platform/NFCOnboardingPayloadManager.h index 66a1fda6222537..bbee67bdabe141 100644 --- a/src/include/platform/NFCOnboardingPayloadManager.h +++ b/src/include/platform/NFCOnboardingPayloadManager.h @@ -34,8 +34,8 @@ class NFCOnboardingPayloadManagerImpl; /** * @brief Defines an abstract interface for programming an NFC Tag with onboarding payload. * - * NFC Tag can be used in Project CHIP to share onboarding information such - * as the device discriminator and PIN code with a commissioner. This class + * NFC Tag can be used in Project CHIP to share the onboarding payload, including + * the device discriminator and PIN code, with a commissioner. This class * provides an interface to set contents of a programmable NFC Tag. */ class NFCOnboardingPayloadManager From 175ea387686ff3d8b66196f0517960dcd700f95c Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:47:49 +0100 Subject: [PATCH 12/15] Update examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h Co-authored-by: Boris Zbarsky --- examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h index d5bc4891f53cb8..5a5b5d4d8b1260 100644 --- a/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -174,7 +174,7 @@ /** * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC onboarding is not supported on K32W1 + * NFC onboarding payload is not supported on K32W1 */ #define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 #define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 From 059956e249c4e01ba9d205045552922a437f604b Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:48:11 +0100 Subject: [PATCH 13/15] Update examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h Co-authored-by: Boris Zbarsky --- .../lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h index 997e0265cc2a9a..199b6437430a70 100644 --- a/examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/k32w1/include/config/CHIPProjectConfig.h @@ -190,7 +190,7 @@ /** * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC onboarding is not supported on K32W1 + * NFC onboarding payload is not supported on K32W1 */ #define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 #define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 From 410dd86b47e70dd1c2ece94724a400bb6f331d11 Mon Sep 17 00:00:00 2001 From: "Olivier LORENTE [ST]" <34505085+OlivierGre@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:48:44 +0100 Subject: [PATCH 14/15] Update examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h Co-authored-by: Boris Zbarsky --- .../lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h b/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h index 0ac0af934b29e1..3200cfb4e49d3e 100644 --- a/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/mcxw71/include/config/CHIPProjectConfig.h @@ -190,7 +190,7 @@ /** * CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD * - * NFC onboarding is not supported on K32W1 + * NFC onboarding payload is not supported on K32W1 */ #define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0 #define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0 From 900da2e6a41617f3e3ff410a8fa14e751a1cbcf2 Mon Sep 17 00:00:00 2001 From: Olivier Lorente Date: Fri, 13 Dec 2024 12:40:34 +0100 Subject: [PATCH 15/15] Changes suggested by Alex Tsitsiura [Telink] --- config/nrfconnect/chip-module/Kconfig.defaults | 4 ++-- config/telink/chip-module/Kconfig | 2 +- examples/lighting-app/telink/prj.conf | 4 ++-- examples/shell/nrfconnect/prj.conf | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/nrfconnect/chip-module/Kconfig.defaults b/config/nrfconnect/chip-module/Kconfig.defaults index a2e0a2ba5ee36a..e49893cffa1f23 100644 --- a/config/nrfconnect/chip-module/Kconfig.defaults +++ b/config/nrfconnect/chip-module/Kconfig.defaults @@ -178,10 +178,10 @@ config MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL default y if MPSL_FEM # ============================================================================== -# NFC configuration +# NFC Onboarding Payload configuration # ============================================================================== -config CHIP_NFC_COMMISSIONING +config CHIP_NFC_ONBOARDING_PAYLOAD default y # Disable not needed NFC callback to save flash diff --git a/config/telink/chip-module/Kconfig b/config/telink/chip-module/Kconfig index 2937b2b0c66094..923a2de8c9b3bc 100644 --- a/config/telink/chip-module/Kconfig +++ b/config/telink/chip-module/Kconfig @@ -22,7 +22,7 @@ if CHIP config CHIP_DEVICE_VENDOR_NAME default "Telink Semiconductor" -config CHIP_NFC_COMMISSIONING +config CHIP_NFC_ONBOARDING_PAYLOAD bool "Share onboarding payload in NFC tag" default n imply I2C diff --git a/examples/lighting-app/telink/prj.conf b/examples/lighting-app/telink/prj.conf index 9c7bab3e5f98f7..45b8f20a8e554a 100644 --- a/examples/lighting-app/telink/prj.conf +++ b/examples/lighting-app/telink/prj.conf @@ -36,8 +36,8 @@ CONFIG_TELINK_OTA_BUTTON_TEST=n # Disable CHIP shell support CONFIG_CHIP_LIB_SHELL=n -# Disable CHIP NFC for commissioning -CONFIG_CHIP_NFC_COMMISSIONING=n +# Disable CHIP NFC Onboarding Payload +CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD=n # Disable factory data support CONFIG_CHIP_FACTORY_DATA=n diff --git a/examples/shell/nrfconnect/prj.conf b/examples/shell/nrfconnect/prj.conf index 4c8a3c2c95c58e..bf62a04a718386 100644 --- a/examples/shell/nrfconnect/prj.conf +++ b/examples/shell/nrfconnect/prj.conf @@ -46,7 +46,7 @@ CONFIG_CHIP_QSPI_NOR=n CONFIG_CHIP_PROJECT_CONFIG="CHIPProjectConfig.h" # 32786 == 0x8012 (example shell-app) CONFIG_CHIP_DEVICE_PRODUCT_ID=32786 -CONFIG_CHIP_NFC_COMMISSIONING=n +CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD=n # Disable factory data support. CONFIG_CHIP_FACTORY_DATA=n