From 2d53fb8799cd0e58716f225b139ae395800b9987 Mon Sep 17 00:00:00 2001 From: Doug Ferraz Date: Wed, 8 Feb 2023 19:23:19 +0000 Subject: [PATCH] new: teardown fnc on clusters that use Matter Timers --- .../app-templates/endpoint_config.h | 21 +- .../app-templates/endpoint_config.h | 9 +- .../barrier-control-server.cpp | 11 +- .../color-control-server.cpp | 17 +- .../color-control-server.h | 5 +- .../door-lock-server/door-lock-server.cpp | 8 +- .../clusters/level-control/level-control.cpp | 15 +- .../clusters/on-off-server/on-off-server.cpp | 24 +- .../clusters/on-off-server/on-off-server.h | 5 +- src/app/util/attribute-storage.cpp | 86 ++- .../templates/app/att-storage.zapt | 6 +- .../zap-templates/templates/app/callback.zapt | 8 + .../app-common/zap-generated/att-storage.h | 6 +- .../app-common/zap-generated/callback.h | 576 ++++++++++++++++++ 14 files changed, 726 insertions(+), 71 deletions(-) diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 7ebc33a8868b8c..a51fe4565a9689 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -1591,9 +1591,11 @@ }; \ const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \ (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) MatterOnOffClusterServerShutdownCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayLevelControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfLevelControlClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) MatterLevelControlClusterServerShutdownCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayModeSelectServer[] = { \ (EmberAfGenericClusterFunction) emberAfModeSelectClusterServerInitCallback, \ @@ -1602,10 +1604,14 @@ const EmberAfGenericClusterFunction chipFuncArrayDoorLockServer[] = { \ (EmberAfGenericClusterFunction) MatterDoorLockClusterServerAttributeChangedCallback, \ (EmberAfGenericClusterFunction) MatterDoorLockClusterServerPreAttributeChangedCallback, \ + (EmberAfGenericClusterFunction) MatterDoorLockClusterServerShutdownCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayWindowCoveringServer[] = { \ (EmberAfGenericClusterFunction) MatterWindowCoveringClusterServerAttributeChangedCallback, \ }; \ + const EmberAfGenericClusterFunction chipFuncArrayBarrierControlServer[] = { \ + (EmberAfGenericClusterFunction) MatterBarrierControlClusterServerShutdownCallback, \ + }; \ const EmberAfGenericClusterFunction chipFuncArrayPumpConfigurationAndControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerInitCallback, \ (EmberAfGenericClusterFunction) MatterPumpConfigurationAndControlClusterServerAttributeChangedCallback, \ @@ -1624,6 +1630,7 @@ }; \ const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfColorControlClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) MatterColorControlClusterServerShutdownCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayOccupancySensingServer[] = { \ (EmberAfGenericClusterFunction) emberAfOccupancySensingClusterServerInitCallback, \ @@ -2383,7 +2390,7 @@ .attributes = ZAP_ATTRIBUTE_INDEX(247), \ .attributeCount = 7, \ .clusterSize = 13, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 109 ) ,\ .generatedCommandList = nullptr ,\ @@ -2409,7 +2416,7 @@ .attributes = ZAP_ATTRIBUTE_INDEX(258), \ .attributeCount = 16, \ .clusterSize = 27, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 116 ) ,\ .generatedCommandList = nullptr ,\ @@ -2552,7 +2559,7 @@ .attributes = ZAP_ATTRIBUTE_INDEX(324), \ .attributeCount = 33, \ .clusterSize = 55, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayDoorLockServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 127 ) ,\ .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 142 ) ,\ @@ -2578,8 +2585,8 @@ .attributes = ZAP_ATTRIBUTE_INDEX(381), \ .attributeCount = 6, \ .clusterSize = 11, \ - .mask = ZAP_CLUSTER_MASK(SERVER), \ - .functions = NULL, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ + .functions = chipFuncArrayBarrierControlServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 156 ) ,\ .generatedCommandList = nullptr ,\ .eventList = nullptr, \ @@ -2643,7 +2650,7 @@ .attributes = ZAP_ATTRIBUTE_INDEX(446), \ .attributeCount = 54, \ .clusterSize = 345, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 161 ) ,\ .generatedCommandList = nullptr ,\ @@ -2929,7 +2936,7 @@ .attributes = ZAP_ATTRIBUTE_INDEX(682), \ .attributeCount = 7, \ .clusterSize = 13, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 237 ) ,\ .generatedCommandList = nullptr ,\ diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h index 16670c0d7a9957..8db90e56a24901 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h @@ -608,12 +608,15 @@ }; \ const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \ (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) MatterOnOffClusterServerShutdownCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayLevelControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfLevelControlClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) MatterLevelControlClusterServerShutdownCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfColorControlClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) MatterColorControlClusterServerShutdownCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayOccupancySensingServer[] = { \ (EmberAfGenericClusterFunction) emberAfOccupancySensingClusterServerInitCallback, \ @@ -1115,7 +1118,7 @@ .attributes = ZAP_ATTRIBUTE_INDEX(214), \ .attributeCount = 7, \ .clusterSize = 13, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 88 ) ,\ .generatedCommandList = nullptr ,\ @@ -1128,7 +1131,7 @@ .attributes = ZAP_ATTRIBUTE_INDEX(221), \ .attributeCount = 16, \ .clusterSize = 27, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 95 ) ,\ .generatedCommandList = nullptr ,\ @@ -1154,7 +1157,7 @@ .attributes = ZAP_ATTRIBUTE_INDEX(243), \ .attributeCount = 23, \ .clusterSize = 40, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 104 ) ,\ .generatedCommandList = nullptr ,\ diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp index 3a93335a60a4ed..b9e8bb8cc8cf0a 100644 --- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp +++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp @@ -71,7 +71,7 @@ static void scheduleTimerCallbackMs(EndpointId endpoint, uint32_t delayMs) reinterpret_cast(static_cast(endpoint))); } -static void deactivateEndpointTimerCallback(EndpointId endpoint) +static void cancelEndpointTimerCallback(EndpointId endpoint) { DeviceLayer::SystemLayer().CancelTimer(timerCallback, reinterpret_cast(static_cast(endpoint))); } @@ -248,7 +248,7 @@ void emberAfBarrierControlClusterServerTickCallback(EndpointId endpoint) { emAfPluginBarrierControlServerSetBarrierPosition(endpoint, state.currentPosition); setMovingState(endpoint, EMBER_ZCL_BARRIER_CONTROL_MOVING_STATE_STOPPED); - deactivateEndpointTimerCallback(endpoint); + cancelEndpointTimerCallback(endpoint); } else { @@ -342,10 +342,15 @@ bool emberAfBarrierControlClusterBarrierControlStopCallback(app::CommandHandler const Commands::BarrierControlStop::DecodableType & commandData) { EndpointId endpoint = commandPath.mEndpointId; - deactivateEndpointTimerCallback(endpoint); + cancelEndpointTimerCallback(endpoint); setMovingState(endpoint, EMBER_ZCL_BARRIER_CONTROL_MOVING_STATE_STOPPED); sendDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } void MatterBarrierControlPluginServerInitCallback() {} + +void MatterBarrierControlClusterServerShutdownCallback(EndpointId endpoint) +{ + cancelEndpointTimerCallback(endpoint); +} diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 3f347c0f7b3eeb..eb1566aa0363a2 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -48,9 +48,13 @@ void ColorControlServer::scheduleTimerCallbackMs(EmberEventControl * control, ui { ChipLogError(Zcl, "Color Control Server failed to schedule event: %" CHIP_ERROR_FORMAT, err.Format()); } + else + { + control->status = EMBER_EVENT_MS_TIME; + } } -void ColorControlServer::deactivateEndpointTimerCallback(EmberEventControl * control) +void ColorControlServer::cancelEndpointTimerCallback(EmberEventControl * control) { if (control->status != EMBER_EVENT_INACTIVE) { @@ -59,10 +63,10 @@ void ColorControlServer::deactivateEndpointTimerCallback(EmberEventControl * con DeviceLayer::SystemLayer().CancelTimer(timerCallback, control); } -void ColorControlServer::deactivateEndpointTimerCallback(EndpointId endpoint) +void ColorControlServer::cancelEndpointTimerCallback(EndpointId endpoint) { auto control = ColorControlServer::getEventControl(endpoint); - deactivateEndpointTimerCallback(control); + cancelEndpointTimerCallback(control); } /********************************************************** @@ -94,7 +98,7 @@ EmberAfStatus ColorControlServer::stopAllColorTransitions(EndpointId endpoint) EmberEventControl * event = getEventControl(endpoint); VerifyOrReturnError(event != nullptr, EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT); - deactivateEndpointTimerCallback(event); + cancelEndpointTimerCallback(event); return EMBER_ZCL_STATUS_SUCCESS; } @@ -2674,6 +2678,11 @@ void emberAfColorControlClusterServerInitCallback(EndpointId endpoint) #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP } +void MatterColorControlClusterServerShutdownCallback(EndpointId endpoint) +{ + ColorControlServer::Instance().cancelEndpointTimerCallback(endpoint); +} + #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP /** * @brief Callback for temperature update when timer is finished diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h index 136aac51bec5de..c6547e01f6dc83 100644 --- a/src/app/clusters/color-control-server/color-control-server.h +++ b/src/app/clusters/color-control-server/color-control-server.h @@ -175,6 +175,8 @@ class ColorControlServer void updateTempCommand(chip::EndpointId endpoint); #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP + void cancelEndpointTimerCallback(chip::EndpointId endpoint); + private: /********************************************************** * Functions Definitions @@ -193,8 +195,7 @@ class ColorControlServer // Matter timer scheduling glue logic static void timerCallback(chip::System::Layer *, void * callbackContext); void scheduleTimerCallbackMs(EmberEventControl * control, uint32_t delayMs); - void deactivateEndpointTimerCallback(EmberEventControl * control); - void deactivateEndpointTimerCallback(chip::EndpointId endpoint); + void cancelEndpointTimerCallback(EmberEventControl * control); #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV ColorHueTransitionState * getColorHueTransitionState(chip::EndpointId endpoint); diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index b7194dbd2ed7ab..23375058279b17 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -3425,7 +3425,7 @@ void DoorLockServer::ScheduleAutoRelock(chip::EndpointId endpointId, uint32_t ti if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Color Control Server failed to schedule event: %" CHIP_ERROR_FORMAT, err.Format()); + ChipLogError(Zcl, "Failed to schedule autorelock: timeout=%" PRIu32 ", status=0x%x", timeoutSec, err.AsInteger()); } } @@ -3784,6 +3784,12 @@ void MatterDoorLockPluginServerInitCallback() void MatterDoorLockClusterServerAttributeChangedCallback(const app::ConcreteAttributePath & attributePath) {} +void MatterDoorLockClusterServerShutdownCallback(EndpointId endpoint) +{ + DeviceLayer::SystemLayer().CancelTimer(DoorLockOnAutoRelockCallback, + reinterpret_cast(static_cast(endpointId))); +} + // ============================================================================= // Timer callbacks // ============================================================================= diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 0cdb06340a4837..728f919ed93bde 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -184,7 +184,7 @@ static void scheduleTimerCallbackMs(EndpointId endpoint, uint32_t delayMs) } } -static void deactivateEndpointTimerCallback(EndpointId endpoint) +static void cancelEndpointTimerCallback(EndpointId endpoint) { DeviceLayer::SystemLayer().CancelTimer(timerCallback, reinterpret_cast(static_cast(endpoint))); } @@ -651,7 +651,7 @@ static EmberAfStatus moveToLevelHandler(EndpointId endpoint, CommandId commandId } // Cancel any currently active command before fiddling with the state. - deactivateEndpointTimerCallback(endpoint); + cancelEndpointTimerCallback(endpoint); status = Attributes::CurrentLevel::Get(endpoint, currentLevel); if (status != EMBER_ZCL_STATUS_SUCCESS) @@ -800,7 +800,7 @@ static void moveHandler(EndpointId endpoint, CommandId commandId, uint8_t moveMo } // Cancel any currently active command before fiddling with the state. - deactivateEndpointTimerCallback(endpoint); + cancelEndpointTimerCallback(endpoint); status = Attributes::CurrentLevel::Get(endpoint, currentLevel); if (status != EMBER_ZCL_STATUS_SUCCESS) @@ -928,7 +928,7 @@ static void stepHandler(EndpointId endpoint, CommandId commandId, uint8_t stepMo } // Cancel any currently active command before fiddling with the state. - deactivateEndpointTimerCallback(endpoint); + cancelEndpointTimerCallback(endpoint); status = Attributes::CurrentLevel::Get(endpoint, currentLevel); if (status != EMBER_ZCL_STATUS_SUCCESS) @@ -1061,7 +1061,7 @@ static void stopHandler(EndpointId endpoint, CommandId commandId, chip::Optional } // Cancel any currently active command. - deactivateEndpointTimerCallback(endpoint); + cancelEndpointTimerCallback(endpoint); writeRemainingTime(endpoint, 0); status = EMBER_ZCL_STATUS_SUCCESS; @@ -1292,6 +1292,11 @@ void emberAfLevelControlClusterServerInitCallback(EndpointId endpoint) emberAfPluginLevelControlClusterServerPostInitCallback(endpoint); } +void MatterLevelControlClusterServerShutdownCallback(EndpointId endpoint) +{ + DeviceLayer::SystemLayer().CancelTimer(timerCallback, reinterpret_cast(static_cast(endpoint))); +} + #ifndef IGNORE_LEVEL_CONTROL_CLUSTER_START_UP_CURRENT_LEVEL static bool areStartUpLevelControlServerAttributesNonVolatile(EndpointId endpoint) { 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 d57968e7c2b0ec..4d9373768c9d6b 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -70,9 +70,13 @@ void OnOffServer::scheduleTimerCallbackMs(EmberEventControl * control, uint32_t { ChipLogError(Zcl, "OnOff Server failed to schedule event: %" CHIP_ERROR_FORMAT, err.Format()); } + else + { + control->status = EMBER_EVENT_MS_TIME; + } } -void OnOffServer::deactivateEndpointTimerCallback(EmberEventControl * control) +void OnOffServer::cancelEndpointTimerCallback(EmberEventControl * control) { if (control->status != EMBER_EVENT_INACTIVE) { @@ -81,10 +85,15 @@ void OnOffServer::deactivateEndpointTimerCallback(EmberEventControl * control) DeviceLayer::SystemLayer().CancelTimer(timerCallback, control); } -void OnOffServer::deactivateEndpointTimerCallback(EndpointId endpoint) +void OnOffServer::cancelEndpointTimerCallback(EndpointId endpoint) { auto control = OnOffServer::getEventControl(endpoint); - deactivateEndpointTimerCallback(control); + cancelEndpointTimerCallback(control); +} + +void MatterOnOffClusterServerShutdownCallback(EndpointId endpoint) +{ + OnOffServer::Instance().cancelEndpointTimerCallback(endpoint); } /********************************************************** @@ -185,7 +194,12 @@ EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, chip::Comman Attributes::OffWaitTime::Set(endpoint, 0); // Stop timer on the endpoint - deactivateEndpointTimerCallback(endpoint); + EmberEventControl * event = getEventControl(endpoint); + if (event != nullptr) + { + cancelEndpointTimerCallback(event); + emberAfOnOffClusterPrintln("On/Toggle Command - Stop Timer"); + } } Attributes::GlobalSceneControl::Set(endpoint, true); @@ -623,7 +637,7 @@ void OnOffServer::updateOnOffTimeCommand(chip::EndpointId endpoint) emberAfOnOffClusterPrintln("Timer Callback - wait Off Time cycle finished"); // Stop timer on the endpoint - deactivateEndpointTimerCallback(getEventControl(endpoint)); + cancelEndpointTimerCallback(getEventControl(endpoint)); } } } diff --git a/src/app/clusters/on-off-server/on-off-server.h b/src/app/clusters/on-off-server/on-off-server.h index 792e96ce425b55..c7f89b36427c1f 100644 --- a/src/app/clusters/on-off-server/on-off-server.h +++ b/src/app/clusters/on-off-server/on-off-server.h @@ -68,6 +68,8 @@ class OnOffServer return HasFeature(endpointId, OnOffFeature::kLighting); } + void cancelEndpointTimerCallback(chip::EndpointId endpoint); + private: /********************************************************** * Functions Definitions @@ -84,8 +86,7 @@ class OnOffServer // Matter timer scheduling glue logic static void timerCallback(chip::System::Layer *, void * callbackContext); void scheduleTimerCallbackMs(EmberEventControl * control, uint32_t delayMs); - void deactivateEndpointTimerCallback(EmberEventControl * control); - void deactivateEndpointTimerCallback(chip::EndpointId endpoint); + void cancelEndpointTimerCallback(EmberEventControl * control); /********************************************************** * Attributes Declaration diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 0dfedfab959b2e..194317de17f2fd 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -38,6 +38,7 @@ #include using namespace chip; +using namespace chip::app; //------------------------------------------------------------------------------ // Globals @@ -362,6 +363,57 @@ static void initializeEndpoint(EmberAfDefinedEndpoint * definedEndpoint) } } +static void shutdownEndpoint(EmberAfDefinedEndpoint * definedEndpoint) +{ + // Call shutdown callbacks from clusters, mainly for canceling pending timers + uint8_t clusterIndex; + const EmberAfEndpointType * epType = definedEndpoint->endpointType; + for (clusterIndex = 0; clusterIndex < epType->clusterCount; clusterIndex++) + { + const EmberAfCluster * cluster = &(epType->cluster[clusterIndex]); + EmberAfGenericClusterFunction f; + f = emberAfFindClusterFunction(cluster, CLUSTER_MASK_SHUTDOWN_FUNCTION); + if (f != nullptr) + { + ((EmberAfInitFunction) f)(definedEndpoint->endpoint); + } + } + + // Clear out any command handler overrides registered for this + // endpoint. + chip::app::InteractionModelEngine::GetInstance()->UnregisterCommandHandlers(definedEndpoint->endpoint); + + // Clear out any attribute access overrides registered for this + // endpoint. + app::AttributeAccessInterface * prev = nullptr; + app::AttributeAccessInterface * cur = gAttributeAccessOverrides; + while (cur) + { + app::AttributeAccessInterface * next = cur->GetNext(); + if (cur->MatchesEndpoint(definedEndpoint->endpoint)) + { + // Remove it from the list + if (prev) + { + prev->SetNext(next); + } + else + { + gAttributeAccessOverrides = next; + } + + cur->SetNext(nullptr); + + // Do not change prev in this case. + } + else + { + prev = cur; + } + cur = next; + } +} + // Calls the init functions. void emAfCallInits() { @@ -870,39 +922,7 @@ bool emberAfEndpointEnableDisable(EndpointId endpoint, bool enable) } else { - // Clear out any command handler overrides registered for this - // endpoint. - chip::app::InteractionModelEngine::GetInstance()->UnregisterCommandHandlers(endpoint); - - // Clear out any attribute access overrides registered for this - // endpoint. - app::AttributeAccessInterface * prev = nullptr; - app::AttributeAccessInterface * cur = gAttributeAccessOverrides; - while (cur) - { - app::AttributeAccessInterface * next = cur->GetNext(); - if (cur->MatchesEndpoint(endpoint)) - { - // Remove it from the list - if (prev) - { - prev->SetNext(next); - } - else - { - gAttributeAccessOverrides = next; - } - - cur->SetNext(nullptr); - - // Do not change prev in this case. - } - else - { - prev = cur; - } - cur = next; - } + shutdownEndpoint(&(emAfEndpoints[index])); } EndpointId parentEndpointId = emberAfParentEndpointFromIndex(index); diff --git a/src/app/zap-templates/templates/app/att-storage.zapt b/src/app/zap-templates/templates/app/att-storage.zapt index b01f99a390eefe..52b2ae752cdae2 100644 --- a/src/app/zap-templates/templates/app/att-storage.zapt +++ b/src/app/zap-templates/templates/app/att-storage.zapt @@ -13,11 +13,11 @@ #define CLUSTER_MASK_DEFAULT_RESPONSE_FUNCTION (0x04) // Does this cluster have message sent function? #define CLUSTER_MASK_MESSAGE_SENT_FUNCTION (0x08) -// Does this cluster have manufacturer specific attribute changed function? -#define CLUSTER_MASK_MANUFACTURER_SPECIFIC_ATTRIBUTE_CHANGED_FUNCTION (0x10) +// Does this cluster have shutdown function? +#define CLUSTER_MASK_SHUTDOWN_FUNCTION (0x10) // Does this cluster have pre-attribute changed function? #define CLUSTER_MASK_PRE_ATTRIBUTE_CHANGED_FUNCTION (0x20) // Cluster is a server #define CLUSTER_MASK_SERVER (0x40) // Cluster is a client -#define CLUSTER_MASK_CLIENT (0x80) +#define CLUSTER_MASK_CLIENT (0x80) \ No newline at end of file diff --git a/src/app/zap-templates/templates/app/callback.zapt b/src/app/zap-templates/templates/app/callback.zapt index 307214d9d12cd7..450b5e418f6f77 100644 --- a/src/app/zap-templates/templates/app/callback.zapt +++ b/src/app/zap-templates/templates/app/callback.zapt @@ -45,6 +45,14 @@ void emberAf{{asUpperCamelCase label}}ClusterInitCallback(chip::EndpointId endpo */ void emberAf{{asUpperCamelCase label}}ClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief {{label}} Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void Matter{{asUpperCamelCase label}}ClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief {{label}} Cluster Client Init * * Client Init diff --git a/zzz_generated/app-common/app-common/zap-generated/att-storage.h b/zzz_generated/app-common/app-common/zap-generated/att-storage.h index bf5b779faaeafd..67e41b5a196f09 100644 --- a/zzz_generated/app-common/app-common/zap-generated/att-storage.h +++ b/zzz_generated/app-common/app-common/zap-generated/att-storage.h @@ -30,11 +30,11 @@ #define CLUSTER_MASK_DEFAULT_RESPONSE_FUNCTION (0x04) // Does this cluster have message sent function? #define CLUSTER_MASK_MESSAGE_SENT_FUNCTION (0x08) -// Does this cluster have manufacturer specific attribute changed function? -#define CLUSTER_MASK_MANUFACTURER_SPECIFIC_ATTRIBUTE_CHANGED_FUNCTION (0x10) +// Does this cluster have shutdown function? +#define CLUSTER_MASK_SHUTDOWN_FUNCTION (0x10) // Does this cluster have pre-attribute changed function? #define CLUSTER_MASK_PRE_ATTRIBUTE_CHANGED_FUNCTION (0x20) // Cluster is a server #define CLUSTER_MASK_SERVER (0x40) // Cluster is a client -#define CLUSTER_MASK_CLIENT (0x80) +#define CLUSTER_MASK_CLIENT (0x80) \ No newline at end of file diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 4f8e3743198027..9b59a57b5169c6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -624,6 +624,14 @@ void emberAfFaultInjectionClusterInitCallback(chip::EndpointId endpoint); */ void emberAfIdentifyClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Identify Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterIdentifyClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Identify Cluster Client Init * * Client Init @@ -720,6 +728,14 @@ void emberAfIdentifyClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfGroupsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Groups Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterGroupsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Groups Cluster Client Init * * Client Init @@ -816,6 +832,14 @@ void emberAfGroupsClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfScenesClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Scenes Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterScenesClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Scenes Cluster Client Init * * Client Init @@ -912,6 +936,14 @@ void emberAfScenesClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfOnOffClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief On/Off Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterOnOffClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief On/Off Cluster Client Init * * Client Init @@ -1008,6 +1040,14 @@ void emberAfOnOffClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfOnOffSwitchConfigurationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief On/off Switch Configuration Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterOnOffSwitchConfigurationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief On/off Switch Configuration Cluster Client Init * * Client Init @@ -1104,6 +1144,14 @@ void emberAfOnOffSwitchConfigurationClusterClientTickCallback(chip::EndpointId e */ void emberAfLevelControlClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Level Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterLevelControlClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Level Control Cluster Client Init * * Client Init @@ -1200,6 +1248,14 @@ void emberAfLevelControlClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfBinaryInputBasicClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Binary Input (Basic) Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterBinaryInputBasicClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Binary Input (Basic) Cluster Client Init * * Client Init @@ -1298,6 +1354,14 @@ void emberAfBinaryInputBasicClusterClientTickCallback(chip::EndpointId endpoint) */ void emberAfPulseWidthModulationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Pulse Width Modulation Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterPulseWidthModulationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Pulse Width Modulation Cluster Client Init * * Client Init @@ -1394,6 +1458,14 @@ void emberAfPulseWidthModulationClusterClientTickCallback(chip::EndpointId endpo */ void emberAfDescriptorClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Descriptor Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterDescriptorClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Descriptor Cluster Client Init * * Client Init @@ -1490,6 +1562,14 @@ void emberAfDescriptorClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfBindingClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Binding Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterBindingClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Binding Cluster Client Init * * Client Init @@ -1586,6 +1666,14 @@ void emberAfBindingClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfAccessControlClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Access Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterAccessControlClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Access Control Cluster Client Init * * Client Init @@ -1684,6 +1772,14 @@ void emberAfAccessControlClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfActionsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Actions Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterActionsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Actions Cluster Client Init * * Client Init @@ -1780,6 +1876,14 @@ void emberAfActionsClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfBasicInformationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Basic Information Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterBasicInformationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Basic Information Cluster Client Init * * Client Init @@ -1878,6 +1982,14 @@ void emberAfBasicInformationClusterClientTickCallback(chip::EndpointId endpoint) */ void emberAfOtaSoftwareUpdateProviderClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief OTA Software Update Provider Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterOtaSoftwareUpdateProviderClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief OTA Software Update Provider Cluster Client Init * * Client Init @@ -1974,6 +2086,14 @@ void emberAfOtaSoftwareUpdateProviderClusterClientTickCallback(chip::EndpointId */ void emberAfOtaSoftwareUpdateRequestorClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief OTA Software Update Requestor Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterOtaSoftwareUpdateRequestorClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief OTA Software Update Requestor Cluster Client Init * * Client Init @@ -2070,6 +2190,14 @@ void emberAfOtaSoftwareUpdateRequestorClusterClientTickCallback(chip::EndpointId */ void emberAfLocalizationConfigurationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Localization Configuration Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterLocalizationConfigurationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Localization Configuration Cluster Client Init * * Client Init @@ -2166,6 +2294,14 @@ void emberAfLocalizationConfigurationClusterClientTickCallback(chip::EndpointId */ void emberAfTimeFormatLocalizationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Time Format Localization Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterTimeFormatLocalizationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Time Format Localization Cluster Client Init * * Client Init @@ -2262,6 +2398,14 @@ void emberAfTimeFormatLocalizationClusterClientTickCallback(chip::EndpointId end */ void emberAfUnitLocalizationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Unit Localization Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterUnitLocalizationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Unit Localization Cluster Client Init * * Client Init @@ -2360,6 +2504,14 @@ void emberAfUnitLocalizationClusterClientTickCallback(chip::EndpointId endpoint) */ void emberAfPowerSourceConfigurationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Power Source Configuration Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterPowerSourceConfigurationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Power Source Configuration Cluster Client Init * * Client Init @@ -2456,6 +2608,14 @@ void emberAfPowerSourceConfigurationClusterClientTickCallback(chip::EndpointId e */ void emberAfPowerSourceClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Power Source Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterPowerSourceClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Power Source Cluster Client Init * * Client Init @@ -2552,6 +2712,14 @@ void emberAfPowerSourceClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfGeneralCommissioningClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief General Commissioning Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterGeneralCommissioningClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief General Commissioning Cluster Client Init * * Client Init @@ -2648,6 +2816,14 @@ void emberAfGeneralCommissioningClusterClientTickCallback(chip::EndpointId endpo */ void emberAfNetworkCommissioningClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Network Commissioning Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterNetworkCommissioningClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Network Commissioning Cluster Client Init * * Client Init @@ -2744,6 +2920,14 @@ void emberAfNetworkCommissioningClusterClientTickCallback(chip::EndpointId endpo */ void emberAfDiagnosticLogsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Diagnostic Logs Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterDiagnosticLogsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Diagnostic Logs Cluster Client Init * * Client Init @@ -2842,6 +3026,14 @@ void emberAfDiagnosticLogsClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfGeneralDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief General Diagnostics Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterGeneralDiagnosticsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief General Diagnostics Cluster Client Init * * Client Init @@ -2938,6 +3130,14 @@ void emberAfGeneralDiagnosticsClusterClientTickCallback(chip::EndpointId endpoin */ void emberAfSoftwareDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Software Diagnostics Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterSoftwareDiagnosticsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Software Diagnostics Cluster Client Init * * Client Init @@ -3034,6 +3234,14 @@ void emberAfSoftwareDiagnosticsClusterClientTickCallback(chip::EndpointId endpoi */ void emberAfThreadNetworkDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Thread Network Diagnostics Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterThreadNetworkDiagnosticsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Thread Network Diagnostics Cluster Client Init * * Client Init @@ -3130,6 +3338,14 @@ void emberAfThreadNetworkDiagnosticsClusterClientTickCallback(chip::EndpointId e */ void emberAfWiFiNetworkDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief WiFi Network Diagnostics Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterWiFiNetworkDiagnosticsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief WiFi Network Diagnostics Cluster Client Init * * Client Init @@ -3226,6 +3442,14 @@ void emberAfWiFiNetworkDiagnosticsClusterClientTickCallback(chip::EndpointId end */ void emberAfEthernetNetworkDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Ethernet Network Diagnostics Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterEthernetNetworkDiagnosticsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Ethernet Network Diagnostics Cluster Client Init * * Client Init @@ -3322,6 +3546,14 @@ void emberAfEthernetNetworkDiagnosticsClusterClientTickCallback(chip::EndpointId */ void emberAfTimeSynchronizationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Time Synchronization Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterTimeSynchronizationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Time Synchronization Cluster Client Init * * Client Init @@ -3418,6 +3650,14 @@ void emberAfTimeSynchronizationClusterClientTickCallback(chip::EndpointId endpoi */ void emberAfBridgedDeviceBasicInformationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Bridged Device Basic Information Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterBridgedDeviceBasicInformationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Bridged Device Basic Information Cluster Client Init * * Client Init @@ -3515,6 +3755,14 @@ void emberAfBridgedDeviceBasicInformationClusterClientTickCallback(chip::Endpoin */ void emberAfSwitchClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Switch Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterSwitchClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Switch Cluster Client Init * * Client Init @@ -3611,6 +3859,14 @@ void emberAfSwitchClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfAdministratorCommissioningClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Administrator Commissioning Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterAdministratorCommissioningClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Administrator Commissioning Cluster Client Init * * Client Init @@ -3707,6 +3963,14 @@ void emberAfAdministratorCommissioningClusterClientTickCallback(chip::EndpointId */ void emberAfOperationalCredentialsClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Operational Credentials Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterOperationalCredentialsClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Operational Credentials Cluster Client Init * * Client Init @@ -3803,6 +4067,14 @@ void emberAfOperationalCredentialsClusterClientTickCallback(chip::EndpointId end */ void emberAfGroupKeyManagementClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Group Key Management Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterGroupKeyManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Group Key Management Cluster Client Init * * Client Init @@ -3899,6 +4171,14 @@ void emberAfGroupKeyManagementClusterClientTickCallback(chip::EndpointId endpoin */ void emberAfFixedLabelClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Fixed Label Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterFixedLabelClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Fixed Label Cluster Client Init * * Client Init @@ -3995,6 +4275,14 @@ void emberAfFixedLabelClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfUserLabelClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief User Label Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterUserLabelClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief User Label Cluster Client Init * * Client Init @@ -4091,6 +4379,14 @@ void emberAfUserLabelClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfProxyConfigurationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Proxy Configuration Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterProxyConfigurationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Proxy Configuration Cluster Client Init * * Client Init @@ -4187,6 +4483,14 @@ void emberAfProxyConfigurationClusterClientTickCallback(chip::EndpointId endpoin */ void emberAfProxyDiscoveryClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Proxy Discovery Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterProxyDiscoveryClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Proxy Discovery Cluster Client Init * * Client Init @@ -4285,6 +4589,14 @@ void emberAfProxyDiscoveryClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfProxyValidClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Proxy Valid Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterProxyValidClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Proxy Valid Cluster Client Init * * Client Init @@ -4381,6 +4693,14 @@ void emberAfProxyValidClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfBooleanStateClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Boolean State Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterBooleanStateClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Boolean State Cluster Client Init * * Client Init @@ -4477,6 +4797,14 @@ void emberAfBooleanStateClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Mode Select Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Mode Select Cluster Client Init * * Client Init @@ -4573,6 +4901,14 @@ void emberAfModeSelectClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfDoorLockClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Door Lock Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterDoorLockClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Door Lock Cluster Client Init * * Client Init @@ -4669,6 +5005,14 @@ void emberAfDoorLockClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfWindowCoveringClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Window Covering Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterWindowCoveringClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Window Covering Cluster Client Init * * Client Init @@ -4767,6 +5111,14 @@ void emberAfWindowCoveringClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfBarrierControlClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Barrier Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterBarrierControlClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Barrier Control Cluster Client Init * * Client Init @@ -4865,6 +5217,14 @@ void emberAfBarrierControlClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfPumpConfigurationAndControlClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Pump Configuration and Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterPumpConfigurationAndControlClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Pump Configuration and Control Cluster Client Init * * Client Init @@ -4961,6 +5321,14 @@ void emberAfPumpConfigurationAndControlClusterClientTickCallback(chip::EndpointI */ void emberAfThermostatClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Thermostat Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterThermostatClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Thermostat Cluster Client Init * * Client Init @@ -5057,6 +5425,14 @@ void emberAfThermostatClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfFanControlClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Fan Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterFanControlClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Fan Control Cluster Client Init * * Client Init @@ -5153,6 +5529,14 @@ void emberAfFanControlClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfThermostatUserInterfaceConfigurationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Thermostat User Interface Configuration Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterThermostatUserInterfaceConfigurationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Thermostat User Interface Configuration Cluster Client Init * * Client Init @@ -5250,6 +5634,14 @@ void emberAfThermostatUserInterfaceConfigurationClusterClientTickCallback(chip:: */ void emberAfColorControlClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Color Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterColorControlClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Color Control Cluster Client Init * * Client Init @@ -5346,6 +5738,14 @@ void emberAfColorControlClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfBallastConfigurationClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Ballast Configuration Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterBallastConfigurationClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Ballast Configuration Cluster Client Init * * Client Init @@ -5442,6 +5842,14 @@ void emberAfBallastConfigurationClusterClientTickCallback(chip::EndpointId endpo */ void emberAfIlluminanceMeasurementClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Illuminance Measurement Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterIlluminanceMeasurementClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Illuminance Measurement Cluster Client Init * * Client Init @@ -5538,6 +5946,14 @@ void emberAfIlluminanceMeasurementClusterClientTickCallback(chip::EndpointId end */ void emberAfTemperatureMeasurementClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Temperature Measurement Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterTemperatureMeasurementClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Temperature Measurement Cluster Client Init * * Client Init @@ -5634,6 +6050,14 @@ void emberAfTemperatureMeasurementClusterClientTickCallback(chip::EndpointId end */ void emberAfPressureMeasurementClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Pressure Measurement Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterPressureMeasurementClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Pressure Measurement Cluster Client Init * * Client Init @@ -5730,6 +6154,14 @@ void emberAfPressureMeasurementClusterClientTickCallback(chip::EndpointId endpoi */ void emberAfFlowMeasurementClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Flow Measurement Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterFlowMeasurementClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Flow Measurement Cluster Client Init * * Client Init @@ -5828,6 +6260,14 @@ void emberAfFlowMeasurementClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfRelativeHumidityMeasurementClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Relative Humidity Measurement Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterRelativeHumidityMeasurementClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Relative Humidity Measurement Cluster Client Init * * Client Init @@ -5924,6 +6364,14 @@ void emberAfRelativeHumidityMeasurementClusterClientTickCallback(chip::EndpointI */ void emberAfOccupancySensingClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Occupancy Sensing Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterOccupancySensingClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Occupancy Sensing Cluster Client Init * * Client Init @@ -6022,6 +6470,14 @@ void emberAfOccupancySensingClusterClientTickCallback(chip::EndpointId endpoint) */ void emberAfWakeOnLanClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Wake on LAN Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterWakeOnLanClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Wake on LAN Cluster Client Init * * Client Init @@ -6118,6 +6574,14 @@ void emberAfWakeOnLanClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfChannelClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Channel Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterChannelClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Channel Cluster Client Init * * Client Init @@ -6214,6 +6678,14 @@ void emberAfChannelClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfTargetNavigatorClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Target Navigator Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterTargetNavigatorClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Target Navigator Cluster Client Init * * Client Init @@ -6312,6 +6784,14 @@ void emberAfTargetNavigatorClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfMediaPlaybackClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Media Playback Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterMediaPlaybackClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Media Playback Cluster Client Init * * Client Init @@ -6410,6 +6890,14 @@ void emberAfMediaPlaybackClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfMediaInputClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Media Input Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterMediaInputClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Media Input Cluster Client Init * * Client Init @@ -6506,6 +6994,14 @@ void emberAfMediaInputClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfLowPowerClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Low Power Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterLowPowerClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Low Power Cluster Client Init * * Client Init @@ -6602,6 +7098,14 @@ void emberAfLowPowerClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfKeypadInputClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Keypad Input Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterKeypadInputClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Keypad Input Cluster Client Init * * Client Init @@ -6698,6 +7202,14 @@ void emberAfKeypadInputClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfContentLauncherClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Content Launcher Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterContentLauncherClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Content Launcher Cluster Client Init * * Client Init @@ -6796,6 +7308,14 @@ void emberAfContentLauncherClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfAudioOutputClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Audio Output Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterAudioOutputClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Audio Output Cluster Client Init * * Client Init @@ -6892,6 +7412,14 @@ void emberAfAudioOutputClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfApplicationLauncherClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Application Launcher Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterApplicationLauncherClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Application Launcher Cluster Client Init * * Client Init @@ -6988,6 +7516,14 @@ void emberAfApplicationLauncherClusterClientTickCallback(chip::EndpointId endpoi */ void emberAfApplicationBasicClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Application Basic Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterApplicationBasicClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Application Basic Cluster Client Init * * Client Init @@ -7086,6 +7622,14 @@ void emberAfApplicationBasicClusterClientTickCallback(chip::EndpointId endpoint) */ void emberAfAccountLoginClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Account Login Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterAccountLoginClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Account Login Cluster Client Init * * Client Init @@ -7182,6 +7726,14 @@ void emberAfAccountLoginClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfElectricalMeasurementClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Electrical Measurement Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterElectricalMeasurementClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Electrical Measurement Cluster Client Init * * Client Init @@ -7278,6 +7830,14 @@ void emberAfElectricalMeasurementClusterClientTickCallback(chip::EndpointId endp */ void emberAfClientMonitoringClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Client Monitoring Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterClientMonitoringClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Client Monitoring Cluster Client Init * * Client Init @@ -7376,6 +7936,14 @@ void emberAfClientMonitoringClusterClientTickCallback(chip::EndpointId endpoint) */ void emberAfUnitTestingClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Unit Testing Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterUnitTestingClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Unit Testing Cluster Client Init * * Client Init @@ -7472,6 +8040,14 @@ void emberAfUnitTestingClusterClientTickCallback(chip::EndpointId endpoint); */ void emberAfFaultInjectionClusterServerInitCallback(chip::EndpointId endpoint); +/** @brief Fault Injection Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterFaultInjectionClusterServerShutdownCallback(chip::EndpointId endpoint); + /** @brief Fault Injection Cluster Client Init * * Client Init