Skip to content

Commit 2d936d7

Browse files
authored
Merge branch 'master' into feature/add_brd4342a_support
2 parents 4743abe + 292665e commit 2d936d7

File tree

108 files changed

+2043
-659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2043
-659
lines changed

config/esp32/components/chip/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@ if (CONFIG_OPENTHREAD_BORDER_ROUTER)
432432
list(APPEND matter_requires espressif__esp_rcp_update)
433433
endif()
434434

435+
if (CONFIG_SEC_CERT_DAC_PROVIDER)
436+
list(APPEND matter_requires espressif__esp_secure_cert_mgr)
437+
endif()
438+
435439
add_prebuilt_library(matterlib "${CMAKE_CURRENT_BINARY_DIR}/lib/libCHIP.a"
436440
REQUIRES ${matter_requires})
437441

config/nrfconnect/chip-module/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD})
8888
# Set up custom OpenThread configuration
8989

9090
if (CONFIG_CHIP_OPENTHREAD_CONFIG)
91-
get_filename_component(CHIP_OPENTHREAD_CONFIG
91+
get_filename_component(CHIP_OPENTHREAD_CONFIG
9292
${CONFIG_CHIP_OPENTHREAD_CONFIG}
9393
REALPATH
9494
BASE_DIR ${CMAKE_SOURCE_DIR}
@@ -125,7 +125,7 @@ matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_
125125
matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD)
126126
matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT)
127127
matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_CHIP_IPV4)
128-
matter_add_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING)
128+
matter_add_gn_arg_bool ("chip_enable_nfc_onboarding_payload" CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD)
129129
matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR)
130130
matter_add_gn_arg_bool ("chip_persist_subscriptions" CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS)
131131
matter_add_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS)

config/nrfconnect/chip-module/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ config CHIP_NRF_PLATFORM
3434
config CHIP_DEVICE_VENDOR_NAME
3535
default "Nordic Semiconductor ASA"
3636

37-
config CHIP_NFC_COMMISSIONING
37+
config CHIP_NFC_ONBOARDING_PAYLOAD
3838
bool "Share onboarding payload in NFC tag"
3939
default n
4040
imply NFC_T2T_NRFXLIB

config/nrfconnect/chip-module/Kconfig.defaults

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ config MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL
178178
default y if MPSL_FEM
179179

180180
# ==============================================================================
181-
# NFC configuration
181+
# NFC Onboarding Payload configuration
182182
# ==============================================================================
183183

184-
config CHIP_NFC_COMMISSIONING
184+
config CHIP_NFC_ONBOARDING_PAYLOAD
185185
default y
186186

187187
# Disable not needed NFC callback to save flash

config/qpg/chip-gn/args.gni

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ lwip_debug = false
2424
chip_enable_openthread = true
2525
chip_config_network_layer_ble = true
2626
chip_inet_config_enable_ipv4 = false
27-
chip_enable_nfc = false
27+
chip_enable_nfc_onboarding_payload = false
2828
chip_build_tests = false
2929
chip_monolithic_tests = false
3030
chip_inet_config_enable_tcp_endpoint = false

config/telink/chip-module/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ matter_add_flags(-DMBEDTLS_USER_CONFIG_FILE=<telink-mbedtls-config.h>)
6969
# Set up custom OpenThread configuration
7070

7171
if (CONFIG_CHIP_OPENTHREAD_CONFIG)
72-
get_filename_component(CHIP_OPENTHREAD_CONFIG
72+
get_filename_component(CHIP_OPENTHREAD_CONFIG
7373
${CONFIG_CHIP_OPENTHREAD_CONFIG}
7474
REALPATH
7575
BASE_DIR ${CMAKE_SOURCE_DIR}
@@ -96,7 +96,7 @@ matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_
9696
matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD)
9797
matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT)
9898
matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_CHIP_IPV4)
99-
matter_add_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING)
99+
matter_add_gn_arg_bool ("chip_enable_nfc_onboarding_payload" CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD)
100100
matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR)
101101
matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" FALSE)
102102
matter_add_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1)

config/telink/chip-module/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if CHIP
2222
config CHIP_DEVICE_VENDOR_NAME
2323
default "Telink Semiconductor"
2424

25-
config CHIP_NFC_COMMISSIONING
25+
config CHIP_NFC_ONBOARDING_PAYLOAD
2626
bool "Share onboarding payload in NFC tag"
2727
default n
2828
imply I2C

config/zephyr/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ menuconfig CHIP
3030
imply NET_IPV6
3131
imply NET_CONFIG_NEED_IPV6
3232
imply NET_SOCKETS
33-
imply NET_SOCKETS_POSIX_NAMES if !ARCH_POSIX && CHIP_NRF_PLATFORM
3433
imply NETWORKING
3534
imply HWINFO
3635
imply FLASH

docs/platforms/nrf/nrfconnect_examples_configuration.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,14 @@ intervals:
194194
- `CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL`
195195
- `CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL`
196196
197-
#### Commissioning with NFC support
197+
#### Onboarding payload delivered over NFC
198198
199-
You can configure the Matter protocol to use an NFC tag for commissioning,
200-
instead of using a QR code, which is the default configuration.
199+
You can configure the Matter protocol to use an NFC tag for delivering the
200+
onboarding payload, instead of using a QR code, which is the default
201+
configuration.
201202
202-
To enable NFC for commissioning and share the onboarding payload in an NFC tag,
203-
set the `CONFIG_CHIP_NFC_COMMISSIONING` option.
203+
To enable sharing the onboarding payload in an NFC tag, set the
204+
`CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` option.
204205
205206
#### Factory reset behavior
206207
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
2+
*
3+
* Copyright (c) 2024 Project CHIP Authors
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include <app-common/zap-generated/cluster-enums.h>
19+
#include <app/clusters/wifi-network-diagnostics-server/WiFiDiagnosticsTestEventTriggerHandler.h>
20+
#include <app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.h>
21+
#include <platform/CHIPDeviceLayer.h>
22+
#include <platform/DiagnosticDataProvider.h>
23+
24+
#include <ctime>
25+
#include <string>
26+
27+
using namespace chip;
28+
using namespace chip::app;
29+
using namespace chip::DeviceLayer;
30+
using namespace chip::app::Clusters;
31+
32+
namespace {
33+
34+
/**
35+
* @brief Helper function to simulate a Disconnection event
36+
*/
37+
void SetTestEventTrigger_Disconnection()
38+
{
39+
uint16_t reasonCode = 3; // Deauthenticated because sending STA is leaving (or has left) IBSS or ESS.
40+
41+
WiFiDiagnosticsServer::Instance().OnDisconnectionDetected(reasonCode);
42+
}
43+
44+
/**
45+
* @brief Helper function to simulate an Association Failure event
46+
*/
47+
void SetTestEventTrigger_AssociationFailure()
48+
{
49+
uint8_t associationFailureCause =
50+
static_cast<uint8_t>(WiFiNetworkDiagnostics::AssociationFailureCauseEnum::kAuthenticationFailed);
51+
uint16_t status = 4; // IEEE 802.11-2020 Status Codes, AP is unable to handle additional associated STAs
52+
53+
WiFiDiagnosticsServer::Instance().OnAssociationFailureDetected(associationFailureCause, status);
54+
}
55+
56+
/**
57+
* @brief Helper function to simulate a Connection Status event
58+
*/
59+
void SetTestEventTrigger_ConnectionStatus()
60+
{
61+
uint8_t connectionStatus = static_cast<uint8_t>(WiFiNetworkDiagnostics::ConnectionStatusEnum::kNotConnected);
62+
WiFiDiagnosticsServer::Instance().OnConnectionStatusChanged(connectionStatus);
63+
}
64+
65+
} // anonymous namespace
66+
67+
bool HandleWiFiDiagnosticsTestEventTrigger(uint64_t eventTrigger)
68+
{
69+
// Convert raw trigger to our enum
70+
WiFiDiagnosticsTrigger trigger = static_cast<WiFiDiagnosticsTrigger>(eventTrigger);
71+
72+
switch (trigger)
73+
{
74+
case WiFiDiagnosticsTrigger::kDisconnection:
75+
ChipLogProgress(Support, "[WiFiDiagnostics-Test-Event] => Disconnection triggered");
76+
SetTestEventTrigger_Disconnection();
77+
break;
78+
79+
case WiFiDiagnosticsTrigger::kAssociationFailure:
80+
ChipLogProgress(Support, "[WiFiDiagnostics-Test-Event] => AssociationFailure triggered");
81+
SetTestEventTrigger_AssociationFailure();
82+
break;
83+
84+
case WiFiDiagnosticsTrigger::kConnectionStatus:
85+
ChipLogProgress(Support, "[WiFiDiagnostics-Test-Event] => ConnectionStatus triggered");
86+
SetTestEventTrigger_ConnectionStatus();
87+
break;
88+
89+
default:
90+
// If we get here, the trigger value is unknown to this handler
91+
return false;
92+
}
93+
94+
// Indicate that we handled the trigger successfully
95+
return true;
96+
}

examples/all-clusters-app/esp32/main/main.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ extern "C" void app_main()
212212
}
213213

214214
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
215-
216-
ESPOpenThreadInit();
217215
}
218216

219217
bool lowPowerClusterSleep()

examples/all-clusters-app/linux/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ source_set("chip-all-clusters-common") {
6060
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
6161
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
6262
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/tcc-mode.cpp",
63+
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/wifi-diagnostics-stub.cpp",
6364
"${chip_root}/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp",
6465
"${chip_root}/examples/energy-management-app/energy-management-common/common/src/EnergyTimeUtils.cpp",
6566
"${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp",

examples/all-clusters-app/linux/args.gni

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ chip_enable_smoke_co_trigger = true
3131
chip_enable_boolean_state_configuration_trigger = true
3232
chip_enable_water_heater_management_trigger = true
3333
chip_enable_software_diagnostics_trigger = true
34+
chip_enable_wifi_diagnostics_trigger = true

examples/all-clusters-app/nrfconnect/main/AppTask.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */
489489
switch (event->Type)
490490
{
491491
case DeviceEventType::kCHIPoBLEAdvertisingChange:
492-
#ifdef CONFIG_CHIP_NFC_COMMISSIONING
492+
#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD
493493
if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started)
494494
{
495-
if (NFCMgr().IsTagEmulationStarted())
495+
if (NFCOnboardingPayloadMgr().IsTagEmulationStarted())
496496
{
497497
LOG_INF("NFC Tag emulation is already started");
498498
}
@@ -503,7 +503,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */
503503
}
504504
else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped)
505505
{
506-
NFCMgr().StopTagEmulation();
506+
NFCOnboardingPayloadMgr().StopTagEmulation();
507507
}
508508
#endif
509509
sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0;

examples/all-clusters-minimal-app/esp32/main/main.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ extern "C" void app_main()
187187
}
188188

189189
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
190-
191-
ESPOpenThreadInit();
192190
}
193191

194192
bool lowPowerClusterSleep()

examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */
408408
switch (event->Type)
409409
{
410410
case DeviceEventType::kCHIPoBLEAdvertisingChange:
411-
#ifdef CONFIG_CHIP_NFC_COMMISSIONING
411+
#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD
412412
if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started)
413413
{
414-
if (NFCMgr().IsTagEmulationStarted())
414+
if (NFCOnboardingPayloadMgr().IsTagEmulationStarted())
415415
{
416416
LOG_INF("NFC Tag emulation is already started");
417417
}
@@ -422,7 +422,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */
422422
}
423423
else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped)
424424
{
425-
NFCMgr().StopTagEmulation();
425+
NFCOnboardingPayloadMgr().StopTagEmulation();
426426
}
427427
#endif
428428
sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0;

examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -781,23 +781,23 @@ void AppTask::MatterEventHandler(const ChipDeviceEvent * event, intptr_t)
781781
}
782782
#endif
783783

