From 223f39188dc41dcc059041e9d6ef27ffe35d8c67 Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Tue, 25 Apr 2023 14:05:50 -0400 Subject: [PATCH] Increase the size of the onoff cluster's eventControl array to handle the max dynamic enpoints count --- src/app/clusters/on-off-server/on-off-server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 1f62a3261635d7..d234e4b8dd00b2 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -48,7 +48,9 @@ using chip::Protocols::InteractionModel::Status; static OnOffEffect * firstEffect = nullptr; OnOffServer OnOffServer::instance; -static EmberEventControl gEventControls[EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT]; +static constexpr size_t kOnOffMaxEnpointCount = + EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; +static EmberEventControl gEventControls[kOnOffMaxEnpointCount]; /********************************************************** * Function definition