From 10559354a52c78607957a1d11c5924fd57aff350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Thu, 14 Apr 2022 21:20:18 +0200 Subject: [PATCH] [nrfconnect] Fix all-clusters-app commissioning (#17399) Common ZAP for all-clusters-app has another endpoint 0xFFFE with NetworkCommissioning cluster, but that is not used by Thread-based platforms and causes failures when wildcard reads are used. --- .../all-clusters-app/nrfconnect/main/AppTask.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp index 94693a40b99a50..e9ee4a43db871d 100644 --- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp @@ -39,6 +39,10 @@ #include #include +using namespace ::chip; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; + #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 #define APP_EVENT_QUEUE_SIZE 10 @@ -52,6 +56,8 @@ static LEDWidget sStatusLED; static UnusedLedsWrapper<3> sUnusedLeds{ { DK_LED2, DK_LED3, DK_LED4 } }; static k_timer sFunctionTimer; +constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; + namespace LedConsts { constexpr uint32_t kBlinkRate_ms{ 500 }; namespace StatusLed { @@ -67,10 +73,6 @@ constexpr uint32_t kOff_ms{ 950 }; } // namespace StatusLed } // namespace LedConsts -using namespace ::chip; -using namespace ::chip::Credentials; -using namespace ::chip::DeviceLayer; - CHIP_ERROR AppTask::Init() { // Initialize CHIP stack @@ -137,6 +139,8 @@ CHIP_ERROR AppTask::Init() #if CONFIG_CHIP_OTA_REQUESTOR InitBasicOTARequestor(); #endif + // We only have network commissioning on endpoint 0. + emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE));