From a40b3ae89ba21b460f58d7cc2b811e50e32b5ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Ba=C5=82ys?= Date: Tue, 26 Apr 2022 16:28:49 +0200 Subject: [PATCH] [nrfconnect] Fixed app-clusters-app binding cluster (#17740) In nrfconnect's implementation of all-clusters-app omitted a binding-handler.cpp file. This issue caused falling into a hardfault while receiving a binding command from chip-tool. --- examples/all-clusters-app/nrfconnect/.gitignore | 1 + examples/all-clusters-app/nrfconnect/CMakeLists.txt | 1 + examples/all-clusters-app/nrfconnect/main/AppTask.cpp | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 examples/all-clusters-app/nrfconnect/.gitignore diff --git a/examples/all-clusters-app/nrfconnect/.gitignore b/examples/all-clusters-app/nrfconnect/.gitignore new file mode 100644 index 00000000000000..84c048a73cc2e5 --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/examples/all-clusters-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-app/nrfconnect/CMakeLists.txt index 7be0cb1b8d3458..f10ca233683ec5 100644 --- a/examples/all-clusters-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-app/nrfconnect/CMakeLists.txt @@ -57,6 +57,7 @@ target_sources(app PRIVATE main/main.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-modes-manager.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp + ${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp ${GEN_DIR}/all-clusters-app/zap-generated/callback-stub.cpp ${GEN_DIR}/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp index e9ee4a43db871d..c43c9f583d131b 100644 --- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp @@ -19,6 +19,7 @@ #include "AppConfig.h" #include "AppEvent.h" #include "Utils.h" +#include "binding-handler.h" #include #include @@ -125,6 +126,11 @@ CHIP_ERROR AppTask::Init() LOG_ERR("dk_buttons_init() failed"); return chip::System::MapErrorZephyr(ret); } + err = InitBindingHandlers(); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("InitBindingHandlers() failed"); + } // Initialize timer user data k_timer_init(&sFunctionTimer, &AppTask::TimerEventHandler, nullptr);