784-
#if CONFIG_CHIP_NFC_COMMISSIONING
784+
#if CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD
785785
if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange && event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped)
786786
{
787-
if (!NFCMgr().IsTagEmulationStarted())
787+
if (!NFCOnboardingPayloadMgr().IsTagEmulationStarted())
788788
{
789789
K32W_LOG("NFC Tag emulation is already stopped!");
790790
}
791791
else
792792
{
793-
NFCMgr().StopTagEmulation();
793+
NFCOnboardingPayloadMgr().StopTagEmulation();
794794
K32W_LOG("Stopped NFC Tag Emulation!");
795795
}
796796
}
797797
else if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange &&
798798
event->CHIPoBLEAdvertisingChange.Result == kActivity_Started)
799799
{
800-
if (NFCMgr().IsTagEmulationStarted())
800+
if (NFCOnboardingPayloadMgr().IsTagEmulationStarted())
801801
{
802802
K32W_LOG("NFC Tag emulation is already started!");
803803
}

examples/contact-sensor-app/nxp/k32w1/include/config/CHIPProjectConfig.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@
173173
#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000)
174174

175175
/**
176-
* CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC
176+
* CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD
177177
*
178-
* NFC commissioning is not supported on K32W1
178+
* NFC onboarding payload is not supported on K32W1
179179
*/
180-
#define CONFIG_CHIP_NFC_COMMISSIONING 0
181-
#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0
180+
#define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0
181+
#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0
182182

183183
/**
184184
* @def CHIP_CONFIG_MAX_FABRICS

examples/contact-sensor-app/nxp/mcxw71/include/config/CHIPProjectConfig.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@
172172
#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000)
173173

174174
/**
175-
* CONFIG_CHIP_NFC_COMMISSIONING, CHIP_DEVICE_CONFIG_ENABLE_NFC
175+
* CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD, CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD
176176
*
177-
* NFC commissioning is not supported on K32W1
177+
* NFC onboarding payload is not supported on K32W1
178178
*/
179-
#define CONFIG_CHIP_NFC_COMMISSIONING 0
180-
#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0
179+
#define CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD 0
180+
#define CHIP_DEVICE_CONFIG_ENABLE_NFC_ONBOARDING_PAYLOAD 0
181181

182182
/**
183183
* @def CHIP_CONFIG_MAX_FABRICS

examples/energy-management-app/esp32/main/main.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,4 @@ extern "C" void app_main()
296296
SetDeviceAttestationCredentialsProvider(get_dac_provider());
297297

298298
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
299-
300-
ESPOpenThreadInit();
301299
}

examples/light-switch-app/esp32/main/main.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ extern "C" void app_main()
138138

139139
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
140140

141-
ESPOpenThreadInit();
142-
143141
error = GetAppTask().StartAppTask();
144142
if (error != CHIP_NO_ERROR)
145143
{

examples/light-switch-app/nrfconnect/main/AppTask.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,10 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */
468468
{
469469
case DeviceEventType::kCHIPoBLEAdvertisingChange:
470470
UpdateStatusLED();
471-
#ifdef CONFIG_CHIP_NFC_COMMISSIONING
471+
#ifdef CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD
472472
if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started)
473473
{
474-
if (NFCMgr().IsTagEmulationStarted())
474+
if (NFCOnboardingPayloadMgr().IsTagEmulationStarted())
475475
{
476476
LOG_INF("NFC Tag emulation is already started");
477477
}
@@ -482,7 +482,7 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */
482482
}
483483
else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped)
484484
{
485-
NFCMgr().StopTagEmulation();
485+
NFCOnboardingPayloadMgr().StopTagEmulation();
486486
}
487487
#endif
488488
sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0;

examples/lighting-app/esp32/main/main.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ extern "C" void app_main()
213213

214214
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
215215

216-
ESPOpenThreadInit();
217-
218216
error = GetAppTask().StartAppTask();
219217
if (error != CHIP_NO_ERROR)
220218
{

0 commit comments

Comments
 (0)