From 60a0752aca01b54a45efe9645138fb2cf1fa71e7 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:04:25 -0400 Subject: [PATCH 01/32] Switch CHI registry to an object --- docs/upgrading.md | 8 +-- examples/fabric-bridge-app/linux/main.cpp | 2 +- examples/log-source-app/linux/main.cpp | 2 +- examples/tv-app/android/java/AppImpl.cpp | 2 +- src/app/CommandHandlerInterfaceRegistry.cpp | 42 +++++++------- src/app/CommandHandlerInterfaceRegistry.h | 55 ++++++++++++------- src/app/InteractionModelEngine.cpp | 4 +- .../device-energy-management-server.cpp | 4 +- .../energy-evse-server/energy-evse-server.cpp | 4 +- .../microwave-oven-control-server.cpp | 4 +- .../mode-base-server/mode-base-server.cpp | 4 +- .../network-commissioning.cpp | 2 +- .../operational-state-server.cpp | 4 +- .../resource-monitoring-server.cpp | 4 +- .../sample-mei-server/sample-mei-server.cpp | 2 +- .../clusters/scenes-server/scenes-server.cpp | 4 +- .../software-diagnostics-server.cpp | 2 +- .../thread-network-directory-server.cpp | 4 +- .../wifi-network-management-server.cpp | 4 +- src/app/util/attribute-storage.cpp | 2 +- .../util/ember-compatibility-functions.cpp | 3 +- ...mber-global-attribute-access-interface.cpp | 2 +- .../tests/TestServerCommandDispatch.cpp | 4 +- 23 files changed, 90 insertions(+), 78 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index 9a8c68987bec3b..083fef41529be3 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -69,10 +69,10 @@ independent of the InteractionModelEngine class. The following replacements exist: - `chip::app::InteractionModelEngine::RegisterCommandHandler` replaced by - `chip::app::CommandHandlerInterfaceRegistry::RegisterCommandHandler` + `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().RegisterCommandHandler` - `chip::app::InteractionModelEngine::UnregisterCommandHandler` replaced by - `chip::app::CommandHandlerInterfaceRegistry::UnregisterCommandHandler` + `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().UnregisterCommandHandler` - `chip::app::InteractionModelEngine::FindCommandHandler` replaced by - `chip::app::CommandHandlerInterfaceRegistry::GetCommandHandler` + `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().GetCommandHandler` - `chip::app::InteractionModelEngine::UnregisterCommandHandlers` replaced by - `chip::app::CommandHandlerInterfaceRegistry::UnregisterAllCommandHandlersForEndpoint` + `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().UnregisterAllCommandHandlersForEndpoint` diff --git a/examples/fabric-bridge-app/linux/main.cpp b/examples/fabric-bridge-app/linux/main.cpp index d8fb45dea08a02..67a9fa5ad77912 100644 --- a/examples/fabric-bridge-app/linux/main.cpp +++ b/examples/fabric-bridge-app/linux/main.cpp @@ -174,7 +174,7 @@ void ApplicationInit() { ChipLogDetail(NotSpecified, "Fabric-Bridge: ApplicationInit()"); - CommandHandlerInterfaceRegistry::RegisterCommandHandler(&gAdministratorCommissioningCommandHandler); + CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gAdministratorCommissioningCommandHandler); #if defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE InitRpcServer(kFabricBridgeServerPort); diff --git a/examples/log-source-app/linux/main.cpp b/examples/log-source-app/linux/main.cpp index 20ed1c54b5b215..d39e4431e86525 100644 --- a/examples/log-source-app/linux/main.cpp +++ b/examples/log-source-app/linux/main.cpp @@ -110,7 +110,7 @@ int main(int argc, char * argv[]) // Initialize device attestation config SetDeviceAttestationCredentialsProvider(chip::Credentials::Examples::GetExampleDACProvider()); - CommandHandlerInterfaceRegistry::RegisterCommandHandler(&GetLogProvider()); + CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&GetLogProvider()); chip::DeviceLayer::PlatformMgr().RunEventLoop(); diff --git a/examples/tv-app/android/java/AppImpl.cpp b/examples/tv-app/android/java/AppImpl.cpp index d04964ee5eb747..cf31496fb4b14e 100644 --- a/examples/tv-app/android/java/AppImpl.cpp +++ b/examples/tv-app/android/java/AppImpl.cpp @@ -572,7 +572,7 @@ CHIP_ERROR InitVideoPlayerPlatform(jobject contentAppEndpointManager) { ContentAppCommandDelegate * delegate = new ContentAppCommandDelegate(contentAppEndpointManager, contentAppClusters[i].clusterId); - chip::app::CommandHandlerInterfaceRegistry::RegisterCommandHandler(delegate); + chip::app::CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(delegate); ChipLogProgress(AppServer, "Registered command handler delegate for cluster %d", contentAppClusters[i].clusterId); } diff --git a/src/app/CommandHandlerInterfaceRegistry.cpp b/src/app/CommandHandlerInterfaceRegistry.cpp index 74ea7d48d04955..03b336df172c44 100644 --- a/src/app/CommandHandlerInterfaceRegistry.cpp +++ b/src/app/CommandHandlerInterfaceRegistry.cpp @@ -17,20 +17,19 @@ using namespace chip::app; -namespace { - -CommandHandlerInterface * gCommandHandlerList = nullptr; - -} - namespace chip { namespace app { -namespace CommandHandlerInterfaceRegistry { -void UnregisterAllHandlers() +CommandHandlerInterfaceRegistry & CommandHandlerInterfaceRegistry::Instance() +{ + static CommandHandlerInterfaceRegistry registry; + return registry; +} + +void CommandHandlerInterfaceRegistry::UnregisterAllHandlers() { - CommandHandlerInterface * handlerIter = gCommandHandlerList; + CommandHandlerInterface * handlerIter = mCommandHandlerList; // // Walk our list of command handlers and de-register them, before finally @@ -43,14 +42,14 @@ void UnregisterAllHandlers() handlerIter = nextHandler; } - gCommandHandlerList = nullptr; + mCommandHandlerList = nullptr; } -CHIP_ERROR RegisterCommandHandler(CommandHandlerInterface * handler) +CHIP_ERROR CommandHandlerInterfaceRegistry::RegisterCommandHandler(CommandHandlerInterface * handler) { VerifyOrReturnError(handler != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - for (auto * cur = gCommandHandlerList; cur; cur = cur->GetNext()) + for (auto * cur = mCommandHandlerList; cur; cur = cur->GetNext()) { if (cur->Matches(*handler)) { @@ -59,24 +58,23 @@ CHIP_ERROR RegisterCommandHandler(CommandHandlerInterface * handler) } } - handler->SetNext(gCommandHandlerList); - gCommandHandlerList = handler; + handler->SetNext(mCommandHandlerList); + mCommandHandlerList = handler; return CHIP_NO_ERROR; } -void UnregisterAllCommandHandlersForEndpoint(EndpointId endpointId) +void CommandHandlerInterfaceRegistry::UnregisterAllCommandHandlersForEndpoint(EndpointId endpointId) { - CommandHandlerInterface * prev = nullptr; - for (auto * cur = gCommandHandlerList; cur; cur = cur->GetNext()) + for (auto * cur = mCommandHandlerList; cur; cur = cur->GetNext()) { if (cur->MatchesEndpoint(endpointId)) { if (prev == nullptr) { - gCommandHandlerList = cur->GetNext(); + mCommandHandlerList = cur->GetNext(); } else { @@ -92,18 +90,18 @@ void UnregisterAllCommandHandlersForEndpoint(EndpointId endpointId) } } -CHIP_ERROR UnregisterCommandHandler(CommandHandlerInterface * handler) +CHIP_ERROR CommandHandlerInterfaceRegistry::UnregisterCommandHandler(CommandHandlerInterface * handler) { VerifyOrReturnError(handler != nullptr, CHIP_ERROR_INVALID_ARGUMENT); CommandHandlerInterface * prev = nullptr; - for (auto * cur = gCommandHandlerList; cur; cur = cur->GetNext()) + for (auto * cur = mCommandHandlerList; cur; cur = cur->GetNext()) { if (cur->Matches(*handler)) { if (prev == nullptr) { - gCommandHandlerList = cur->GetNext(); + mCommandHandlerList = cur->GetNext(); } else { @@ -123,7 +121,7 @@ CHIP_ERROR UnregisterCommandHandler(CommandHandlerInterface * handler) CommandHandlerInterface * GetCommandHandler(EndpointId endpointId, ClusterId clusterId) { - for (auto * cur = gCommandHandlerList; cur; cur = cur->GetNext()) + for (auto * cur = mCommandHandlerList; cur; cur = cur->GetNext()) { if (cur->Matches(endpointId, clusterId)) { diff --git a/src/app/CommandHandlerInterfaceRegistry.h b/src/app/CommandHandlerInterfaceRegistry.h index 14e00335fd859d..1695b3e3b85864 100644 --- a/src/app/CommandHandlerInterfaceRegistry.h +++ b/src/app/CommandHandlerInterfaceRegistry.h @@ -19,29 +19,42 @@ namespace chip { namespace app { -namespace CommandHandlerInterfaceRegistry { -/// Remove the entire linked list of handlers -void UnregisterAllHandlers(); - -/// Add a new handler to the list of registered command handlers +/// Keeps track of a list of registered command handler interfaces /// -/// At most one command handler can exist for a given endpoint/cluster combination. Trying -/// to register conflicting handlers will result in a `CHIP_ERROR_INCORRECT_STATE` error. -CHIP_ERROR RegisterCommandHandler(CommandHandlerInterface * handler); - -/// Unregister all commandHandlers that `MatchesEndpoint` for the given endpointId. -void UnregisterAllCommandHandlersForEndpoint(EndpointId endpointId); - -/// Unregister a single handler. -/// -/// If the handler is not registered, a `CHIP_ERROR_KEY_NOT_FOUND` is returned. -CHIP_ERROR UnregisterCommandHandler(CommandHandlerInterface * handler); - -/// Find the command handler for the given endpoint/cluster combination or return -/// nullptr if no such command handler exists. -CommandHandlerInterface * GetCommandHandler(EndpointId endpointId, ClusterId clusterId); +/// NOTE: command handler interface objects are IntrusiveList elements (i.e. +/// their pointers are contained within). As a result, a command handler +/// may only ever be part of a single registry. +class CommandHandlerInterfaceRegistry +{ +public: + /// Remove the entire linked list of handlers + void UnregisterAllHandlers(); + + /// Add a new handler to the list of registered command handlers + /// + /// At most one command handler can exist for a given endpoint/cluster combination. Trying + /// to register conflicting handlers will result in a `CHIP_ERROR_INCORRECT_STATE` error. + CHIP_ERROR RegisterCommandHandler(CommandHandlerInterface * handler); + + /// Unregister all commandHandlers that `MatchesEndpoint` for the given endpointId. + void UnregisterAllCommandHandlersForEndpoint(EndpointId endpointId); + + /// Unregister a single handler. + /// + /// If the handler is not registered, a `CHIP_ERROR_KEY_NOT_FOUND` is returned. + CHIP_ERROR UnregisterCommandHandler(CommandHandlerInterface * handler); + + /// Find the command handler for the given endpoint/cluster combination or return + /// nullptr if no such command handler exists. + CommandHandlerInterface * GetCommandHandler(EndpointId endpointId, ClusterId clusterId); + + /// A global instance of a command handler registry + static CommandHandlerInterfaceRegistry & Instance(); + +private: + CommandHandlerInterface * mCommandHandlerList = nullptr; +}; -} // namespace CommandHandlerInterfaceRegistry } // namespace app } // namespace chip diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 4d7a01f650dba2..1a4bfa66f3c31a 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -102,7 +102,7 @@ void InteractionModelEngine::Shutdown() // TODO: individual object clears the entire command handler interface registry. // This may not be expected. - CommandHandlerInterfaceRegistry::UnregisterAllHandlers(); + CommandHandlerInterfaceRegistry::Instance().UnregisterAllHandlers(); mCommandResponderObjs.ReleaseAll(); @@ -1673,7 +1673,7 @@ void InteractionModelEngine::DispatchCommand(CommandHandlerImpl & apCommandObj, TLV::TLVReader & apPayload) { CommandHandlerInterface * handler = - CommandHandlerInterfaceRegistry::GetCommandHandler(aCommandPath.mEndpointId, aCommandPath.mClusterId); + CommandHandlerInterfaceRegistry::Instance().GetCommandHandler(aCommandPath.mEndpointId, aCommandPath.mClusterId); if (handler) { diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index dc6e2a44de618a..f5a28192ad5bb4 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -38,7 +38,7 @@ namespace DeviceEnergyManagement { CHIP_ERROR Instance::Init() { - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; @@ -46,7 +46,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); unregisterAttributeAccessOverride(this); } diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.cpp b/src/app/clusters/energy-evse-server/energy-evse-server.cpp index af825217e2565a..8281e46512ba87 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.cpp +++ b/src/app/clusters/energy-evse-server/energy-evse-server.cpp @@ -38,7 +38,7 @@ namespace EnergyEvse { CHIP_ERROR Instance::Init() { - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; @@ -46,7 +46,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); unregisterAttributeAccessOverride(this); } diff --git a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp index 49022891f0b1e9..5cd058cb88fb02 100644 --- a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp +++ b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp @@ -54,7 +54,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClus Instance::~Instance() { - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); unregisterAttributeAccessOverride(this); } @@ -89,7 +89,7 @@ CHIP_ERROR Instance::Init() Zcl, "Microwave Oven Control: feature bits error, if feature supports PowerNumberLimits it must support PowerAsNumber")); - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); // If the PowerInWatts feature is supported, get the count of supported watt levels so we can later // ensure incoming watt level values are valid. diff --git a/src/app/clusters/mode-base-server/mode-base-server.cpp b/src/app/clusters/mode-base-server/mode-base-server.cpp index 643dd3dd76bee2..61ae18ad71b4e9 100644 --- a/src/app/clusters/mode-base-server/mode-base-server.cpp +++ b/src/app/clusters/mode-base-server/mode-base-server.cpp @@ -64,7 +64,7 @@ void Instance::Shutdown() return; } UnregisterThisInstance(); - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); unregisterAttributeAccessOverride(this); } @@ -78,7 +78,7 @@ CHIP_ERROR Instance::Init() LoadPersistentAttributes(); - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); RegisterThisInstance(); ReturnErrorOnFailure(mDelegate->Init()); diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index 2cfe46c70993dc..b69d3e40248c4e 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -358,7 +358,7 @@ Instance::Instance(EndpointId aEndpointId, EthernetDriver * apDelegate) : CHIP_ERROR Instance::Init() { - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler, reinterpret_cast(this))); ReturnErrorOnFailure(mpBaseDriver->Init(this)); diff --git a/src/app/clusters/operational-state-server/operational-state-server.cpp b/src/app/clusters/operational-state-server/operational-state-server.cpp index b6ae0d7a221253..97fe4848579601 100644 --- a/src/app/clusters/operational-state-server/operational-state-server.cpp +++ b/src/app/clusters/operational-state-server/operational-state-server.cpp @@ -49,7 +49,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId) : Instance(aDel Instance::~Instance() { - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); unregisterAttributeAccessOverride(this); } @@ -62,7 +62,7 @@ CHIP_ERROR Instance::Init() return CHIP_ERROR_INVALID_ARGUMENT; } - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp index 4d1197a73b83b8..8d5116359b1bef 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp @@ -59,7 +59,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClus Instance::~Instance() { - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); unregisterAttributeAccessOverride(this); } @@ -72,7 +72,7 @@ CHIP_ERROR Instance::Init() LoadPersistentAttributes(); - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); ChipLogDetail(Zcl, "ResourceMonitoring: calling mDelegate->Init()"); ReturnErrorOnFailure(mDelegate->Init()); diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.cpp b/src/app/clusters/sample-mei-server/sample-mei-server.cpp index ac461aab008b45..29ab1417dc8d27 100644 --- a/src/app/clusters/sample-mei-server/sample-mei-server.cpp +++ b/src/app/clusters/sample-mei-server/sample-mei-server.cpp @@ -30,7 +30,7 @@ void MatterSampleMeiPluginServerInitCallback() { ChipLogProgress(Zcl, "Sample MEI Init. Ep %d, Total Ep %u", MATTER_DM_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT, static_cast(kNumSupportedEndpoints)); - ReturnOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(&SampleMeiServer::Instance())); + ReturnOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&SampleMeiServer::Instance())); VerifyOrReturn(registerAttributeAccessOverride(&SampleMeiServer::Instance()), CHIP_ERROR_INCORRECT_STATE); } diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index e657a82f4654fe..98663e2e3582df 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -339,7 +339,7 @@ CHIP_ERROR ScenesServer::Init() // Prevents re-initializing VerifyOrReturnError(!mIsInitialized, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure(chip::app::CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(chip::app::CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); mGroupProvider = Credentials::GetGroupDataProvider(); @@ -353,7 +353,7 @@ CHIP_ERROR ScenesServer::Init() void ScenesServer::Shutdown() { - chip::app::CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + chip::app::CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); mGroupProvider = nullptr; mIsInitialized = false; diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp index e6bc0daac67668..51164ca5bcb1a9 100644 --- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp +++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp @@ -231,5 +231,5 @@ bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandle void MatterSoftwareDiagnosticsPluginServerInitCallback() { registerAttributeAccessOverride(&gAttrAccess); - CommandHandlerInterfaceRegistry::RegisterCommandHandler(&gCommandHandler); + CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gCommandHandler); } diff --git a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp index d1f3de7c58bbc8..6526b1f0b0ea20 100644 --- a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp +++ b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp @@ -48,13 +48,13 @@ ThreadNetworkDirectoryServer::ThreadNetworkDirectoryServer(EndpointId endpoint, ThreadNetworkDirectoryServer::~ThreadNetworkDirectoryServer() { unregisterAttributeAccessOverride(this); - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } CHIP_ERROR ThreadNetworkDirectoryServer::Init() { VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp index f99ccdf5aafad3..833baa674f3b26 100644 --- a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp +++ b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp @@ -64,13 +64,13 @@ WiFiNetworkManagementServer::WiFiNetworkManagementServer(EndpointId endpoint) : WiFiNetworkManagementServer::~WiFiNetworkManagementServer() { unregisterAttributeAccessOverride(this); - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } CHIP_ERROR WiFiNetworkManagementServer::Init() { VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; } diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index f21132bd4026ca..5bede1986d5909 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -422,7 +422,7 @@ static void shutdownEndpoint(EmberAfDefinedEndpoint * definedEndpoint) } } - CommandHandlerInterfaceRegistry::UnregisterAllCommandHandlersForEndpoint(definedEndpoint->endpoint); + CommandHandlerInterfaceRegistry::Instance().UnregisterAllCommandHandlersForEndpoint(definedEndpoint->endpoint); unregisterAllAttributeAccessOverridesForEndpoint(definedEndpoint); } diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index c1545bffa88977..e7437ef0db1f9a 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -101,7 +101,8 @@ Protocols::InteractionModel::Status ServerClusterCommandExists(const ConcreteCom return Status::UnsupportedCluster; } - auto * commandHandler = CommandHandlerInterfaceRegistry::GetCommandHandler(aCommandPath.mEndpointId, aCommandPath.mClusterId); + auto * commandHandler = + CommandHandlerInterfaceRegistry::Instance().GetCommandHandler(aCommandPath.mEndpointId, aCommandPath.mClusterId); if (commandHandler) { struct Context diff --git a/src/app/util/ember-global-attribute-access-interface.cpp b/src/app/util/ember-global-attribute-access-interface.cpp index cbc4f070e7825e..be865ad0aa5727 100644 --- a/src/app/util/ember-global-attribute-access-interface.cpp +++ b/src/app/util/ember-global-attribute-access-interface.cpp @@ -97,7 +97,7 @@ CHIP_ERROR GlobalAttributeReader::EncodeCommandList(const ConcreteClusterPath & { return aEncoder.EncodeList([&](const auto & encoder) { auto * commandHandler = - CommandHandlerInterfaceRegistry::GetCommandHandler(aClusterPath.mEndpointId, aClusterPath.mClusterId); + CommandHandlerInterfaceRegistry::Instance().GetCommandHandler(aClusterPath.mEndpointId, aClusterPath.mClusterId); if (commandHandler) { struct Context diff --git a/src/controller/tests/TestServerCommandDispatch.cpp b/src/controller/tests/TestServerCommandDispatch.cpp index 960d849fc660ad..6e2c2c5306ec2a 100644 --- a/src/controller/tests/TestServerCommandDispatch.cpp +++ b/src/controller/tests/TestServerCommandDispatch.cpp @@ -62,10 +62,10 @@ class TestClusterCommandHandler : public chip::app::CommandHandlerInterface public: TestClusterCommandHandler() : chip::app::CommandHandlerInterface(Optional::Missing(), Clusters::UnitTesting::Id) { - CommandHandlerInterfaceRegistry::RegisterCommandHandler(this); + CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this); } - ~TestClusterCommandHandler() { CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); } + ~TestClusterCommandHandler() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } void OverrideAcceptedCommands() { mOverrideAcceptedCommands = true; } void ClaimNoCommands() { mClaimNoCommands = true; } From 8d05c4f2d3343c01438262a08d9ec176974cc50a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:04:54 -0400 Subject: [PATCH 02/32] Switch CHI registry to an object --- src/app/CommandHandlerInterfaceRegistry.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/CommandHandlerInterfaceRegistry.cpp b/src/app/CommandHandlerInterfaceRegistry.cpp index 03b336df172c44..01436853dd1a55 100644 --- a/src/app/CommandHandlerInterfaceRegistry.cpp +++ b/src/app/CommandHandlerInterfaceRegistry.cpp @@ -119,7 +119,7 @@ CHIP_ERROR CommandHandlerInterfaceRegistry::UnregisterCommandHandler(CommandHand return CHIP_ERROR_KEY_NOT_FOUND; } -CommandHandlerInterface * GetCommandHandler(EndpointId endpointId, ClusterId clusterId) +CommandHandlerInterface * CommandHandlerInterfaceRegistry::GetCommandHandler(EndpointId endpointId, ClusterId clusterId) { for (auto * cur = mCommandHandlerList; cur; cur = cur->GetNext()) { @@ -132,6 +132,5 @@ CommandHandlerInterface * GetCommandHandler(EndpointId endpointId, ClusterId clu return nullptr; } -} // namespace CommandHandlerInterfaceRegistry } // namespace app } // namespace chip From 8fef93223ff8579b157cd1dc670130a003d0272e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:17:25 -0400 Subject: [PATCH 03/32] Prepare the AAI registry to use an object --- docs/upgrading.md | 19 +++++ src/app/AttributeAccessInterfaceRegistry.cpp | 76 +++++++++++--------- src/app/AttributeAccessInterfaceRegistry.h | 65 ++++++++++------- 3 files changed, 98 insertions(+), 62 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index 083fef41529be3..024616f5a5170c 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -76,3 +76,22 @@ The following replacements exist: `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().GetCommandHandler` - `chip::app::InteractionModelEngine::UnregisterCommandHandlers` replaced by `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().UnregisterAllCommandHandlersForEndpoint` + +### AttributeAccessInterface register/unregister + + +A new object exists for the attribute access interface registry, accessible +as `chip::app::AttributeHandlerInterfaceRegistry::Instance()` + + +Replacements for methods are: + +- `registerAttributeAccessOverride` replaced by + `chip::app::AttributeHandlerInterfaceRegistry::Instance().RegisterAttributeAccessOverride` +- `unregisterAttributeAccessOverride` replaced by + `chip::app::AttributeHandlerInterfaceRegistry::Instance().UnregisterAttributeAccessOverride` +- `unregisterAllAttributeAccessOverridesForEndpoint` replaced by + `chip::app::AttributeHandlerInterfaceRegistry::Instance().UnregisterAllForEndpoint` +- `chip::app::GetAttributeAccessOverride` replaced by + `chip::app::AttributeHandlerInterfaceRegistry::Instance().Get` + diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index b2c885fc4b2e2b..b8c33616569b24 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/AttributeAccessInterface.h" #include #include @@ -21,16 +22,13 @@ using namespace chip::app; namespace { -AttributeAccessInterface * gAttributeAccessOverrides = nullptr; -AttributeAccessInterfaceCache gAttributeAccessInterfaceCache; - // shouldUnregister returns true if the given AttributeAccessInterface should be // unregistered. template -void UnregisterMatchingAttributeAccessInterfaces(F shouldUnregister) +void UnregisterMatchingAttributeAccessInterfaces(F shouldUnregister, AttributeAccessInterface *& list_head) { AttributeAccessInterface * prev = nullptr; - AttributeAccessInterface * cur = gAttributeAccessOverrides; + AttributeAccessInterface * cur = list_head; while (cur) { AttributeAccessInterface * next = cur->GetNext(); @@ -43,7 +41,7 @@ void UnregisterMatchingAttributeAccessInterfaces(F shouldUnregister) } else { - gAttributeAccessOverrides = next; + list_head = next; } cur->SetNext(nullptr); @@ -60,43 +58,28 @@ void UnregisterMatchingAttributeAccessInterfaces(F shouldUnregister) } // namespace -void unregisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) -{ - gAttributeAccessInterfaceCache.Invalidate(); - UnregisterMatchingAttributeAccessInterfaces([attrOverride](AttributeAccessInterface * entry) { return entry == attrOverride; }); -} +namespace chip { +namespace app { -void unregisterAllAttributeAccessOverridesForEndpoint(EmberAfDefinedEndpoint * definedEndpoint) +AttributeHandlerInterfaceRegistry & Instance() { - UnregisterMatchingAttributeAccessInterfaces( - [endpoint = definedEndpoint->endpoint](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpoint); }); + static AttributeHandlerInterfaceRegistry instance; + return instance; } -bool registerAttributeAccessOverride(AttributeAccessInterface * attrOverride) +void AttributeHandlerInterfaceRegistry::UnregisterAllForEndpoint(EmberAfDefinedEndpoint * definedEndpoint) { - gAttributeAccessInterfaceCache.Invalidate(); - for (auto * cur = gAttributeAccessOverrides; cur; cur = cur->GetNext()) - { - if (cur->Matches(*attrOverride)) - { - ChipLogError(InteractionModel, "Duplicate attribute override registration failed"); - return false; - } - } - attrOverride->SetNext(gAttributeAccessOverrides); - gAttributeAccessOverrides = attrOverride; - return true; + UnregisterMatchingAttributeAccessInterfaces( + [endpoint = definedEndpoint->endpoint](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpoint); }, + mAttributeAccessOverrides); } -namespace chip { -namespace app { - -app::AttributeAccessInterface * GetAttributeAccessOverride(EndpointId endpointId, ClusterId clusterId) +AttributeAccessInterface * AttributeHandlerInterfaceRegistry::Get(EndpointId endpointId, ClusterId clusterId) { using CacheResult = AttributeAccessInterfaceCache::CacheResult; AttributeAccessInterface * cached = nullptr; - CacheResult result = gAttributeAccessInterfaceCache.Get(endpointId, clusterId, &cached); + CacheResult result = mAttributeAccessInterfaceCache.Get(endpointId, clusterId, &cached); switch (result) { case CacheResult::kDefinitelyUnused: @@ -106,21 +89,44 @@ app::AttributeAccessInterface * GetAttributeAccessOverride(EndpointId endpointId case CacheResult::kCacheMiss: default: // Did not cache yet, search set of AAI registered, and cache if found. - for (app::AttributeAccessInterface * cur = gAttributeAccessOverrides; cur; cur = cur->GetNext()) + for (app::AttributeAccessInterface * cur = mAttributeAccessOverrides; cur; cur = cur->GetNext()) { if (cur->Matches(endpointId, clusterId)) { - gAttributeAccessInterfaceCache.MarkUsed(endpointId, clusterId, cur); + mAttributeAccessInterfaceCache.MarkUsed(endpointId, clusterId, cur); return cur; } } // Did not find AAI registered: mark as definitely not using. - gAttributeAccessInterfaceCache.MarkUnused(endpointId, clusterId); + mAttributeAccessInterfaceCache.MarkUnused(endpointId, clusterId); } return nullptr; } +void AttributeHandlerInterfaceRegistry::UnregisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) +{ + mAttributeAccessInterfaceCache.Invalidate(); + UnregisterMatchingAttributeAccessInterfaces([attrOverride](AttributeAccessInterface * entry) { return entry == attrOverride; }, + mAttributeAccessOverrides); +} + +bool AttributeHandlerInterfaceRegistry::RegisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) +{ + mAttributeAccessInterfaceCache.Invalidate(); + for (auto * cur = mAttributeAccessOverrides; cur; cur = cur->GetNext()) + { + if (cur->Matches(*attrOverride)) + { + ChipLogError(InteractionModel, "Duplicate attribute override registration failed"); + return false; + } + } + attrOverride->SetNext(mAttributeAccessOverrides); + mAttributeAccessOverrides = attrOverride; + return true; +} + } // namespace app } // namespace chip diff --git a/src/app/AttributeAccessInterfaceRegistry.h b/src/app/AttributeAccessInterfaceRegistry.h index f8452214cbf5f9..b668f07eaedbeb 100644 --- a/src/app/AttributeAccessInterfaceRegistry.h +++ b/src/app/AttributeAccessInterfaceRegistry.h @@ -16,39 +16,50 @@ #pragma once #include +#include #include -/** - * Register an attribute access override. It will remain registered until the - * endpoint it's registered for is disabled (or until shutdown if it's - * registered for all endpoints) or until it is explicitly unregistered. - * Registration will fail if there is an already-registered override for the - * same set of attributes. - * - * @return false if there is an existing override that the new one would - * conflict with. In this case the override is not registered. - * @return true if registration was successful. - */ -bool registerAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride); +namespace chip { +namespace app { -/** - * Unregister an attribute access override (for example if the object - * implementing AttributeAccessInterface is being destroyed). - */ -void unregisterAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride); +class AttributeHandlerInterfaceRegistry +{ +public: + /** + * Register an attribute access override. It will remain registered until the + * endpoint it's registered for is disabled (or until shutdown if it's + * registered for all endpoints) or until it is explicitly unregistered. + * Registration will fail if there is an already-registered override for the + * same set of attributes. + * + * @return false if there is an existing override that the new one would + * conflict with. In this case the override is not registered. + * @return true if registration was successful. + */ + bool RegisterAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride); -/** - * Unregister all attribute access interfaces that match this given endpoint. - */ -void unregisterAllAttributeAccessOverridesForEndpoint(EmberAfDefinedEndpoint * definedEndpoint); + /** + * Unregister an attribute access override (for example if the object + * implementing AttributeAccessInterface is being destroyed). + */ + void UnregisterAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride); -namespace chip { -namespace app { + /** + * Unregister all attribute access interfaces that match this given endpoint. + */ + void UnregisterAllForEndpoint(EmberAfDefinedEndpoint * definedEndpoint); -/** - * Get the registered attribute access override. nullptr when attribute access override is not found. - */ -AttributeAccessInterface * GetAttributeAccessOverride(EndpointId aEndpointId, ClusterId aClusterId); + /** + * Get the registered attribute access override. nullptr when attribute access override is not found. + */ + AttributeAccessInterface * Get(EndpointId aEndpointId, ClusterId aClusterId); + + static AttributeHandlerInterfaceRegistry & Instance(); + +private: + AttributeAccessInterface * mAttributeAccessOverrides = nullptr; + AttributeAccessInterfaceCache mAttributeAccessInterfaceCache; +}; } // namespace app } // namespace chip From b6ddeeba29c39b864f4493024a976dd21e984516 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:18:50 -0400 Subject: [PATCH 04/32] Replace unregister --- docs/upgrading.md | 8 ++++---- .../clusters/air-quality-server/air-quality-server.cpp | 2 +- .../concentration-measurement-server.h | 2 +- .../device-energy-management-server.cpp | 2 +- .../electrical-energy-measurement-server.cpp | 2 +- .../electrical-power-measurement-server.cpp | 2 +- .../clusters/energy-evse-server/energy-evse-server.cpp | 2 +- .../microwave-oven-control-server.cpp | 2 +- src/app/clusters/mode-base-server/mode-base-server.cpp | 2 +- .../operational-state-server/operational-state-server.cpp | 2 +- .../power-topology-server/power-topology-server.cpp | 2 +- .../resource-monitoring-server.cpp | 2 +- .../thread-network-directory-server.cpp | 2 +- .../wifi-network-management-server.cpp | 2 +- .../codegen-data-model/tests/TestCodegenModelViaMocks.cpp | 2 +- .../Framework/CHIP/ServerEndpoint/MTRServerCluster.mm | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index 024616f5a5170c..72f5e3185ac001 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -87,11 +87,11 @@ as `chip::app::AttributeHandlerInterfaceRegistry::Instance()` Replacements for methods are: - `registerAttributeAccessOverride` replaced by - `chip::app::AttributeHandlerInterfaceRegistry::Instance().RegisterAttributeAccessOverride` + `chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride` - `unregisterAttributeAccessOverride` replaced by - `chip::app::AttributeHandlerInterfaceRegistry::Instance().UnregisterAttributeAccessOverride` + `chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride` - `unregisterAllAttributeAccessOverridesForEndpoint` replaced by - `chip::app::AttributeHandlerInterfaceRegistry::Instance().UnregisterAllForEndpoint` + `chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAllForEndpoint` - `chip::app::GetAttributeAccessOverride` replaced by - `chip::app::AttributeHandlerInterfaceRegistry::Instance().Get` + `chip::app::AttributeAccessInterfaceRegistry::Instance().Get` diff --git a/src/app/clusters/air-quality-server/air-quality-server.cpp b/src/app/clusters/air-quality-server/air-quality-server.cpp index 811c4722c94fec..b137138c920bf7 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.cpp +++ b/src/app/clusters/air-quality-server/air-quality-server.cpp @@ -39,7 +39,7 @@ Instance::Instance(EndpointId aEndpointId, BitMask aFeature) : Instance::~Instance() { - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() diff --git a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h index c903b21c2306fd..badf86a10d26e6 100644 --- a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h +++ b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h @@ -327,7 +327,7 @@ class Instance this->mMeasurementUnit = aMeasurementUnit; }; - ~Instance() override { unregisterAttributeAccessOverride(this); }; + ~Instance() override { chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); }; CHIP_ERROR Init() { diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index f5a28192ad5bb4..0073f46e4a012d 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -47,7 +47,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp index f5c8c281615435..29c4c522a819d3 100644 --- a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp +++ b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp @@ -48,7 +48,7 @@ CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Init() void ElectricalEnergyMeasurementAttrAccess::Shutdown() { - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, diff --git a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp index 0ac1ec956f1dab..b902656eb26cfe 100644 --- a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp +++ b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp @@ -48,7 +48,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.cpp b/src/app/clusters/energy-evse-server/energy-evse-server.cpp index 8281e46512ba87..0fff062c94a4b8 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.cpp +++ b/src/app/clusters/energy-evse-server/energy-evse-server.cpp @@ -47,7 +47,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp index 5cd058cb88fb02..9498d0abfefa0c 100644 --- a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp +++ b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp @@ -55,7 +55,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClus Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() diff --git a/src/app/clusters/mode-base-server/mode-base-server.cpp b/src/app/clusters/mode-base-server/mode-base-server.cpp index 61ae18ad71b4e9..6ebad8b3e1e83d 100644 --- a/src/app/clusters/mode-base-server/mode-base-server.cpp +++ b/src/app/clusters/mode-base-server/mode-base-server.cpp @@ -65,7 +65,7 @@ void Instance::Shutdown() } UnregisterThisInstance(); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() diff --git a/src/app/clusters/operational-state-server/operational-state-server.cpp b/src/app/clusters/operational-state-server/operational-state-server.cpp index 97fe4848579601..b3fdf545a605d5 100644 --- a/src/app/clusters/operational-state-server/operational-state-server.cpp +++ b/src/app/clusters/operational-state-server/operational-state-server.cpp @@ -50,7 +50,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId) : Instance(aDel Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() diff --git a/src/app/clusters/power-topology-server/power-topology-server.cpp b/src/app/clusters/power-topology-server/power-topology-server.cpp index 0b7072ce8eb51b..5494d292e7e59b 100644 --- a/src/app/clusters/power-topology-server/power-topology-server.cpp +++ b/src/app/clusters/power-topology-server/power-topology-server.cpp @@ -47,7 +47,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp index 8d5116359b1bef..bca1d16c589d2f 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp @@ -60,7 +60,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClus Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() diff --git a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp index 6526b1f0b0ea20..9ce9cf1513a98d 100644 --- a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp +++ b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp @@ -47,7 +47,7 @@ ThreadNetworkDirectoryServer::ThreadNetworkDirectoryServer(EndpointId endpoint, ThreadNetworkDirectoryServer::~ThreadNetworkDirectoryServer() { - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } diff --git a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp index 833baa674f3b26..28247d1bbc2c2d 100644 --- a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp +++ b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp @@ -63,7 +63,7 @@ WiFiNetworkManagementServer::WiFiNetworkManagementServer(EndpointId endpoint) : WiFiNetworkManagementServer::~WiFiNetworkManagementServer() { - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } diff --git a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp index 796c845ebe7787..446181a3f72395 100644 --- a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp @@ -593,7 +593,7 @@ class RegisteredAttributeAccessInterface { VerifyOrDie(registerAttributeAccessOverride(&mData)); } - ~RegisteredAttributeAccessInterface() { unregisterAttributeAccessOverride(&mData); } + ~RegisteredAttributeAccessInterface() { chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(&mData); } T * operator->() { return &mData; } T & operator*() { return mData; } diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm index e00bd10b5dc6c7..d04335e30b1700 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm @@ -394,7 +394,7 @@ - (void)unregisterMatterCluster std::lock_guard lock(_lock); if (_attributeAccessInterface != nullptr) { - unregisterAttributeAccessOverride(_attributeAccessInterface.get()); + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(_attributeAccessInterface.get()); } } From b60e771241a5e6003f1a1b66f6ebb99eda0eda63 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:21:13 -0400 Subject: [PATCH 05/32] Replace the register --- .../cluster_and_device_type_dev.md | 5 +++-- docs/upgrading.md | 7 ++----- .../all-clusters-common/src/bridged-actions-stub.cpp | 2 +- .../all-clusters-common/src/fan-stub.cpp | 2 +- examples/bridge-app/asr/src/bridged-actions-stub.cpp | 2 +- examples/bridge-app/esp32/main/DeviceCallbacks.cpp | 2 +- examples/bridge-app/linux/bridged-actions-stub.cpp | 2 +- examples/bridge-app/linux/main.cpp | 2 +- examples/bridge-app/telink/src/DeviceCallbacks.cpp | 2 +- examples/chef/common/chef-fan-control-manager.cpp | 2 +- .../placeholder/linux/src/bridged-actions-stub.cpp | 2 +- src/app/AttributeAccessInterface.h | 4 ++-- .../access-control-server/access-control-server.cpp | 2 +- .../account-login-server/account-login-server.cpp | 2 +- .../administrator-commissioning-server.cpp | 2 +- .../clusters/air-quality-server/air-quality-server.cpp | 3 ++- .../application-basic-server.cpp | 2 +- .../application-launcher-server.cpp | 2 +- .../audio-output-server/audio-output-server.cpp | 2 +- .../clusters/basic-information/basic-information.cpp | 2 +- src/app/clusters/bindings/bindings.cpp | 2 +- .../boolean-state-configuration-server.cpp | 2 +- src/app/clusters/channel-server/channel-server.cpp | 2 +- .../concentration-measurement-server.h | 3 ++- .../content-launch-server/content-launch-server.cpp | 2 +- src/app/clusters/descriptor/descriptor.cpp | 2 +- .../device-energy-management-server.cpp | 3 ++- src/app/clusters/door-lock-server/door-lock-server.cpp | 2 +- .../electrical-energy-measurement-server.cpp | 3 ++- .../electrical-power-measurement-server.cpp | 3 ++- .../clusters/energy-evse-server/energy-evse-server.cpp | 3 ++- .../energy-preference-server.cpp | 4 ++-- .../ethernet-network-diagnostics-server.cpp | 2 +- .../clusters/fixed-label-server/fixed-label-server.cpp | 2 +- .../general-commissioning-server.cpp | 2 +- .../general-diagnostics-server.cpp | 2 +- .../group-key-mgmt-server/group-key-mgmt-server.cpp | 2 +- .../icd-management-server/icd-management-server.cpp | 2 +- .../keypad-input-server/keypad-input-server.cpp | 2 +- .../laundry-dryer-controls-server.cpp | 2 +- .../laundry-washer-controls-server.cpp | 2 +- .../localization-configuration-server.cpp | 2 +- .../clusters/media-input-server/media-input-server.cpp | 2 +- .../media-playback-server/media-playback-server.cpp | 2 +- src/app/clusters/messages-server/messages-server.cpp | 2 +- .../microwave-oven-control-server.cpp | 3 ++- src/app/clusters/mode-base-server/mode-base-server.cpp | 3 ++- .../clusters/mode-select-server/mode-select-server.cpp | 2 +- .../network-commissioning/network-commissioning.cpp | 3 ++- .../operational-credentials-server.cpp | 2 +- .../operational-state-server.cpp | 3 ++- .../clusters/ota-requestor/ota-requestor-server.cpp | 2 +- .../power-source-configuration-server.cpp | 2 +- .../power-source-server/power-source-server.cpp | 2 +- .../power-topology-server/power-topology-server.cpp | 3 ++- .../resource-monitoring-server.cpp | 3 ++- .../resource-monitoring-server.h | 3 ++- .../clusters/sample-mei-server/sample-mei-server.cpp | 4 +++- src/app/clusters/scenes-server/scenes-server.cpp | 3 ++- .../software-diagnostics-server.cpp | 2 +- .../target-navigator-server.cpp | 2 +- .../temperature-control-server.cpp | 2 +- .../test-cluster-server/test-cluster-server.cpp | 2 +- .../clusters/thermostat-server/thermostat-server.cpp | 2 +- .../thread-network-diagnostics-server.cpp | 2 +- .../thread-network-directory-server.cpp | 3 ++- .../time-format-localization-server.cpp | 2 +- .../time-synchronization-server.cpp | 2 +- .../clusters/user-label-server/user-label-server.cpp | 2 +- .../valve-configuration-and-control-server.cpp | 2 +- .../clusters/wake-on-lan-server/wake-on-lan-server.cpp | 2 +- .../wifi-network-diagnostics-server.cpp | 2 +- .../wifi-network-management-server.cpp | 3 ++- .../tests/TestCodegenModelViaMocks.cpp | 7 +++++-- src/controller/tests/TestEventChunking.cpp | 2 +- src/controller/tests/TestReadChunking.cpp | 2 +- src/controller/tests/TestWriteChunking.cpp | 10 +++++----- .../Framework/CHIP/ServerEndpoint/MTRServerCluster.mm | 2 +- 78 files changed, 109 insertions(+), 90 deletions(-) diff --git a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md index e016ea78b7b7bf..791934b4ef4d3c 100644 --- a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md +++ b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md @@ -108,8 +108,9 @@ EmberAfInitializeAttributes - ember attribute storage - for all attributes marked as “RAM” in the zap, sets defaults in the storage MatterPluginServerCallback - .h is a generated file, .cpp impl is done in the server cluster code. Use this to setup the cluster and do attribute -overrides registerAttributeAccessOverride - use this if you want to handle -attribute reads and writes externally +overrides +chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride - +use this if you want to handle attribute reads and writes externally Blue sections can be overridden. diff --git a/docs/upgrading.md b/docs/upgrading.md index 72f5e3185ac001..2756f55cfa6bad 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -79,10 +79,8 @@ The following replacements exist: ### AttributeAccessInterface register/unregister - -A new object exists for the attribute access interface registry, accessible -as `chip::app::AttributeHandlerInterfaceRegistry::Instance()` - +A new object exists for the attribute access interface registry, accessible as +`chip::app::AttributeHandlerInterfaceRegistry::Instance()` Replacements for methods are: @@ -94,4 +92,3 @@ Replacements for methods are: `chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAllForEndpoint` - `chip::app::GetAttributeAccessOverride` replaced by `chip::app::AttributeAccessInterfaceRegistry::Instance().Get` - diff --git a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp index 41171d760d0048..02b25e8966a066 100644 --- a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp @@ -98,5 +98,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp index 9309b597db434f..eb88db22cba95c 100644 --- a/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp @@ -173,6 +173,6 @@ void emberAfFanControlClusterInitCallback(EndpointId endpoint) { VerifyOrDie(mFanControlManager == nullptr); mFanControlManager = new FanControlManager(endpoint); - registerAttributeAccessOverride(mFanControlManager); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(mFanControlManager); FanControl::SetDefaultDelegate(endpoint, mFanControlManager); } diff --git a/examples/bridge-app/asr/src/bridged-actions-stub.cpp b/examples/bridge-app/asr/src/bridged-actions-stub.cpp index 9e26bae9803fa1..d2de5faf375e34 100755 --- a/examples/bridge-app/asr/src/bridged-actions-stub.cpp +++ b/examples/bridge-app/asr/src/bridged-actions-stub.cpp @@ -97,5 +97,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/bridge-app/esp32/main/DeviceCallbacks.cpp b/examples/bridge-app/esp32/main/DeviceCallbacks.cpp index 13ced6a2e1c7c6..4ef5e2ecf35750 100644 --- a/examples/bridge-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/bridge-app/esp32/main/DeviceCallbacks.cpp @@ -113,5 +113,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/bridge-app/linux/bridged-actions-stub.cpp b/examples/bridge-app/linux/bridged-actions-stub.cpp index 00f6913b8012c5..693042c5e5d078 100644 --- a/examples/bridge-app/linux/bridged-actions-stub.cpp +++ b/examples/bridge-app/linux/bridged-actions-stub.cpp @@ -133,5 +133,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 699a87fa8c7938..6ca5adea6a419d 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -999,7 +999,7 @@ void ApplicationInit() } } - registerAttributeAccessOverride(&gPowerAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gPowerAttrAccess); } void ApplicationShutdown() {} diff --git a/examples/bridge-app/telink/src/DeviceCallbacks.cpp b/examples/bridge-app/telink/src/DeviceCallbacks.cpp index b0657e586fabc2..fd12a2a011c440 100644 --- a/examples/bridge-app/telink/src/DeviceCallbacks.cpp +++ b/examples/bridge-app/telink/src/DeviceCallbacks.cpp @@ -101,5 +101,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/chef/common/chef-fan-control-manager.cpp b/examples/chef/common/chef-fan-control-manager.cpp index 899892501bf4f1..60187a869277cd 100644 --- a/examples/chef/common/chef-fan-control-manager.cpp +++ b/examples/chef/common/chef-fan-control-manager.cpp @@ -141,6 +141,6 @@ void emberAfFanControlClusterInitCallback(EndpointId endpoint) { VerifyOrDie(!mFanControlManager); mFanControlManager = std::make_unique(endpoint); - registerAttributeAccessOverride(mFanControlManager.get()); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(mFanControlManager.get()); FanControl::SetDefaultDelegate(endpoint, mFanControlManager.get()); } diff --git a/examples/placeholder/linux/src/bridged-actions-stub.cpp b/examples/placeholder/linux/src/bridged-actions-stub.cpp index ea6e824738a857..1538e34e350f3c 100644 --- a/examples/placeholder/linux/src/bridged-actions-stub.cpp +++ b/examples/placeholder/linux/src/bridged-actions-stub.cpp @@ -98,5 +98,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/AttributeAccessInterface.h b/src/app/AttributeAccessInterface.h index 50e0812fb61c1a..30c934d331afcd 100644 --- a/src/app/AttributeAccessInterface.h +++ b/src/app/AttributeAccessInterface.h @@ -30,8 +30,8 @@ * endpoint or for all endpoints. * * Instances of AttributeAccessInterface that are registered via - * registerAttributeAccessOverride will be consulted before taking the normal - * attribute access codepath and can use that codepath as a fallback if desired. + * chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride will be consulted before taking the + * normal attribute access codepath and can use that codepath as a fallback if desired. */ namespace chip { namespace app { diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 316825bc91848c..07b3e83f3b6cc1 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -479,6 +479,6 @@ void MatterAccessControlPluginServerInitCallback() { ChipLogProgress(DataManagement, "AccessControlCluster: initializing"); - registerAttributeAccessOverride(&sAttribute); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&sAttribute); GetAccessControl().AddEntryListener(sAttribute); } diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index 95d94fe9b995a5..5a836b5b0cc161 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -261,5 +261,5 @@ bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, void MatterAccountLoginPluginServerInitCallback() { - registerAttributeAccessOverride(&gAccountLoginAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAccountLoginAttrAccess); } diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp index a7b3eaed75fd7d..4e154afc446731 100644 --- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp +++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp @@ -209,5 +209,5 @@ bool emberAfAdministratorCommissioningClusterRevokeCommissioningCallback( void MatterAdministratorCommissioningPluginServerInitCallback() { ChipLogProgress(Zcl, "Initiating Admin Commissioning cluster."); - registerAttributeAccessOverride(&gAdminCommissioningAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAdminCommissioningAttrAccess); } diff --git a/src/app/clusters/air-quality-server/air-quality-server.cpp b/src/app/clusters/air-quality-server/air-quality-server.cpp index b137138c920bf7..21eb44164e0e11 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.cpp +++ b/src/app/clusters/air-quality-server/air-quality-server.cpp @@ -47,7 +47,8 @@ CHIP_ERROR Instance::Init() // Check if the cluster has been selected in zap VerifyOrDie(emberAfContainsServer(mEndpointId, Id) == true); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index 3841b81873660b..afa0d7c06cfdb7 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -246,5 +246,5 @@ CHIP_ERROR ApplicationBasicAttrAccess::ReadAllowedVendorListAttribute(app::Attri void MatterApplicationBasicPluginServerInitCallback() { - registerAttributeAccessOverride(&gApplicationBasicAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationBasicAttrAccess); } diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index ed6265e47c485b..5bc196ff4e5666 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -495,5 +495,5 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm void MatterApplicationLauncherPluginServerInitCallback() { - registerAttributeAccessOverride(&gApplicationLauncherAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationLauncherAttrAccess); } diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 19d34b0ebb5718..d9ec93836a4e67 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -244,5 +244,5 @@ bool emberAfAudioOutputClusterSelectOutputCallback(app::CommandHandler * command void MatterAudioOutputPluginServerInitCallback() { - registerAttributeAccessOverride(&gAudioOutputAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAudioOutputAttrAccess); } diff --git a/src/app/clusters/basic-information/basic-information.cpp b/src/app/clusters/basic-information/basic-information.cpp index b550026b5f1cd7..6bba8d2f63aac4 100644 --- a/src/app/clusters/basic-information/basic-information.cpp +++ b/src/app/clusters/basic-information/basic-information.cpp @@ -476,6 +476,6 @@ bool IsLocalConfigDisabled() void MatterBasicInformationPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); PlatformMgr().SetDelegate(&gPlatformMgrDelegate); } diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp index d7c1712baf9672..b981d0bb3d9ece 100644 --- a/src/app/clusters/bindings/bindings.cpp +++ b/src/app/clusters/bindings/bindings.cpp @@ -268,7 +268,7 @@ CHIP_ERROR BindingTableAccess::NotifyBindingsChanged() void MatterBindingPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } CHIP_ERROR AddBindingEntry(const EmberBindingTableEntry & entry) diff --git a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp index 3eb3b1216a38c7..26890c8e899747 100644 --- a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp +++ b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp @@ -453,5 +453,5 @@ bool emberAfBooleanStateConfigurationClusterEnableDisableAlarmCallback( void MatterBooleanStateConfigurationPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index 01a1af2d3710de..9cd97db353438c 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -408,5 +408,5 @@ bool emberAfChannelClusterCancelRecordProgramCallback( void MatterChannelPluginServerInitCallback() { - registerAttributeAccessOverride(&gChannelAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gChannelAttrAccess); } diff --git a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h index badf86a10d26e6..6f9e7c21431289 100644 --- a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h +++ b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h @@ -353,7 +353,8 @@ class Instance VerifyOrReturnError(emberAfContainsServer(mEndpointId, mClusterId), CHIP_ERROR_INCORRECT_STATE); // Register the object as attribute provider - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); mFeatureMap = GenerateFeatureMap(); diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index 2e4fb7435c0be9..b6bff6e7b91976 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -286,5 +286,5 @@ bool emberAfContentLauncherClusterLaunchURLCallback(CommandHandler * commandObj, void MatterContentLauncherPluginServerInitCallback() { - registerAttributeAccessOverride(&gContentLauncherAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gContentLauncherAttrAccess); } diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index 514051226fdcf5..49ce814ff5e169 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -244,5 +244,5 @@ CHIP_ERROR DescriptorAttrAccess::Read(const ConcreteReadAttributePath & aPath, A void MatterDescriptorPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 0073f46e4a012d..26ea72482619f0 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -39,7 +39,8 @@ namespace DeviceEnergyManagement { CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } 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 68e5f398b5bc84..ffd29a6b81ee49 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -4232,7 +4232,7 @@ void MatterDoorLockPluginServerInitCallback() ChipLogProgress(Zcl, "Door Lock server initialized"); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gFabricDelegate); - registerAttributeAccessOverride(&DoorLockServer::Instance()); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&DoorLockServer::Instance()); } void MatterDoorLockClusterServerAttributeChangedCallback(const app::ConcreteAttributePath & attributePath) {} diff --git a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp index 29c4c522a819d3..3cb7d50dee796e 100644 --- a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp +++ b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp @@ -42,7 +42,8 @@ MeasurementData gMeasurements[MATTER_DM_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_SE CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Init() { - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp index b902656eb26cfe..d6b69f06799ed3 100644 --- a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp +++ b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp @@ -42,7 +42,8 @@ namespace ElectricalPowerMeasurement { CHIP_ERROR Instance::Init() { - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.cpp b/src/app/clusters/energy-evse-server/energy-evse-server.cpp index 0fff062c94a4b8..840e0e35479c9a 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.cpp +++ b/src/app/clusters/energy-evse-server/energy-evse-server.cpp @@ -39,7 +39,8 @@ namespace EnergyEvse { CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/energy-preference-server/energy-preference-server.cpp b/src/app/clusters/energy-preference-server/energy-preference-server.cpp index 789ab4ce0e7299..9fbbfa1db2846d 100644 --- a/src/app/clusters/energy-preference-server/energy-preference-server.cpp +++ b/src/app/clusters/energy-preference-server/energy-preference-server.cpp @@ -18,7 +18,7 @@ #include "energy-preference-server.h" #include -#include // Needed for registerAttributeAccessOverride +#include // Needed for chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride #include #include @@ -228,5 +228,5 @@ Status MatterEnergyPreferenceClusterServerPreAttributeChangedCallback(const Conc void MatterEnergyPreferencePluginServerInitCallback() { - registerAttributeAccessOverride(&gEnergyPrefAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gEnergyPrefAttrAccess); } diff --git a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp index 7bd7043d7c7e51..6a18f352082e03 100644 --- a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp +++ b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp @@ -186,5 +186,5 @@ bool emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(app::CommandHan void MatterEthernetNetworkDiagnosticsPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/fixed-label-server/fixed-label-server.cpp b/src/app/clusters/fixed-label-server/fixed-label-server.cpp index bd952f148647fc..de97596468c69c 100644 --- a/src/app/clusters/fixed-label-server/fixed-label-server.cpp +++ b/src/app/clusters/fixed-label-server/fixed-label-server.cpp @@ -110,5 +110,5 @@ CHIP_ERROR FixedLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, A void MatterFixedLabelPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 776441ffc9ae75..64384f148ec5b4 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -343,7 +343,7 @@ void OnPlatformEventHandler(const DeviceLayer::ChipDeviceEvent * event, intptr_t void MatterGeneralCommissioningPluginServerInitCallback() { Breadcrumb::Set(0, 0); - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler); } diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp index fa3d9da3177d53..18abc44686e7f6 100644 --- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp +++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp @@ -491,7 +491,7 @@ void MatterGeneralDiagnosticsPluginServerInitCallback() { BootReasonEnum bootReason; - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); ConnectivityMgr().SetDelegate(&gDiagnosticDelegate); if (GetDiagnosticDataProvider().GetBootReason(bootReason) == CHIP_NO_ERROR) diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index 518e28b94fbd2b..61c8089d7f4cb4 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -436,7 +436,7 @@ GroupKeyManagementAttributeAccess gAttribute; void MatterGroupKeyManagementPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttribute); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttribute); } // diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp index 55f6b5129c0a41..99a9e0ab5f172d 100644 --- a/src/app/clusters/icd-management-server/icd-management-server.cpp +++ b/src/app/clusters/icd-management-server/icd-management-server.cpp @@ -458,7 +458,7 @@ void MatterIcdManagementPluginServerInitCallback() // Configure and register Attribute Access Override gAttribute.Init(storage, symmetricKeystore, fabricTable, icdConfigurationData); - registerAttributeAccessOverride(&gAttribute); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttribute); // Configure ICD Management ICDManagementServer::Init(storage, symmetricKeystore, icdConfigurationData); diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index a9903b754591a4..80228a6c4f2740 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -196,5 +196,5 @@ bool emberAfKeypadInputClusterSendKeyCallback(app::CommandHandler * command, con void MatterKeypadInputPluginServerInitCallback() { - registerAttributeAccessOverride(&gKeypadInputAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gKeypadInputAttrAccess); } diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp index d8270a17bc46f6..43c50b1c2c9ec1 100644 --- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp +++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp @@ -149,7 +149,7 @@ CHIP_ERROR LaundryDryerControlsServer::ReadSupportedDrynessLevels(const Concrete void MatterLaundryDryerControlsPluginServerInitCallback() { LaundryDryerControlsServer & laundryDryerControlsServer = LaundryDryerControlsServer::Instance(); - registerAttributeAccessOverride(&laundryDryerControlsServer); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&laundryDryerControlsServer); } Status MatterLaundryDryerControlsClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp index 2fa6ee838c14b2..9b07c72c480aa2 100644 --- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp +++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp @@ -187,7 +187,7 @@ CHIP_ERROR LaundryWasherControlsServer::ReadSupportedRinses(const ConcreteReadAt void MatterLaundryWasherControlsPluginServerInitCallback() { LaundryWasherControlsServer & laundryWasherControlsServer = LaundryWasherControlsServer::Instance(); - registerAttributeAccessOverride(&laundryWasherControlsServer); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&laundryWasherControlsServer); } Status MatterLaundryWasherControlsClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, diff --git a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp index 1b26542df3ed55..72cd0c4bc90fa8 100644 --- a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp +++ b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp @@ -221,5 +221,5 @@ void emberAfLocalizationConfigurationClusterServerInitCallback(EndpointId endpoi void MatterLocalizationConfigurationPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index 267f4e987a1da1..7d9f30968ff08d 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -294,5 +294,5 @@ bool emberAfMediaInputClusterRenameInputCallback(app::CommandHandler * command, void MatterMediaInputPluginServerInitCallback() { - registerAttributeAccessOverride(&gMediaInputAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaInputAttrAccess); } diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index b13a46d0101dd7..8bcbb4bd5c5b53 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -708,5 +708,5 @@ void MatterMediaPlaybackClusterServerAttributeChangedCallback(const chip::app::C void MatterMediaPlaybackPluginServerInitCallback() { - registerAttributeAccessOverride(&gMediaPlaybackAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaPlaybackAttrAccess); } diff --git a/src/app/clusters/messages-server/messages-server.cpp b/src/app/clusters/messages-server/messages-server.cpp index 0c03c95572dc74..e6f742c7f136ee 100644 --- a/src/app/clusters/messages-server/messages-server.cpp +++ b/src/app/clusters/messages-server/messages-server.cpp @@ -293,5 +293,5 @@ bool emberAfMessagesClusterCancelMessagesRequestCallback( void MatterMessagesPluginServerInitCallback() { - registerAttributeAccessOverride(&gMessagesAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMessagesAttrAccess); } diff --git a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp index 9498d0abfefa0c..05bc66f5478e7a 100644 --- a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp +++ b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp @@ -90,7 +90,8 @@ CHIP_ERROR Instance::Init() "Microwave Oven Control: feature bits error, if feature supports PowerNumberLimits it must support PowerAsNumber")); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); // If the PowerInWatts feature is supported, get the count of supported watt levels so we can later // ensure incoming watt level values are valid. if (HasFeature(MicrowaveOvenControl::Feature::kPowerInWatts)) diff --git a/src/app/clusters/mode-base-server/mode-base-server.cpp b/src/app/clusters/mode-base-server/mode-base-server.cpp index 6ebad8b3e1e83d..5c5b6d9429c45d 100644 --- a/src/app/clusters/mode-base-server/mode-base-server.cpp +++ b/src/app/clusters/mode-base-server/mode-base-server.cpp @@ -79,7 +79,8 @@ CHIP_ERROR Instance::Init() LoadPersistentAttributes(); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); RegisterThisInstance(); ReturnErrorOnFailure(mDelegate->Init()); diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp index dceb72767bfb14..2a582f4320333d 100644 --- a/src/app/clusters/mode-select-server/mode-select-server.cpp +++ b/src/app/clusters/mode-select-server/mode-select-server.cpp @@ -219,7 +219,7 @@ inline bool areStartUpModeAndCurrentModeNonVolatile(EndpointId endpointId) void MatterModeSelectPluginServerInitCallback() { - registerAttributeAccessOverride(&gModeSelectAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gModeSelectAttrAccess); } /** diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index b69d3e40248c4e..7d9d79a4a20f04 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -359,7 +359,8 @@ Instance::Instance(EndpointId aEndpointId, EthernetDriver * apDelegate) : CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler, reinterpret_cast(this))); ReturnErrorOnFailure(mpBaseDriver->Init(this)); mLastNetworkingStatusValue.SetNull(); diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 366694a8c504d3..14fdf41c1664fb 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -396,7 +396,7 @@ OpCredsFabricTableDelegate gFabricDelegate; void MatterOperationalCredentialsPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gFabricDelegate); diff --git a/src/app/clusters/operational-state-server/operational-state-server.cpp b/src/app/clusters/operational-state-server/operational-state-server.cpp index b3fdf545a605d5..7e4829a111b02f 100644 --- a/src/app/clusters/operational-state-server/operational-state-server.cpp +++ b/src/app/clusters/operational-state-server/operational-state-server.cpp @@ -64,7 +64,8 @@ CHIP_ERROR Instance::Init() ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp index 7bfbde1fa54ac5..49440e69bba0b8 100644 --- a/src/app/clusters/ota-requestor/ota-requestor-server.cpp +++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp @@ -295,5 +295,5 @@ bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOTAProviderCallback( void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp index a8a9d4e80e8189..33be0c86266974 100644 --- a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp +++ b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp @@ -100,5 +100,5 @@ CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(const ConcreteReadAttributeP void MatterPowerSourceConfigurationPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/power-source-server/power-source-server.cpp b/src/app/clusters/power-source-server/power-source-server.cpp index 43ca1827515731..c0f4f27357017b 100644 --- a/src/app/clusters/power-source-server/power-source-server.cpp +++ b/src/app/clusters/power-source-server/power-source-server.cpp @@ -91,7 +91,7 @@ PowerSourceClusterInfo * sPowerSourceClusterInfo = nullptr; void MatterPowerSourcePluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } namespace chip { diff --git a/src/app/clusters/power-topology-server/power-topology-server.cpp b/src/app/clusters/power-topology-server/power-topology-server.cpp index 5494d292e7e59b..40e2e449575c91 100644 --- a/src/app/clusters/power-topology-server/power-topology-server.cpp +++ b/src/app/clusters/power-topology-server/power-topology-server.cpp @@ -41,7 +41,8 @@ namespace PowerTopology { CHIP_ERROR Instance::Init() { - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp index bca1d16c589d2f..a36b6187c2d364 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp @@ -73,7 +73,8 @@ CHIP_ERROR Instance::Init() LoadPersistentAttributes(); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); ChipLogDetail(Zcl, "ResourceMonitoring: calling mDelegate->Init()"); ReturnErrorOnFailure(mDelegate->Init()); diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h index 8cdc74f34c1b0d..e56d4d6ec70346 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h @@ -74,7 +74,8 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface * @die If the endpoint and cluster ID have not been enabled in zap. * @return CHIP_ERROR_INVALID_ARGUMENT If the CommandHandler or Attribute Handler could not be registered. * @return CHIP_ERROR_INCORRECT_STATE If the CommandHandler was already registered - * @return CHIP_ERROR_INCORRECT_STATE If the registerAttributeAccessOverride fails. + * @return CHIP_ERROR_INCORRECT_STATE If the + * chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride fails. * @return CHIP_ERROR If the AppInit() method returned an error. This is application specific. * * @return CHIP_NO_ERROR If the cluster was initialised successfully. diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.cpp b/src/app/clusters/sample-mei-server/sample-mei-server.cpp index 29ab1417dc8d27..f4afb6fb820f81 100644 --- a/src/app/clusters/sample-mei-server/sample-mei-server.cpp +++ b/src/app/clusters/sample-mei-server/sample-mei-server.cpp @@ -31,7 +31,9 @@ void MatterSampleMeiPluginServerInitCallback() ChipLogProgress(Zcl, "Sample MEI Init. Ep %d, Total Ep %u", MATTER_DM_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT, static_cast(kNumSupportedEndpoints)); ReturnOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&SampleMeiServer::Instance())); - VerifyOrReturn(registerAttributeAccessOverride(&SampleMeiServer::Instance()), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn( + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&SampleMeiServer::Instance()), + CHIP_ERROR_INCORRECT_STATE); } void emberAfSampleMeiClusterServerInitCallback(chip::EndpointId endpoint) diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index 98663e2e3582df..d6e71ead9bfc16 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -340,7 +340,8 @@ CHIP_ERROR ScenesServer::Init() VerifyOrReturnError(!mIsInitialized, CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(chip::app::CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INCORRECT_STATE); mGroupProvider = Credentials::GetGroupDataProvider(); SceneTable * sceneTable = scenes::GetSceneTableImpl(); diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp index 51164ca5bcb1a9..76b17c303b28d0 100644 --- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp +++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp @@ -230,6 +230,6 @@ bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandle void MatterSoftwareDiagnosticsPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gCommandHandler); } diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 42c852b81c8c5a..912ad63cb687fe 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -261,5 +261,5 @@ void MatterTargetNavigatorClusterServerAttributeChangedCallback(const chip::app: void MatterTargetNavigatorPluginServerInitCallback() { - registerAttributeAccessOverride(&gTargetNavigatorAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gTargetNavigatorAttrAccess); } diff --git a/src/app/clusters/temperature-control-server/temperature-control-server.cpp b/src/app/clusters/temperature-control-server/temperature-control-server.cpp index 85035c642d4092..b29c3bed509c34 100644 --- a/src/app/clusters/temperature-control-server/temperature-control-server.cpp +++ b/src/app/clusters/temperature-control-server/temperature-control-server.cpp @@ -228,5 +228,5 @@ void emberAfTemperatureControlClusterServerInitCallback(EndpointId endpoint) {} void MatterTemperatureControlPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index 4b6fc979336ab3..b1bfa60d54ed6a 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -1119,5 +1119,5 @@ bool emberAfUnitTestingClusterTestSecondBatchHelperRequestCallback( void MatterUnitTestingPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index 214594667b9eb8..9facdf4cc9ea3a 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -928,5 +928,5 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co void MatterThermostatPluginServerInitCallback() { - registerAttributeAccessOverride(&gThermostatAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gThermostatAttrAccess); } diff --git a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp index c2e198736ff9e4..514e074cfd306f 100644 --- a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp +++ b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp @@ -204,6 +204,6 @@ bool emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandl void MatterThreadNetworkDiagnosticsPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); GetDiagnosticDataProvider().SetThreadDiagnosticsDelegate(&gDiagnosticDelegate); } diff --git a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp index 9ce9cf1513a98d..ef39d9f40fe7ca 100644 --- a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp +++ b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp @@ -53,7 +53,8 @@ ThreadNetworkDirectoryServer::~ThreadNetworkDirectoryServer() CHIP_ERROR ThreadNetworkDirectoryServer::Init() { - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 7e61e340f1fab1..cb11f389445411 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -232,5 +232,5 @@ void emberAfTimeFormatLocalizationClusterServerInitCallback(EndpointId endpoint) void MatterTimeFormatLocalizationPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp index fda3bb50d7fda0..6acabb15fa543f 100644 --- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp +++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp @@ -1290,5 +1290,5 @@ bool emberAfTimeSynchronizationClusterSetDefaultNTPCallback( void MatterTimeSynchronizationPluginServerInitCallback() { TimeSynchronizationServer::Instance().Init(); - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/user-label-server/user-label-server.cpp b/src/app/clusters/user-label-server/user-label-server.cpp index 5131ed44aaca2b..bf953b758f8636 100644 --- a/src/app/clusters/user-label-server/user-label-server.cpp +++ b/src/app/clusters/user-label-server/user-label-server.cpp @@ -219,6 +219,6 @@ UserLabelFabricTableDelegate gUserLabelFabricDelegate; void MatterUserLabelPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gUserLabelFabricDelegate); } diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp index 02486beea315a4..2b75db5de1ba35 100644 --- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp +++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp @@ -514,5 +514,5 @@ bool emberAfValveConfigurationAndControlClusterCloseCallback( void MatterValveConfigurationAndControlPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp index 3141094d1fa3c7..e59f3df1c18d15 100644 --- a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp @@ -142,5 +142,5 @@ CHIP_ERROR WakeOnLanAttrAccess::ReadMacAddressAttribute(app::AttributeValueEncod void MatterWakeOnLanPluginServerInitCallback() { - registerAttributeAccessOverride(&gWakeOnLanAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gWakeOnLanAttrAccess); } diff --git a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp index e119cfd7c2972f..ac436f15b556c9 100644 --- a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp +++ b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp @@ -317,6 +317,6 @@ bool emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandler void MatterWiFiNetworkDiagnosticsPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); GetDiagnosticDataProvider().SetWiFiDiagnosticsDelegate(&gDiagnosticDelegate); } diff --git a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp index 28247d1bbc2c2d..1476d24945cd1c 100644 --- a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp +++ b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp @@ -69,7 +69,8 @@ WiFiNetworkManagementServer::~WiFiNetworkManagementServer() CHIP_ERROR WiFiNetworkManagementServer::Init() { - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; } diff --git a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp index 446181a3f72395..a38c47edcfd5e4 100644 --- a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp @@ -591,9 +591,12 @@ class RegisteredAttributeAccessInterface template RegisteredAttributeAccessInterface(Args &&... args) : mData(std::forward(args)...) { - VerifyOrDie(registerAttributeAccessOverride(&mData)); + VerifyOrDie(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&mData)); + } + ~RegisteredAttributeAccessInterface() + { + chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(&mData); } - ~RegisteredAttributeAccessInterface() { chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(&mData); } T * operator->() { return &mData; } T & operator*() { return mData; } diff --git a/src/controller/tests/TestEventChunking.cpp b/src/controller/tests/TestEventChunking.cpp index 0aa0b9d0a5714f..64dd8939b4a9e2 100644 --- a/src/controller/tests/TestEventChunking.cpp +++ b/src/controller/tests/TestEventChunking.cpp @@ -220,7 +220,7 @@ class TestAttrAccess : public app::AttributeAccessInterface // Register for the Test Cluster cluster on all endpoints. TestAttrAccess() : AttributeAccessInterface(Optional::Missing(), Clusters::UnitTesting::Id) { - registerAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this); } CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; diff --git a/src/controller/tests/TestReadChunking.cpp b/src/controller/tests/TestReadChunking.cpp index b00d0bed75ebcf..30ae7adc368201 100644 --- a/src/controller/tests/TestReadChunking.cpp +++ b/src/controller/tests/TestReadChunking.cpp @@ -360,7 +360,7 @@ class TestAttrAccess : public app::AttributeAccessInterface // Register for the Test Cluster cluster on all endpoints. TestAttrAccess() : AttributeAccessInterface(Optional::Missing(), Clusters::UnitTesting::Id) { - registerAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this); } CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; diff --git a/src/controller/tests/TestWriteChunking.cpp b/src/controller/tests/TestWriteChunking.cpp index 9ffad2c602835c..5fee4497bacc87 100644 --- a/src/controller/tests/TestWriteChunking.cpp +++ b/src/controller/tests/TestWriteChunking.cpp @@ -217,7 +217,7 @@ TEST_F(TestWriteChunking, TestListChunking) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - registerAttributeAccessOverride(&testServer); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); // @@ -290,7 +290,7 @@ TEST_F(TestWriteChunking, TestBadChunking) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - registerAttributeAccessOverride(&testServer); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); @@ -369,7 +369,7 @@ TEST_F(TestWriteChunking, TestConflictWrite) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - registerAttributeAccessOverride(&testServer); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); @@ -443,7 +443,7 @@ TEST_F(TestWriteChunking, TestNonConflictWrite) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - registerAttributeAccessOverride(&testServer); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); app::AttributePathParams attributePath1(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); app::AttributePathParams attributePath2(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute2); @@ -591,7 +591,7 @@ TEST_F(TestWriteChunking, TestTransactionalList) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - registerAttributeAccessOverride(&testServer); + chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); // Test 1: we should receive transaction notifications ChipLogProgress(Zcl, "Test 1: we should receive transaction notifications"); diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm index d04335e30b1700..53c228e22e06c8 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm @@ -379,7 +379,7 @@ - (void)registerMatterCluster std::lock_guard lock(_lock); - if (!registerAttributeAccessOverride(_attributeAccessInterface.get())) { + if (!chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(_attributeAccessInterface.get())) { // This should only happen if we somehow managed to register an // AttributeAccessInterface for the same (endpoint, cluster) pair. MTR_LOG_ERROR("Could not register AttributeAccessInterface for endpoint %u, cluster 0x%llx", From 52b43aecfd27b11e5bb2467d8767a5291d1ff0a8 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:22:11 -0400 Subject: [PATCH 06/32] Update the getter --- src/app/WriteHandler.cpp | 4 ++-- src/app/codegen-data-model/CodegenDataModel_Read.cpp | 2 +- src/app/codegen-data-model/CodegenDataModel_Write.cpp | 2 +- src/app/util/ember-compatibility-functions.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index d19d3ae3b37d0a..8d4a82d11630c4 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -196,7 +196,7 @@ CHIP_ERROR WriteHandler::SendWriteResponse(System::PacketBufferTLVWriter && aMes void WriteHandler::DeliverListWriteBegin(const ConcreteAttributePath & aPath) { - if (auto * attrOverride = GetAttributeAccessOverride(aPath.mEndpointId, aPath.mClusterId)) + if (auto * attrOverride = AttributeAccessInterfaceRegistry::Instance().Get(aPath.mEndpointId, aPath.mClusterId)) { attrOverride->OnListWriteBegin(aPath); } @@ -204,7 +204,7 @@ void WriteHandler::DeliverListWriteBegin(const ConcreteAttributePath & aPath) void WriteHandler::DeliverListWriteEnd(const ConcreteAttributePath & aPath, bool writeWasSuccessful) { - if (auto * attrOverride = GetAttributeAccessOverride(aPath.mEndpointId, aPath.mClusterId)) + if (auto * attrOverride = AttributeAccessInterfaceRegistry::Instance().Get(aPath.mEndpointId, aPath.mClusterId)) { attrOverride->OnListWriteEnd(aPath, writeWasSuccessful); } diff --git a/src/app/codegen-data-model/CodegenDataModel_Read.cpp b/src/app/codegen-data-model/CodegenDataModel_Read.cpp index 3e1f246cb3a2f9..9a7a719ea757cc 100644 --- a/src/app/codegen-data-model/CodegenDataModel_Read.cpp +++ b/src/app/codegen-data-model/CodegenDataModel_Read.cpp @@ -308,7 +308,7 @@ CHIP_ERROR CodegenDataModel::ReadAttribute(const InteractionModel::ReadAttribute else { aai_result = TryReadViaAccessInterface( - request.path, GetAttributeAccessOverride(request.path.mEndpointId, request.path.mClusterId), encoder); + request.path, AttributeAccessInterfaceRegistry::Instance().Get(request.path.mEndpointId, request.path.mClusterId), encoder); } ReturnErrorCodeIf(aai_result.has_value(), *aai_result); diff --git a/src/app/codegen-data-model/CodegenDataModel_Write.cpp b/src/app/codegen-data-model/CodegenDataModel_Write.cpp index 999f35ea7836cf..0d890ceb4d84bb 100644 --- a/src/app/codegen-data-model/CodegenDataModel_Write.cpp +++ b/src/app/codegen-data-model/CodegenDataModel_Write.cpp @@ -345,7 +345,7 @@ CHIP_ERROR CodegenDataModel::WriteAttribute(const InteractionModel::WriteAttribu } } - AttributeAccessInterface * aai = GetAttributeAccessOverride(request.path.mEndpointId, request.path.mClusterId); + AttributeAccessInterface * aai = AttributeAccessInterfaceRegistry::Instance().Get(request.path.mEndpointId, request.path.mClusterId); std::optional aai_result = TryWriteViaAccessInterface(request.path, aai, decoder); if (aai_result.has_value()) { diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index e7437ef0db1f9a..62ea530d2f36dc 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -313,7 +313,7 @@ CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, b // reader (which can be lightweight constructed even from nullptr). GlobalAttributeReader reader(attributeCluster); AttributeAccessInterface * attributeOverride = - (attributeCluster != nullptr) ? &reader : GetAttributeAccessOverride(aPath.mEndpointId, aPath.mClusterId); + (attributeCluster != nullptr) ? &reader : AttributeAccessInterfaceRegistry::Instance().Get(aPath.mEndpointId, aPath.mClusterId); if (attributeOverride) { bool triedEncode = false; @@ -713,7 +713,7 @@ CHIP_ERROR WriteSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, return apWriteHandler->AddStatus(aPath, Protocols::InteractionModel::Status::DataVersionMismatch); } - if (auto * attrOverride = GetAttributeAccessOverride(aPath.mEndpointId, aPath.mClusterId)) + if (auto * attrOverride = AttributeAccessInterfaceRegistry::Instance().Get(aPath.mEndpointId, aPath.mClusterId)) { AttributeValueDecoder valueDecoder(aReader, aSubjectDescriptor); ReturnErrorOnFailure(attrOverride->Write(aPath, valueDecoder)); From 14c66a6f8761bb38637fe1fa7bcd29c9a5b64485 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:22:37 -0400 Subject: [PATCH 07/32] Restyle --- src/app/codegen-data-model/CodegenDataModel_Read.cpp | 3 ++- src/app/codegen-data-model/CodegenDataModel_Write.cpp | 3 ++- src/app/util/ember-compatibility-functions.cpp | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/codegen-data-model/CodegenDataModel_Read.cpp b/src/app/codegen-data-model/CodegenDataModel_Read.cpp index 9a7a719ea757cc..ed0e1048a4bf25 100644 --- a/src/app/codegen-data-model/CodegenDataModel_Read.cpp +++ b/src/app/codegen-data-model/CodegenDataModel_Read.cpp @@ -308,7 +308,8 @@ CHIP_ERROR CodegenDataModel::ReadAttribute(const InteractionModel::ReadAttribute else { aai_result = TryReadViaAccessInterface( - request.path, AttributeAccessInterfaceRegistry::Instance().Get(request.path.mEndpointId, request.path.mClusterId), encoder); + request.path, AttributeAccessInterfaceRegistry::Instance().Get(request.path.mEndpointId, request.path.mClusterId), + encoder); } ReturnErrorCodeIf(aai_result.has_value(), *aai_result); diff --git a/src/app/codegen-data-model/CodegenDataModel_Write.cpp b/src/app/codegen-data-model/CodegenDataModel_Write.cpp index 0d890ceb4d84bb..89fcae9f25ce7f 100644 --- a/src/app/codegen-data-model/CodegenDataModel_Write.cpp +++ b/src/app/codegen-data-model/CodegenDataModel_Write.cpp @@ -345,7 +345,8 @@ CHIP_ERROR CodegenDataModel::WriteAttribute(const InteractionModel::WriteAttribu } } - AttributeAccessInterface * aai = AttributeAccessInterfaceRegistry::Instance().Get(request.path.mEndpointId, request.path.mClusterId); + AttributeAccessInterface * aai = + AttributeAccessInterfaceRegistry::Instance().Get(request.path.mEndpointId, request.path.mClusterId); std::optional aai_result = TryWriteViaAccessInterface(request.path, aai, decoder); if (aai_result.has_value()) { diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 62ea530d2f36dc..d556d8816c2145 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -312,8 +312,9 @@ CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, b // Special handling for mandatory global attributes: these are always for attribute list, using a special // reader (which can be lightweight constructed even from nullptr). GlobalAttributeReader reader(attributeCluster); - AttributeAccessInterface * attributeOverride = - (attributeCluster != nullptr) ? &reader : AttributeAccessInterfaceRegistry::Instance().Get(aPath.mEndpointId, aPath.mClusterId); + AttributeAccessInterface * attributeOverride = (attributeCluster != nullptr) + ? &reader + : AttributeAccessInterfaceRegistry::Instance().Get(aPath.mEndpointId, aPath.mClusterId); if (attributeOverride) { bool triedEncode = false; From a74a53ae19f6bc11d7ee57bf233c37456bdb6da0 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:24:24 -0400 Subject: [PATCH 08/32] Fix unregister --- docs/upgrading.md | 8 ++++---- src/app/util/attribute-storage.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index 2756f55cfa6bad..cb260f9eb26a06 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -69,13 +69,13 @@ independent of the InteractionModelEngine class. The following replacements exist: - `chip::app::InteractionModelEngine::RegisterCommandHandler` replaced by - `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().RegisterCommandHandler` + `chip::app::CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler` - `chip::app::InteractionModelEngine::UnregisterCommandHandler` replaced by - `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().UnregisterCommandHandler` + `chip::app::CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler` - `chip::app::InteractionModelEngine::FindCommandHandler` replaced by - `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().GetCommandHandler` + `chip::app::CommandHandlerInterfaceRegistry::Instance().GetCommandHandler` - `chip::app::InteractionModelEngine::UnregisterCommandHandlers` replaced by - `chip::app::CommandHandlerInterfaceRegistry::Instance().Instance().UnregisterAllCommandHandlersForEndpoint` + `chip::app::CommandHandlerInterfaceRegistry::Instance().UnregisterAllCommandHandlersForEndpoint` ### AttributeAccessInterface register/unregister diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 5bede1986d5909..90b2e8cf11c556 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -423,7 +423,7 @@ static void shutdownEndpoint(EmberAfDefinedEndpoint * definedEndpoint) } CommandHandlerInterfaceRegistry::Instance().UnregisterAllCommandHandlersForEndpoint(definedEndpoint->endpoint); - unregisterAllAttributeAccessOverridesForEndpoint(definedEndpoint); + AttributeAccessInterfaceRegistry::Instance().UnregisterAllForEndpoint(definedEndpoint); } // Calls the init functions. From 4fef2358c8f783dd867fdeb5901d08d273493128 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:26:23 -0400 Subject: [PATCH 09/32] Fix typo --- src/app/AttributeAccessInterfaceRegistry.cpp | 12 ++++++------ src/app/AttributeAccessInterfaceRegistry.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index b8c33616569b24..e2ea46775e5f41 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -61,20 +61,20 @@ void UnregisterMatchingAttributeAccessInterfaces(F shouldUnregister, AttributeAc namespace chip { namespace app { -AttributeHandlerInterfaceRegistry & Instance() +AttributeAccessInterfaceRegistry & Instance() { - static AttributeHandlerInterfaceRegistry instance; + static AttributeAccessInterfaceRegistry instance; return instance; } -void AttributeHandlerInterfaceRegistry::UnregisterAllForEndpoint(EmberAfDefinedEndpoint * definedEndpoint) +void AttributeAccessInterfaceRegistry::UnregisterAllForEndpoint(EmberAfDefinedEndpoint * definedEndpoint) { UnregisterMatchingAttributeAccessInterfaces( [endpoint = definedEndpoint->endpoint](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpoint); }, mAttributeAccessOverrides); } -AttributeAccessInterface * AttributeHandlerInterfaceRegistry::Get(EndpointId endpointId, ClusterId clusterId) +AttributeAccessInterface * AttributeAccessInterfaceRegistry::Get(EndpointId endpointId, ClusterId clusterId) { using CacheResult = AttributeAccessInterfaceCache::CacheResult; @@ -105,14 +105,14 @@ AttributeAccessInterface * AttributeHandlerInterfaceRegistry::Get(EndpointId end return nullptr; } -void AttributeHandlerInterfaceRegistry::UnregisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) +void AttributeAccessInterfaceRegistry::UnregisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) { mAttributeAccessInterfaceCache.Invalidate(); UnregisterMatchingAttributeAccessInterfaces([attrOverride](AttributeAccessInterface * entry) { return entry == attrOverride; }, mAttributeAccessOverrides); } -bool AttributeHandlerInterfaceRegistry::RegisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) +bool AttributeAccessInterfaceRegistry::RegisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) { mAttributeAccessInterfaceCache.Invalidate(); for (auto * cur = mAttributeAccessOverrides; cur; cur = cur->GetNext()) diff --git a/src/app/AttributeAccessInterfaceRegistry.h b/src/app/AttributeAccessInterfaceRegistry.h index b668f07eaedbeb..a3f9f3ccf96af3 100644 --- a/src/app/AttributeAccessInterfaceRegistry.h +++ b/src/app/AttributeAccessInterfaceRegistry.h @@ -22,7 +22,7 @@ namespace chip { namespace app { -class AttributeHandlerInterfaceRegistry +class AttributeAccessInterfaceRegistry { public: /** @@ -54,7 +54,7 @@ class AttributeHandlerInterfaceRegistry */ AttributeAccessInterface * Get(EndpointId aEndpointId, ClusterId aClusterId); - static AttributeHandlerInterfaceRegistry & Instance(); + static AttributeAccessInterfaceRegistry & Instance(); private: AttributeAccessInterface * mAttributeAccessOverrides = nullptr; From 2f09f5525ad0507189d6ae6ffbd163633be4a1b8 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:28:19 -0400 Subject: [PATCH 10/32] Fix namespacing for instance --- src/app/AttributeAccessInterfaceRegistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index e2ea46775e5f41..f7b802105a9a33 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -61,7 +61,7 @@ void UnregisterMatchingAttributeAccessInterfaces(F shouldUnregister, AttributeAc namespace chip { namespace app { -AttributeAccessInterfaceRegistry & Instance() +AttributeAccessInterfaceRegistry & AttributeAccessInterfaceRegistry::Instance() { static AttributeAccessInterfaceRegistry instance; return instance; From 9ab17587b5cfb4ef051b51739d3f012e1829f778 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:30:42 -0400 Subject: [PATCH 11/32] Do not make IME auto-clear command handlers --- src/app/InteractionModelEngine.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 1a4bfa66f3c31a..8219046f0eb492 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -99,11 +99,6 @@ CHIP_ERROR InteractionModelEngine::Init(Messaging::ExchangeManager * apExchangeM void InteractionModelEngine::Shutdown() { mpExchangeMgr->GetSessionManager()->SystemLayer()->CancelTimer(ResumeSubscriptionsTimerCallback, this); - - // TODO: individual object clears the entire command handler interface registry. - // This may not be expected. - CommandHandlerInterfaceRegistry::Instance().UnregisterAllHandlers(); - mCommandResponderObjs.ReleaseAll(); mTimedHandlers.ForEachActiveObject([this](TimedHandler * obj) -> Loop { From d75f00df69da3fe1525c4e6eab27a664108500a2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:33:10 -0400 Subject: [PATCH 12/32] Make spellcheck happy --- docs/upgrading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index cb260f9eb26a06..874c6a877b1bde 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -77,7 +77,7 @@ The following replacements exist: - `chip::app::InteractionModelEngine::UnregisterCommandHandlers` replaced by `chip::app::CommandHandlerInterfaceRegistry::Instance().UnregisterAllCommandHandlersForEndpoint` -### AttributeAccessInterface register/unregister +### AttributeAccessInterface registration and removal A new object exists for the attribute access interface registry, accessible as `chip::app::AttributeHandlerInterfaceRegistry::Instance()` From c261b7fc6a87d40f24db1fea3915c5d0bca74380 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:43:35 -0400 Subject: [PATCH 13/32] Remove chip::app prefix throughout --- .../cluster_and_device_type_dev.md | 3 +-- .../all-clusters-common/src/fan-stub.cpp | 2 +- examples/bridge-app/asr/src/bridged-actions-stub.cpp | 2 +- examples/bridge-app/esp32/main/DeviceCallbacks.cpp | 2 +- examples/bridge-app/linux/bridged-actions-stub.cpp | 2 +- examples/bridge-app/linux/main.cpp | 2 +- examples/bridge-app/telink/src/DeviceCallbacks.cpp | 2 +- examples/chef/common/chef-fan-control-manager.cpp | 2 +- src/app/AttributeAccessInterface.h | 2 +- .../access-control-server/access-control-server.cpp | 2 +- .../account-login-server/account-login-server.cpp | 2 +- .../administrator-commissioning-server.cpp | 2 +- .../clusters/air-quality-server/air-quality-server.cpp | 4 ++-- .../application-basic-server.cpp | 2 +- .../application-launcher-server.cpp | 2 +- .../audio-output-server/audio-output-server.cpp | 2 +- .../clusters/basic-information/basic-information.cpp | 2 +- src/app/clusters/bindings/bindings.cpp | 2 +- .../boolean-state-configuration-server.cpp | 2 +- src/app/clusters/channel-server/channel-server.cpp | 2 +- .../concentration-measurement-server.h | 4 ++-- .../content-launch-server/content-launch-server.cpp | 2 +- src/app/clusters/descriptor/descriptor.cpp | 2 +- .../device-energy-management-server.cpp | 4 ++-- src/app/clusters/door-lock-server/door-lock-server.cpp | 2 +- .../electrical-energy-measurement-server.cpp | 4 ++-- .../electrical-power-measurement-server.cpp | 4 ++-- .../clusters/energy-evse-server/energy-evse-server.cpp | 4 ++-- .../energy-preference-server.cpp | 4 ++-- .../ethernet-network-diagnostics-server.cpp | 2 +- .../clusters/fixed-label-server/fixed-label-server.cpp | 2 +- .../general-commissioning-server.cpp | 2 +- .../general-diagnostics-server.cpp | 2 +- .../group-key-mgmt-server/group-key-mgmt-server.cpp | 2 +- .../icd-management-server/icd-management-server.cpp | 2 +- .../keypad-input-server/keypad-input-server.cpp | 2 +- .../laundry-dryer-controls-server.cpp | 2 +- .../laundry-washer-controls-server.cpp | 2 +- .../localization-configuration-server.cpp | 2 +- .../clusters/media-input-server/media-input-server.cpp | 2 +- .../media-playback-server/media-playback-server.cpp | 2 +- src/app/clusters/messages-server/messages-server.cpp | 2 +- .../microwave-oven-control-server.cpp | 4 ++-- src/app/clusters/mode-base-server/mode-base-server.cpp | 4 ++-- .../clusters/mode-select-server/mode-select-server.cpp | 2 +- .../network-commissioning/network-commissioning.cpp | 2 +- .../operational-credentials-server.cpp | 2 +- .../operational-state-server.cpp | 4 ++-- .../clusters/ota-requestor/ota-requestor-server.cpp | 2 +- .../power-source-configuration-server.cpp | 2 +- .../power-source-server/power-source-server.cpp | 2 +- .../power-topology-server/power-topology-server.cpp | 4 ++-- .../resource-monitoring-server.cpp | 4 ++-- .../resource-monitoring-server.h | 2 +- .../clusters/sample-mei-server/sample-mei-server.cpp | 2 +- src/app/clusters/scenes-server/scenes-server.cpp | 2 +- .../software-diagnostics-server.cpp | 2 +- .../target-navigator-server.cpp | 2 +- .../temperature-control-server.cpp | 2 +- .../test-cluster-server/test-cluster-server.cpp | 2 +- .../clusters/thermostat-server/thermostat-server.cpp | 2 +- .../thread-network-diagnostics-server.cpp | 2 +- .../thread-network-directory-server.cpp | 4 ++-- .../time-format-localization-server.cpp | 2 +- .../time-synchronization-server.cpp | 2 +- .../clusters/user-label-server/user-label-server.cpp | 2 +- .../valve-configuration-and-control-server.cpp | 2 +- .../clusters/wake-on-lan-server/wake-on-lan-server.cpp | 2 +- .../wifi-network-diagnostics-server.cpp | 2 +- .../wifi-network-management-server.cpp | 4 ++-- .../tests/TestCodegenModelViaMocks.cpp | 4 ++-- src/controller/tests/TestEventChunking.cpp | 2 +- src/controller/tests/TestReadChunking.cpp | 2 +- src/controller/tests/TestWriteChunking.cpp | 10 +++++----- .../Framework/CHIP/ServerEndpoint/MTRServerCluster.mm | 4 ++-- 75 files changed, 95 insertions(+), 96 deletions(-) diff --git a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md index 791934b4ef4d3c..a07961cf1a36e4 100644 --- a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md +++ b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md @@ -107,8 +107,7 @@ ending in the cluster initialization code. EmberAfInitializeAttributes - ember attribute storage - for all attributes marked as “RAM” in the zap, sets defaults in the storage MatterPluginServerCallback - .h is a generated file, .cpp impl is done -in the server cluster code. Use this to setup the cluster and do attribute -overrides +in the server cluster code. Use this to setup the cluster and setup overrides in chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride - use this if you want to handle attribute reads and writes externally diff --git a/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp index eb88db22cba95c..54902dfcc96ddf 100644 --- a/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp @@ -173,6 +173,6 @@ void emberAfFanControlClusterInitCallback(EndpointId endpoint) { VerifyOrDie(mFanControlManager == nullptr); mFanControlManager = new FanControlManager(endpoint); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(mFanControlManager); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(mFanControlManager); FanControl::SetDefaultDelegate(endpoint, mFanControlManager); } diff --git a/examples/bridge-app/asr/src/bridged-actions-stub.cpp b/examples/bridge-app/asr/src/bridged-actions-stub.cpp index d2de5faf375e34..2e47b2f385a1e2 100755 --- a/examples/bridge-app/asr/src/bridged-actions-stub.cpp +++ b/examples/bridge-app/asr/src/bridged-actions-stub.cpp @@ -97,5 +97,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/bridge-app/esp32/main/DeviceCallbacks.cpp b/examples/bridge-app/esp32/main/DeviceCallbacks.cpp index 4ef5e2ecf35750..a493243cecfe0e 100644 --- a/examples/bridge-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/bridge-app/esp32/main/DeviceCallbacks.cpp @@ -113,5 +113,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/bridge-app/linux/bridged-actions-stub.cpp b/examples/bridge-app/linux/bridged-actions-stub.cpp index 693042c5e5d078..871f54a194e3bf 100644 --- a/examples/bridge-app/linux/bridged-actions-stub.cpp +++ b/examples/bridge-app/linux/bridged-actions-stub.cpp @@ -133,5 +133,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 6ca5adea6a419d..4c44f83a6485c1 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -999,7 +999,7 @@ void ApplicationInit() } } - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gPowerAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gPowerAttrAccess); } void ApplicationShutdown() {} diff --git a/examples/bridge-app/telink/src/DeviceCallbacks.cpp b/examples/bridge-app/telink/src/DeviceCallbacks.cpp index fd12a2a011c440..7e451a7577ce94 100644 --- a/examples/bridge-app/telink/src/DeviceCallbacks.cpp +++ b/examples/bridge-app/telink/src/DeviceCallbacks.cpp @@ -101,5 +101,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/examples/chef/common/chef-fan-control-manager.cpp b/examples/chef/common/chef-fan-control-manager.cpp index 60187a869277cd..a47d4fac44aeaa 100644 --- a/examples/chef/common/chef-fan-control-manager.cpp +++ b/examples/chef/common/chef-fan-control-manager.cpp @@ -141,6 +141,6 @@ void emberAfFanControlClusterInitCallback(EndpointId endpoint) { VerifyOrDie(!mFanControlManager); mFanControlManager = std::make_unique(endpoint); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(mFanControlManager.get()); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(mFanControlManager.get()); FanControl::SetDefaultDelegate(endpoint, mFanControlManager.get()); } diff --git a/src/app/AttributeAccessInterface.h b/src/app/AttributeAccessInterface.h index 30c934d331afcd..cdf7d6258511ae 100644 --- a/src/app/AttributeAccessInterface.h +++ b/src/app/AttributeAccessInterface.h @@ -30,7 +30,7 @@ * endpoint or for all endpoints. * * Instances of AttributeAccessInterface that are registered via - * chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride will be consulted before taking the + * AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride will be consulted before taking the * normal attribute access codepath and can use that codepath as a fallback if desired. */ namespace chip { diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 07b3e83f3b6cc1..87abfd30cbe8c0 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -479,6 +479,6 @@ void MatterAccessControlPluginServerInitCallback() { ChipLogProgress(DataManagement, "AccessControlCluster: initializing"); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&sAttribute); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&sAttribute); GetAccessControl().AddEntryListener(sAttribute); } diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index 5a836b5b0cc161..378148c443d8bc 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -261,5 +261,5 @@ bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, void MatterAccountLoginPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAccountLoginAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAccountLoginAttrAccess); } diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp index 4e154afc446731..0d32f690cc54c3 100644 --- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp +++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp @@ -209,5 +209,5 @@ bool emberAfAdministratorCommissioningClusterRevokeCommissioningCallback( void MatterAdministratorCommissioningPluginServerInitCallback() { ChipLogProgress(Zcl, "Initiating Admin Commissioning cluster."); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAdminCommissioningAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAdminCommissioningAttrAccess); } diff --git a/src/app/clusters/air-quality-server/air-quality-server.cpp b/src/app/clusters/air-quality-server/air-quality-server.cpp index 21eb44164e0e11..c34ef3e9e2882c 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.cpp +++ b/src/app/clusters/air-quality-server/air-quality-server.cpp @@ -39,7 +39,7 @@ Instance::Instance(EndpointId aEndpointId, BitMask aFeature) : Instance::~Instance() { - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() @@ -47,7 +47,7 @@ CHIP_ERROR Instance::Init() // Check if the cluster has been selected in zap VerifyOrDie(emberAfContainsServer(mEndpointId, Id) == true); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index afa0d7c06cfdb7..a49a31f0adf912 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -246,5 +246,5 @@ CHIP_ERROR ApplicationBasicAttrAccess::ReadAllowedVendorListAttribute(app::Attri void MatterApplicationBasicPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationBasicAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationBasicAttrAccess); } diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 5bc196ff4e5666..c5923015b9a480 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -495,5 +495,5 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm void MatterApplicationLauncherPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationLauncherAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationLauncherAttrAccess); } diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index d9ec93836a4e67..7544f795e3b9f8 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -244,5 +244,5 @@ bool emberAfAudioOutputClusterSelectOutputCallback(app::CommandHandler * command void MatterAudioOutputPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAudioOutputAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAudioOutputAttrAccess); } diff --git a/src/app/clusters/basic-information/basic-information.cpp b/src/app/clusters/basic-information/basic-information.cpp index 6bba8d2f63aac4..2ebbb04bf01779 100644 --- a/src/app/clusters/basic-information/basic-information.cpp +++ b/src/app/clusters/basic-information/basic-information.cpp @@ -476,6 +476,6 @@ bool IsLocalConfigDisabled() void MatterBasicInformationPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); PlatformMgr().SetDelegate(&gPlatformMgrDelegate); } diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp index b981d0bb3d9ece..d535f2701b3ab8 100644 --- a/src/app/clusters/bindings/bindings.cpp +++ b/src/app/clusters/bindings/bindings.cpp @@ -268,7 +268,7 @@ CHIP_ERROR BindingTableAccess::NotifyBindingsChanged() void MatterBindingPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } CHIP_ERROR AddBindingEntry(const EmberBindingTableEntry & entry) diff --git a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp index 26890c8e899747..e3d3921ec5bb2e 100644 --- a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp +++ b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp @@ -453,5 +453,5 @@ bool emberAfBooleanStateConfigurationClusterEnableDisableAlarmCallback( void MatterBooleanStateConfigurationPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index 9cd97db353438c..e373144694b5b3 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -408,5 +408,5 @@ bool emberAfChannelClusterCancelRecordProgramCallback( void MatterChannelPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gChannelAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gChannelAttrAccess); } diff --git a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h index 6f9e7c21431289..d9021838237c67 100644 --- a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h +++ b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h @@ -327,7 +327,7 @@ class Instance this->mMeasurementUnit = aMeasurementUnit; }; - ~Instance() override { chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); }; + ~Instance() override { AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); }; CHIP_ERROR Init() { @@ -353,7 +353,7 @@ class Instance VerifyOrReturnError(emberAfContainsServer(mEndpointId, mClusterId), CHIP_ERROR_INCORRECT_STATE); // Register the object as attribute provider - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); mFeatureMap = GenerateFeatureMap(); diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index b6bff6e7b91976..091290b20e6f2d 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -286,5 +286,5 @@ bool emberAfContentLauncherClusterLaunchURLCallback(CommandHandler * commandObj, void MatterContentLauncherPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gContentLauncherAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gContentLauncherAttrAccess); } diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index 49ce814ff5e169..fa4d8899c082f9 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -244,5 +244,5 @@ CHIP_ERROR DescriptorAttrAccess::Read(const ConcreteReadAttributePath & aPath, A void MatterDescriptorPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 26ea72482619f0..779aa944cd2661 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -39,7 +39,7 @@ namespace DeviceEnergyManagement { CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; @@ -48,7 +48,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const 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 ffd29a6b81ee49..7b482209dee4a4 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -4232,7 +4232,7 @@ void MatterDoorLockPluginServerInitCallback() ChipLogProgress(Zcl, "Door Lock server initialized"); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gFabricDelegate); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&DoorLockServer::Instance()); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&DoorLockServer::Instance()); } void MatterDoorLockClusterServerAttributeChangedCallback(const app::ConcreteAttributePath & attributePath) {} diff --git a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp index 3cb7d50dee796e..f74a878c8586ba 100644 --- a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp +++ b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp @@ -42,14 +42,14 @@ MeasurementData gMeasurements[MATTER_DM_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_SE CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Init() { - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } void ElectricalEnergyMeasurementAttrAccess::Shutdown() { - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, diff --git a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp index d6b69f06799ed3..a145d8b3e7c843 100644 --- a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp +++ b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp @@ -42,14 +42,14 @@ namespace ElectricalPowerMeasurement { CHIP_ERROR Instance::Init() { - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } void Instance::Shutdown() { - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.cpp b/src/app/clusters/energy-evse-server/energy-evse-server.cpp index 840e0e35479c9a..1978cec27730f9 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.cpp +++ b/src/app/clusters/energy-evse-server/energy-evse-server.cpp @@ -39,7 +39,7 @@ namespace EnergyEvse { CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; @@ -48,7 +48,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/energy-preference-server/energy-preference-server.cpp b/src/app/clusters/energy-preference-server/energy-preference-server.cpp index 9fbbfa1db2846d..1f1eeabf082188 100644 --- a/src/app/clusters/energy-preference-server/energy-preference-server.cpp +++ b/src/app/clusters/energy-preference-server/energy-preference-server.cpp @@ -18,7 +18,7 @@ #include "energy-preference-server.h" #include -#include // Needed for chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride +#include // Needed for AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride #include #include @@ -228,5 +228,5 @@ Status MatterEnergyPreferenceClusterServerPreAttributeChangedCallback(const Conc void MatterEnergyPreferencePluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gEnergyPrefAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gEnergyPrefAttrAccess); } diff --git a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp index 6a18f352082e03..f4851ecf37825d 100644 --- a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp +++ b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp @@ -186,5 +186,5 @@ bool emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(app::CommandHan void MatterEthernetNetworkDiagnosticsPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/fixed-label-server/fixed-label-server.cpp b/src/app/clusters/fixed-label-server/fixed-label-server.cpp index de97596468c69c..aaa7656619f475 100644 --- a/src/app/clusters/fixed-label-server/fixed-label-server.cpp +++ b/src/app/clusters/fixed-label-server/fixed-label-server.cpp @@ -110,5 +110,5 @@ CHIP_ERROR FixedLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, A void MatterFixedLabelPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 64384f148ec5b4..407dfe9a5ae9d6 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -343,7 +343,7 @@ void OnPlatformEventHandler(const DeviceLayer::ChipDeviceEvent * event, intptr_t void MatterGeneralCommissioningPluginServerInitCallback() { Breadcrumb::Set(0, 0); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler); } diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp index 18abc44686e7f6..d619afedc08f97 100644 --- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp +++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp @@ -491,7 +491,7 @@ void MatterGeneralDiagnosticsPluginServerInitCallback() { BootReasonEnum bootReason; - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); ConnectivityMgr().SetDelegate(&gDiagnosticDelegate); if (GetDiagnosticDataProvider().GetBootReason(bootReason) == CHIP_NO_ERROR) diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index 61c8089d7f4cb4..70fee6de3f9d57 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -436,7 +436,7 @@ GroupKeyManagementAttributeAccess gAttribute; void MatterGroupKeyManagementPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttribute); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttribute); } // diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp index 99a9e0ab5f172d..7e2fc334b795e4 100644 --- a/src/app/clusters/icd-management-server/icd-management-server.cpp +++ b/src/app/clusters/icd-management-server/icd-management-server.cpp @@ -458,7 +458,7 @@ void MatterIcdManagementPluginServerInitCallback() // Configure and register Attribute Access Override gAttribute.Init(storage, symmetricKeystore, fabricTable, icdConfigurationData); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttribute); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttribute); // Configure ICD Management ICDManagementServer::Init(storage, symmetricKeystore, icdConfigurationData); diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index 80228a6c4f2740..790dec64e5dc3b 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -196,5 +196,5 @@ bool emberAfKeypadInputClusterSendKeyCallback(app::CommandHandler * command, con void MatterKeypadInputPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gKeypadInputAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gKeypadInputAttrAccess); } diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp index 43c50b1c2c9ec1..3fd3653d510c08 100644 --- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp +++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp @@ -149,7 +149,7 @@ CHIP_ERROR LaundryDryerControlsServer::ReadSupportedDrynessLevels(const Concrete void MatterLaundryDryerControlsPluginServerInitCallback() { LaundryDryerControlsServer & laundryDryerControlsServer = LaundryDryerControlsServer::Instance(); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&laundryDryerControlsServer); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&laundryDryerControlsServer); } Status MatterLaundryDryerControlsClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp index 9b07c72c480aa2..bd608e3027de28 100644 --- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp +++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp @@ -187,7 +187,7 @@ CHIP_ERROR LaundryWasherControlsServer::ReadSupportedRinses(const ConcreteReadAt void MatterLaundryWasherControlsPluginServerInitCallback() { LaundryWasherControlsServer & laundryWasherControlsServer = LaundryWasherControlsServer::Instance(); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&laundryWasherControlsServer); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&laundryWasherControlsServer); } Status MatterLaundryWasherControlsClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, diff --git a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp index 72cd0c4bc90fa8..8e63de7a770383 100644 --- a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp +++ b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp @@ -221,5 +221,5 @@ void emberAfLocalizationConfigurationClusterServerInitCallback(EndpointId endpoi void MatterLocalizationConfigurationPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index 7d9f30968ff08d..94e2f74b245f04 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -294,5 +294,5 @@ bool emberAfMediaInputClusterRenameInputCallback(app::CommandHandler * command, void MatterMediaInputPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaInputAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaInputAttrAccess); } diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 8bcbb4bd5c5b53..45babf8a703998 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -708,5 +708,5 @@ void MatterMediaPlaybackClusterServerAttributeChangedCallback(const chip::app::C void MatterMediaPlaybackPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaPlaybackAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaPlaybackAttrAccess); } diff --git a/src/app/clusters/messages-server/messages-server.cpp b/src/app/clusters/messages-server/messages-server.cpp index e6f742c7f136ee..218bc19562781e 100644 --- a/src/app/clusters/messages-server/messages-server.cpp +++ b/src/app/clusters/messages-server/messages-server.cpp @@ -293,5 +293,5 @@ bool emberAfMessagesClusterCancelMessagesRequestCallback( void MatterMessagesPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMessagesAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMessagesAttrAccess); } diff --git a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp index 05bc66f5478e7a..aa10c8150dfa0b 100644 --- a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp +++ b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp @@ -55,7 +55,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClus Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() @@ -90,7 +90,7 @@ CHIP_ERROR Instance::Init() "Microwave Oven Control: feature bits error, if feature supports PowerNumberLimits it must support PowerAsNumber")); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); // If the PowerInWatts feature is supported, get the count of supported watt levels so we can later // ensure incoming watt level values are valid. diff --git a/src/app/clusters/mode-base-server/mode-base-server.cpp b/src/app/clusters/mode-base-server/mode-base-server.cpp index 5c5b6d9429c45d..ce0e4bb2c1e4a4 100644 --- a/src/app/clusters/mode-base-server/mode-base-server.cpp +++ b/src/app/clusters/mode-base-server/mode-base-server.cpp @@ -65,7 +65,7 @@ void Instance::Shutdown() } UnregisterThisInstance(); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() @@ -79,7 +79,7 @@ CHIP_ERROR Instance::Init() LoadPersistentAttributes(); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); RegisterThisInstance(); ReturnErrorOnFailure(mDelegate->Init()); diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp index 2a582f4320333d..c200fa988dd602 100644 --- a/src/app/clusters/mode-select-server/mode-select-server.cpp +++ b/src/app/clusters/mode-select-server/mode-select-server.cpp @@ -219,7 +219,7 @@ inline bool areStartUpModeAndCurrentModeNonVolatile(EndpointId endpointId) void MatterModeSelectPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gModeSelectAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gModeSelectAttrAccess); } /** diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index 7d9d79a4a20f04..1cbd8ee9c813bc 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -359,7 +359,7 @@ Instance::Instance(EndpointId aEndpointId, EthernetDriver * apDelegate) : CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler, reinterpret_cast(this))); ReturnErrorOnFailure(mpBaseDriver->Init(this)); diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 14fdf41c1664fb..db8947b88b8a44 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -396,7 +396,7 @@ OpCredsFabricTableDelegate gFabricDelegate; void MatterOperationalCredentialsPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gFabricDelegate); diff --git a/src/app/clusters/operational-state-server/operational-state-server.cpp b/src/app/clusters/operational-state-server/operational-state-server.cpp index 7e4829a111b02f..3b513773a049dc 100644 --- a/src/app/clusters/operational-state-server/operational-state-server.cpp +++ b/src/app/clusters/operational-state-server/operational-state-server.cpp @@ -50,7 +50,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId) : Instance(aDel Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() @@ -64,7 +64,7 @@ CHIP_ERROR Instance::Init() ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp index 49440e69bba0b8..a8d91cc77dadd6 100644 --- a/src/app/clusters/ota-requestor/ota-requestor-server.cpp +++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp @@ -295,5 +295,5 @@ bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOTAProviderCallback( void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp index 33be0c86266974..e300a01ddfd24e 100644 --- a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp +++ b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp @@ -100,5 +100,5 @@ CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(const ConcreteReadAttributeP void MatterPowerSourceConfigurationPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/power-source-server/power-source-server.cpp b/src/app/clusters/power-source-server/power-source-server.cpp index c0f4f27357017b..ecde2aede86c9b 100644 --- a/src/app/clusters/power-source-server/power-source-server.cpp +++ b/src/app/clusters/power-source-server/power-source-server.cpp @@ -91,7 +91,7 @@ PowerSourceClusterInfo * sPowerSourceClusterInfo = nullptr; void MatterPowerSourcePluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } namespace chip { diff --git a/src/app/clusters/power-topology-server/power-topology-server.cpp b/src/app/clusters/power-topology-server/power-topology-server.cpp index 40e2e449575c91..dcfd9e949a9aa1 100644 --- a/src/app/clusters/power-topology-server/power-topology-server.cpp +++ b/src/app/clusters/power-topology-server/power-topology-server.cpp @@ -41,14 +41,14 @@ namespace PowerTopology { CHIP_ERROR Instance::Init() { - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } void Instance::Shutdown() { - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp index a36b6187c2d364..218ab7aa184cea 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp @@ -60,7 +60,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClus Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); } CHIP_ERROR Instance::Init() @@ -73,7 +73,7 @@ CHIP_ERROR Instance::Init() LoadPersistentAttributes(); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); ChipLogDetail(Zcl, "ResourceMonitoring: calling mDelegate->Init()"); ReturnErrorOnFailure(mDelegate->Init()); diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h index e56d4d6ec70346..468dc7767a58f9 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h @@ -75,7 +75,7 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface * @return CHIP_ERROR_INVALID_ARGUMENT If the CommandHandler or Attribute Handler could not be registered. * @return CHIP_ERROR_INCORRECT_STATE If the CommandHandler was already registered * @return CHIP_ERROR_INCORRECT_STATE If the - * chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride fails. + * AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride fails. * @return CHIP_ERROR If the AppInit() method returned an error. This is application specific. * * @return CHIP_NO_ERROR If the cluster was initialised successfully. diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.cpp b/src/app/clusters/sample-mei-server/sample-mei-server.cpp index f4afb6fb820f81..51cfb8caddbb40 100644 --- a/src/app/clusters/sample-mei-server/sample-mei-server.cpp +++ b/src/app/clusters/sample-mei-server/sample-mei-server.cpp @@ -32,7 +32,7 @@ void MatterSampleMeiPluginServerInitCallback() static_cast(kNumSupportedEndpoints)); ReturnOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&SampleMeiServer::Instance())); VerifyOrReturn( - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&SampleMeiServer::Instance()), + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&SampleMeiServer::Instance()), CHIP_ERROR_INCORRECT_STATE); } diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index d6e71ead9bfc16..9f1fd1225cf633 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -340,7 +340,7 @@ CHIP_ERROR ScenesServer::Init() VerifyOrReturnError(!mIsInitialized, CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(chip::app::CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); mGroupProvider = Credentials::GetGroupDataProvider(); diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp index 76b17c303b28d0..21dab347a71cff 100644 --- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp +++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp @@ -230,6 +230,6 @@ bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandle void MatterSoftwareDiagnosticsPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gCommandHandler); } diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 912ad63cb687fe..640d5f556c0ff1 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -261,5 +261,5 @@ void MatterTargetNavigatorClusterServerAttributeChangedCallback(const chip::app: void MatterTargetNavigatorPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gTargetNavigatorAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gTargetNavigatorAttrAccess); } diff --git a/src/app/clusters/temperature-control-server/temperature-control-server.cpp b/src/app/clusters/temperature-control-server/temperature-control-server.cpp index b29c3bed509c34..510260a880cad4 100644 --- a/src/app/clusters/temperature-control-server/temperature-control-server.cpp +++ b/src/app/clusters/temperature-control-server/temperature-control-server.cpp @@ -228,5 +228,5 @@ void emberAfTemperatureControlClusterServerInitCallback(EndpointId endpoint) {} void MatterTemperatureControlPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index b1bfa60d54ed6a..d4ff1c9128f771 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -1119,5 +1119,5 @@ bool emberAfUnitTestingClusterTestSecondBatchHelperRequestCallback( void MatterUnitTestingPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index 9facdf4cc9ea3a..54298746290d7c 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -928,5 +928,5 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co void MatterThermostatPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gThermostatAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gThermostatAttrAccess); } diff --git a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp index 514e074cfd306f..bc3b9a88dc02d9 100644 --- a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp +++ b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp @@ -204,6 +204,6 @@ bool emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandl void MatterThreadNetworkDiagnosticsPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); GetDiagnosticDataProvider().SetThreadDiagnosticsDelegate(&gDiagnosticDelegate); } diff --git a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp index ef39d9f40fe7ca..aff2e0b7a4049e 100644 --- a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp +++ b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp @@ -47,13 +47,13 @@ ThreadNetworkDirectoryServer::ThreadNetworkDirectoryServer(EndpointId endpoint, ThreadNetworkDirectoryServer::~ThreadNetworkDirectoryServer() { - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } CHIP_ERROR ThreadNetworkDirectoryServer::Init() { - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index cb11f389445411..6a35087a839718 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -232,5 +232,5 @@ void emberAfTimeFormatLocalizationClusterServerInitCallback(EndpointId endpoint) void MatterTimeFormatLocalizationPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp index 6acabb15fa543f..6aace08ae1c263 100644 --- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp +++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp @@ -1290,5 +1290,5 @@ bool emberAfTimeSynchronizationClusterSetDefaultNTPCallback( void MatterTimeSynchronizationPluginServerInitCallback() { TimeSynchronizationServer::Instance().Init(); - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/user-label-server/user-label-server.cpp b/src/app/clusters/user-label-server/user-label-server.cpp index bf953b758f8636..84ef0a1874b7d0 100644 --- a/src/app/clusters/user-label-server/user-label-server.cpp +++ b/src/app/clusters/user-label-server/user-label-server.cpp @@ -219,6 +219,6 @@ UserLabelFabricTableDelegate gUserLabelFabricDelegate; void MatterUserLabelPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gUserLabelFabricDelegate); } diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp index 2b75db5de1ba35..e35a117a90f28d 100644 --- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp +++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp @@ -514,5 +514,5 @@ bool emberAfValveConfigurationAndControlClusterCloseCallback( void MatterValveConfigurationAndControlPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp index e59f3df1c18d15..fc9dcc07cc3328 100644 --- a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp @@ -142,5 +142,5 @@ CHIP_ERROR WakeOnLanAttrAccess::ReadMacAddressAttribute(app::AttributeValueEncod void MatterWakeOnLanPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gWakeOnLanAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gWakeOnLanAttrAccess); } diff --git a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp index ac436f15b556c9..e05789ecba12d9 100644 --- a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp +++ b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp @@ -317,6 +317,6 @@ bool emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandler void MatterWiFiNetworkDiagnosticsPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); GetDiagnosticDataProvider().SetWiFiDiagnosticsDelegate(&gDiagnosticDelegate); } diff --git a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp index 1476d24945cd1c..21fa83cb9a54b0 100644 --- a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp +++ b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp @@ -63,13 +63,13 @@ WiFiNetworkManagementServer::WiFiNetworkManagementServer(EndpointId endpoint) : WiFiNetworkManagementServer::~WiFiNetworkManagementServer() { - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } CHIP_ERROR WiFiNetworkManagementServer::Init() { - VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; diff --git a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp index a38c47edcfd5e4..ca25fc4161143e 100644 --- a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp @@ -591,11 +591,11 @@ class RegisteredAttributeAccessInterface template RegisteredAttributeAccessInterface(Args &&... args) : mData(std::forward(args)...) { - VerifyOrDie(chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&mData)); + VerifyOrDie(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&mData)); } ~RegisteredAttributeAccessInterface() { - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(&mData); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(&mData); } T * operator->() { return &mData; } diff --git a/src/controller/tests/TestEventChunking.cpp b/src/controller/tests/TestEventChunking.cpp index 64dd8939b4a9e2..a8befd5c6c15bc 100644 --- a/src/controller/tests/TestEventChunking.cpp +++ b/src/controller/tests/TestEventChunking.cpp @@ -220,7 +220,7 @@ class TestAttrAccess : public app::AttributeAccessInterface // Register for the Test Cluster cluster on all endpoints. TestAttrAccess() : AttributeAccessInterface(Optional::Missing(), Clusters::UnitTesting::Id) { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this); } CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; diff --git a/src/controller/tests/TestReadChunking.cpp b/src/controller/tests/TestReadChunking.cpp index 30ae7adc368201..b45e5219d28c24 100644 --- a/src/controller/tests/TestReadChunking.cpp +++ b/src/controller/tests/TestReadChunking.cpp @@ -360,7 +360,7 @@ class TestAttrAccess : public app::AttributeAccessInterface // Register for the Test Cluster cluster on all endpoints. TestAttrAccess() : AttributeAccessInterface(Optional::Missing(), Clusters::UnitTesting::Id) { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this); } CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; diff --git a/src/controller/tests/TestWriteChunking.cpp b/src/controller/tests/TestWriteChunking.cpp index 5fee4497bacc87..3a396e73de9392 100644 --- a/src/controller/tests/TestWriteChunking.cpp +++ b/src/controller/tests/TestWriteChunking.cpp @@ -217,7 +217,7 @@ TEST_F(TestWriteChunking, TestListChunking) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); // @@ -290,7 +290,7 @@ TEST_F(TestWriteChunking, TestBadChunking) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); @@ -369,7 +369,7 @@ TEST_F(TestWriteChunking, TestConflictWrite) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); @@ -443,7 +443,7 @@ TEST_F(TestWriteChunking, TestNonConflictWrite) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); app::AttributePathParams attributePath1(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); app::AttributePathParams attributePath2(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute2); @@ -591,7 +591,7 @@ TEST_F(TestWriteChunking, TestTransactionalList) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); // Test 1: we should receive transaction notifications ChipLogProgress(Zcl, "Test 1: we should receive transaction notifications"); diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm index 53c228e22e06c8..66f111b9e3989b 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm @@ -379,7 +379,7 @@ - (void)registerMatterCluster std::lock_guard lock(_lock); - if (!chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(_attributeAccessInterface.get())) { + if (!AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(_attributeAccessInterface.get())) { // This should only happen if we somehow managed to register an // AttributeAccessInterface for the same (endpoint, cluster) pair. MTR_LOG_ERROR("Could not register AttributeAccessInterface for endpoint %u, cluster 0x%llx", @@ -394,7 +394,7 @@ - (void)unregisterMatterCluster std::lock_guard lock(_lock); if (_attributeAccessInterface != nullptr) { - chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(_attributeAccessInterface.get()); + AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(_attributeAccessInterface.get()); } } From f7eb337a2cf3a39d4b8eb825a7cc60a5fdc0fca7 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 14:47:36 -0400 Subject: [PATCH 14/32] Fix compile error --- .../cluster_and_device_type_dev.md | 2 +- src/app/clusters/sample-mei-server/sample-mei-server.cpp | 5 ++--- .../thread-network-directory-server.cpp | 3 +-- src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp | 2 +- .../wifi-network-management-server.cpp | 3 +-- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md index a07961cf1a36e4..7bf0e36498680f 100644 --- a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md +++ b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md @@ -107,7 +107,7 @@ ending in the cluster initialization code. EmberAfInitializeAttributes - ember attribute storage - for all attributes marked as “RAM” in the zap, sets defaults in the storage MatterPluginServerCallback - .h is a generated file, .cpp impl is done -in the server cluster code. Use this to setup the cluster and setup overrides in +in the server cluster code. Use this to setup the cluster and setup overrides in chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride - use this if you want to handle attribute reads and writes externally diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.cpp b/src/app/clusters/sample-mei-server/sample-mei-server.cpp index 51cfb8caddbb40..2e1853256f2942 100644 --- a/src/app/clusters/sample-mei-server/sample-mei-server.cpp +++ b/src/app/clusters/sample-mei-server/sample-mei-server.cpp @@ -31,9 +31,8 @@ void MatterSampleMeiPluginServerInitCallback() ChipLogProgress(Zcl, "Sample MEI Init. Ep %d, Total Ep %u", MATTER_DM_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT, static_cast(kNumSupportedEndpoints)); ReturnOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&SampleMeiServer::Instance())); - VerifyOrReturn( - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&SampleMeiServer::Instance()), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&SampleMeiServer::Instance()), + CHIP_ERROR_INCORRECT_STATE); } void emberAfSampleMeiClusterServerInitCallback(chip::EndpointId endpoint) diff --git a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp index aff2e0b7a4049e..6d4feb6f4d4864 100644 --- a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp +++ b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp @@ -53,8 +53,7 @@ ThreadNetworkDirectoryServer::~ThreadNetworkDirectoryServer() CHIP_ERROR ThreadNetworkDirectoryServer::Init() { - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INTERNAL); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp index fc9dcc07cc3328..107448fbc0e5d9 100644 --- a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp @@ -142,5 +142,5 @@ CHIP_ERROR WakeOnLanAttrAccess::ReadMacAddressAttribute(app::AttributeValueEncod void MatterWakeOnLanPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gWakeOnLanAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gWakeOnLanAttrAccess); } diff --git a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp index 21fa83cb9a54b0..7b92a797105c09 100644 --- a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp +++ b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp @@ -69,8 +69,7 @@ WiFiNetworkManagementServer::~WiFiNetworkManagementServer() CHIP_ERROR WiFiNetworkManagementServer::Init() { - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INTERNAL); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; } From fe31b56d69dd776974b5b288bee79aba76e1c979 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:02:14 -0400 Subject: [PATCH 15/32] One more compile fix --- .../application-basic-server/application-basic-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index a49a31f0adf912..1485ea46d5c461 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -246,5 +246,5 @@ CHIP_ERROR ApplicationBasicAttrAccess::ReadAllowedVendorListAttribute(app::Attri void MatterApplicationBasicPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationBasicAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationBasicAttrAccess); } From e856129ec237bd98226bab2bcc9b2b4a3e0096b4 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:02:46 -0400 Subject: [PATCH 16/32] One more compile fix --- .../application-launcher-server/application-launcher-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index c5923015b9a480..537862cc523b8b 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -495,5 +495,5 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm void MatterApplicationLauncherPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationLauncherAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationLauncherAttrAccess); } From d40798d609e64d095faf3e7e35e8583973251975 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:05:48 -0400 Subject: [PATCH 17/32] make tv-app compile --- src/app/clusters/account-login-server/account-login-server.cpp | 2 +- src/app/clusters/audio-output-server/audio-output-server.cpp | 2 +- src/app/clusters/channel-server/channel-server.cpp | 2 +- src/app/clusters/keypad-input-server/keypad-input-server.cpp | 2 +- src/app/clusters/media-input-server/media-input-server.cpp | 2 +- .../clusters/media-playback-server/media-playback-server.cpp | 2 +- .../target-navigator-server/target-navigator-server.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index 378148c443d8bc..084d827136016b 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -261,5 +261,5 @@ bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, void MatterAccountLoginPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAccountLoginAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAccountLoginAttrAccess); } diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 7544f795e3b9f8..43e704d7abf7b8 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -244,5 +244,5 @@ bool emberAfAudioOutputClusterSelectOutputCallback(app::CommandHandler * command void MatterAudioOutputPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAudioOutputAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAudioOutputAttrAccess); } diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index e373144694b5b3..63555f44d2ca57 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -408,5 +408,5 @@ bool emberAfChannelClusterCancelRecordProgramCallback( void MatterChannelPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gChannelAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gChannelAttrAccess); } diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index 790dec64e5dc3b..0de0ef8eb96c24 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -196,5 +196,5 @@ bool emberAfKeypadInputClusterSendKeyCallback(app::CommandHandler * command, con void MatterKeypadInputPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gKeypadInputAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gKeypadInputAttrAccess); } diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index 94e2f74b245f04..c5596377842df1 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -294,5 +294,5 @@ bool emberAfMediaInputClusterRenameInputCallback(app::CommandHandler * command, void MatterMediaInputPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaInputAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaInputAttrAccess); } diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 45babf8a703998..06434bbcb67203 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -708,5 +708,5 @@ void MatterMediaPlaybackClusterServerAttributeChangedCallback(const chip::app::C void MatterMediaPlaybackPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaPlaybackAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaPlaybackAttrAccess); } diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 640d5f556c0ff1..583edd0b2e6d6f 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -261,5 +261,5 @@ void MatterTargetNavigatorClusterServerAttributeChangedCallback(const chip::app: void MatterTargetNavigatorPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gTargetNavigatorAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gTargetNavigatorAttrAccess); } From 42077544cafebf01f3c3bf7509dfc00c60a6870d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:11:30 -0400 Subject: [PATCH 18/32] Update examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp Co-authored-by: Boris Zbarsky --- .../all-clusters-common/src/bridged-actions-stub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp index 02b25e8966a066..9b8f7d673a8eb5 100644 --- a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp @@ -98,5 +98,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); } From 1425bd9a44b415e57886844597f8f32b51431793 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:11:36 -0400 Subject: [PATCH 19/32] Update examples/tv-app/android/java/AppImpl.cpp Co-authored-by: Boris Zbarsky --- examples/tv-app/android/java/AppImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tv-app/android/java/AppImpl.cpp b/examples/tv-app/android/java/AppImpl.cpp index cf31496fb4b14e..069d0f5185e62f 100644 --- a/examples/tv-app/android/java/AppImpl.cpp +++ b/examples/tv-app/android/java/AppImpl.cpp @@ -572,7 +572,7 @@ CHIP_ERROR InitVideoPlayerPlatform(jobject contentAppEndpointManager) { ContentAppCommandDelegate * delegate = new ContentAppCommandDelegate(contentAppEndpointManager, contentAppClusters[i].clusterId); - chip::app::CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(delegate); + app::CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(delegate); ChipLogProgress(AppServer, "Registered command handler delegate for cluster %d", contentAppClusters[i].clusterId); } From e8267cb2bce8cf3bbd17955db3106b5d716671d5 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:15:19 -0400 Subject: [PATCH 20/32] Update register/unregister names --- .../cluster_and_device_type_dev.md | 4 ++-- docs/upgrading.md | 4 ++-- .../all-clusters-common/src/bridged-actions-stub.cpp | 2 +- .../all-clusters-common/src/fan-stub.cpp | 2 +- examples/bridge-app/asr/src/bridged-actions-stub.cpp | 2 +- examples/bridge-app/esp32/main/DeviceCallbacks.cpp | 2 +- examples/bridge-app/linux/bridged-actions-stub.cpp | 2 +- examples/bridge-app/linux/main.cpp | 2 +- examples/bridge-app/telink/src/DeviceCallbacks.cpp | 2 +- examples/chef/common/chef-fan-control-manager.cpp | 2 +- .../placeholder/linux/src/bridged-actions-stub.cpp | 2 +- src/app/AttributeAccessInterface.h | 2 +- src/app/AttributeAccessInterfaceRegistry.cpp | 4 ++-- src/app/AttributeAccessInterfaceRegistry.h | 4 ++-- .../access-control-server/access-control-server.cpp | 2 +- .../account-login-server/account-login-server.cpp | 2 +- .../administrator-commissioning-server.cpp | 2 +- .../clusters/air-quality-server/air-quality-server.cpp | 5 ++--- .../application-basic-server.cpp | 2 +- .../application-launcher-server.cpp | 2 +- .../audio-output-server/audio-output-server.cpp | 2 +- .../clusters/basic-information/basic-information.cpp | 2 +- src/app/clusters/bindings/bindings.cpp | 2 +- .../boolean-state-configuration-server.cpp | 2 +- src/app/clusters/channel-server/channel-server.cpp | 2 +- .../concentration-measurement-server.h | 5 ++--- .../content-launch-server/content-launch-server.cpp | 2 +- src/app/clusters/descriptor/descriptor.cpp | 2 +- .../device-energy-management-server.cpp | 5 ++--- src/app/clusters/door-lock-server/door-lock-server.cpp | 2 +- .../electrical-energy-measurement-server.cpp | 5 ++--- .../electrical-power-measurement-server.cpp | 5 ++--- .../clusters/energy-evse-server/energy-evse-server.cpp | 5 ++--- .../energy-preference-server.cpp | 4 ++-- .../ethernet-network-diagnostics-server.cpp | 2 +- .../clusters/fixed-label-server/fixed-label-server.cpp | 2 +- .../general-commissioning-server.cpp | 2 +- .../general-diagnostics-server.cpp | 2 +- .../group-key-mgmt-server/group-key-mgmt-server.cpp | 2 +- .../icd-management-server/icd-management-server.cpp | 2 +- .../keypad-input-server/keypad-input-server.cpp | 2 +- .../laundry-dryer-controls-server.cpp | 2 +- .../laundry-washer-controls-server.cpp | 2 +- .../localization-configuration-server.cpp | 2 +- .../clusters/media-input-server/media-input-server.cpp | 2 +- .../media-playback-server/media-playback-server.cpp | 2 +- src/app/clusters/messages-server/messages-server.cpp | 2 +- .../microwave-oven-control-server.cpp | 5 ++--- src/app/clusters/mode-base-server/mode-base-server.cpp | 5 ++--- .../clusters/mode-select-server/mode-select-server.cpp | 2 +- .../network-commissioning/network-commissioning.cpp | 3 +-- .../operational-credentials-server.cpp | 2 +- .../operational-state-server.cpp | 5 ++--- .../clusters/ota-requestor/ota-requestor-server.cpp | 2 +- .../power-source-configuration-server.cpp | 2 +- .../power-source-server/power-source-server.cpp | 2 +- .../power-topology-server/power-topology-server.cpp | 5 ++--- .../resource-monitoring-server.cpp | 5 ++--- .../resource-monitoring-server.h | 2 +- .../clusters/sample-mei-server/sample-mei-server.cpp | 3 +-- src/app/clusters/scenes-server/scenes-server.cpp | 3 +-- .../software-diagnostics-server.cpp | 2 +- .../target-navigator-server.cpp | 2 +- .../temperature-control-server.cpp | 2 +- .../test-cluster-server/test-cluster-server.cpp | 2 +- .../clusters/thermostat-server/thermostat-server.cpp | 2 +- .../thread-network-diagnostics-server.cpp | 2 +- .../thread-network-directory-server.cpp | 4 ++-- .../time-format-localization-server.cpp | 2 +- .../time-synchronization-server.cpp | 2 +- .../clusters/user-label-server/user-label-server.cpp | 2 +- .../valve-configuration-and-control-server.cpp | 2 +- .../clusters/wake-on-lan-server/wake-on-lan-server.cpp | 2 +- .../wifi-network-diagnostics-server.cpp | 2 +- .../wifi-network-management-server.cpp | 4 ++-- .../tests/TestCodegenModelViaMocks.cpp | 7 ++----- src/controller/tests/TestEventChunking.cpp | 2 +- src/controller/tests/TestReadChunking.cpp | 2 +- src/controller/tests/TestWriteChunking.cpp | 10 +++++----- .../Framework/CHIP/ServerEndpoint/MTRServerCluster.mm | 4 ++-- 80 files changed, 104 insertions(+), 121 deletions(-) diff --git a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md index 7bf0e36498680f..e2460ff5a0a2b2 100644 --- a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md +++ b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md @@ -108,8 +108,8 @@ EmberAfInitializeAttributes - ember attribute storage - for all attributes marked as “RAM” in the zap, sets defaults in the storage MatterPluginServerCallback - .h is a generated file, .cpp impl is done in the server cluster code. Use this to setup the cluster and setup overrides in -chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride - -use this if you want to handle attribute reads and writes externally +chip::app::AttributeAccessInterfaceRegistry::Instance().Register - use this if +you want to handle attribute reads and writes externally Blue sections can be overridden. diff --git a/docs/upgrading.md b/docs/upgrading.md index 874c6a877b1bde..5640c925aca5ec 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -85,9 +85,9 @@ A new object exists for the attribute access interface registry, accessible as Replacements for methods are: - `registerAttributeAccessOverride` replaced by - `chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride` + `chip::app::AttributeAccessInterfaceRegistry::Instance().Register` - `unregisterAttributeAccessOverride` replaced by - `chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride` + `chip::app::AttributeAccessInterfaceRegistry::Instance().Unregister` - `unregisterAllAttributeAccessOverridesForEndpoint` replaced by `chip::app::AttributeAccessInterfaceRegistry::Instance().UnregisterAllForEndpoint` - `chip::app::GetAttributeAccessOverride` replaced by diff --git a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp index 02b25e8966a066..90d1b9ebd115b0 100644 --- a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp @@ -98,5 +98,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback() { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp index 54902dfcc96ddf..e0fb68c95f647c 100644 --- a/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp @@ -173,6 +173,6 @@ void emberAfFanControlClusterInitCallback(EndpointId endpoint) { VerifyOrDie(mFanControlManager == nullptr); mFanControlManager = new FanControlManager(endpoint); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(mFanControlManager); + AttributeAccessInterfaceRegistry::Instance().Register(mFanControlManager); FanControl::SetDefaultDelegate(endpoint, mFanControlManager); } diff --git a/examples/bridge-app/asr/src/bridged-actions-stub.cpp b/examples/bridge-app/asr/src/bridged-actions-stub.cpp index 2e47b2f385a1e2..73b7e8dd9877a0 100755 --- a/examples/bridge-app/asr/src/bridged-actions-stub.cpp +++ b/examples/bridge-app/asr/src/bridged-actions-stub.cpp @@ -97,5 +97,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/examples/bridge-app/esp32/main/DeviceCallbacks.cpp b/examples/bridge-app/esp32/main/DeviceCallbacks.cpp index a493243cecfe0e..768771555f3252 100644 --- a/examples/bridge-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/bridge-app/esp32/main/DeviceCallbacks.cpp @@ -113,5 +113,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/examples/bridge-app/linux/bridged-actions-stub.cpp b/examples/bridge-app/linux/bridged-actions-stub.cpp index 871f54a194e3bf..580f4f2239bd1a 100644 --- a/examples/bridge-app/linux/bridged-actions-stub.cpp +++ b/examples/bridge-app/linux/bridged-actions-stub.cpp @@ -133,5 +133,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 4c44f83a6485c1..cfd0795ed61324 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -999,7 +999,7 @@ void ApplicationInit() } } - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gPowerAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gPowerAttrAccess); } void ApplicationShutdown() {} diff --git a/examples/bridge-app/telink/src/DeviceCallbacks.cpp b/examples/bridge-app/telink/src/DeviceCallbacks.cpp index 7e451a7577ce94..9e3273e7107472 100644 --- a/examples/bridge-app/telink/src/DeviceCallbacks.cpp +++ b/examples/bridge-app/telink/src/DeviceCallbacks.cpp @@ -101,5 +101,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/examples/chef/common/chef-fan-control-manager.cpp b/examples/chef/common/chef-fan-control-manager.cpp index a47d4fac44aeaa..b30f58db27aee7 100644 --- a/examples/chef/common/chef-fan-control-manager.cpp +++ b/examples/chef/common/chef-fan-control-manager.cpp @@ -141,6 +141,6 @@ void emberAfFanControlClusterInitCallback(EndpointId endpoint) { VerifyOrDie(!mFanControlManager); mFanControlManager = std::make_unique(endpoint); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(mFanControlManager.get()); + AttributeAccessInterfaceRegistry::Instance().Register(mFanControlManager.get()); FanControl::SetDefaultDelegate(endpoint, mFanControlManager.get()); } diff --git a/examples/placeholder/linux/src/bridged-actions-stub.cpp b/examples/placeholder/linux/src/bridged-actions-stub.cpp index 1538e34e350f3c..d7abf17cd9106e 100644 --- a/examples/placeholder/linux/src/bridged-actions-stub.cpp +++ b/examples/placeholder/linux/src/bridged-actions-stub.cpp @@ -98,5 +98,5 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr void MatterActionsPluginServerInitCallback(void) { - chip::app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/AttributeAccessInterface.h b/src/app/AttributeAccessInterface.h index cdf7d6258511ae..f2985c4312b6b6 100644 --- a/src/app/AttributeAccessInterface.h +++ b/src/app/AttributeAccessInterface.h @@ -30,7 +30,7 @@ * endpoint or for all endpoints. * * Instances of AttributeAccessInterface that are registered via - * AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride will be consulted before taking the + * AttributeAccessInterfaceRegistry::Instance().Register will be consulted before taking the * normal attribute access codepath and can use that codepath as a fallback if desired. */ namespace chip { diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index f7b802105a9a33..b43042aad2aba8 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -105,14 +105,14 @@ AttributeAccessInterface * AttributeAccessInterfaceRegistry::Get(EndpointId endp return nullptr; } -void AttributeAccessInterfaceRegistry::UnregisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) +void AttributeAccessInterfaceRegistry::Unregister(AttributeAccessInterface * attrOverride) { mAttributeAccessInterfaceCache.Invalidate(); UnregisterMatchingAttributeAccessInterfaces([attrOverride](AttributeAccessInterface * entry) { return entry == attrOverride; }, mAttributeAccessOverrides); } -bool AttributeAccessInterfaceRegistry::RegisterAttributeAccessOverride(AttributeAccessInterface * attrOverride) +bool AttributeAccessInterfaceRegistry::Register(AttributeAccessInterface * attrOverride) { mAttributeAccessInterfaceCache.Invalidate(); for (auto * cur = mAttributeAccessOverrides; cur; cur = cur->GetNext()) diff --git a/src/app/AttributeAccessInterfaceRegistry.h b/src/app/AttributeAccessInterfaceRegistry.h index a3f9f3ccf96af3..48b1d4d5edaa1b 100644 --- a/src/app/AttributeAccessInterfaceRegistry.h +++ b/src/app/AttributeAccessInterfaceRegistry.h @@ -36,13 +36,13 @@ class AttributeAccessInterfaceRegistry * conflict with. In this case the override is not registered. * @return true if registration was successful. */ - bool RegisterAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride); + bool Register(chip::app::AttributeAccessInterface * attrOverride); /** * Unregister an attribute access override (for example if the object * implementing AttributeAccessInterface is being destroyed). */ - void UnregisterAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride); + void Unregister(chip::app::AttributeAccessInterface * attrOverride); /** * Unregister all attribute access interfaces that match this given endpoint. diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 87abfd30cbe8c0..321f7aa92a483a 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -479,6 +479,6 @@ void MatterAccessControlPluginServerInitCallback() { ChipLogProgress(DataManagement, "AccessControlCluster: initializing"); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&sAttribute); + AttributeAccessInterfaceRegistry::Instance().Register(&sAttribute); GetAccessControl().AddEntryListener(sAttribute); } diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index 084d827136016b..347fac06a44a1d 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -261,5 +261,5 @@ bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, void MatterAccountLoginPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAccountLoginAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gAccountLoginAttrAccess); } diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp index 0d32f690cc54c3..57a230de547743 100644 --- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp +++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp @@ -209,5 +209,5 @@ bool emberAfAdministratorCommissioningClusterRevokeCommissioningCallback( void MatterAdministratorCommissioningPluginServerInitCallback() { ChipLogProgress(Zcl, "Initiating Admin Commissioning cluster."); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAdminCommissioningAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAdminCommissioningAttrAccess); } diff --git a/src/app/clusters/air-quality-server/air-quality-server.cpp b/src/app/clusters/air-quality-server/air-quality-server.cpp index c34ef3e9e2882c..958d3783f72ca6 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.cpp +++ b/src/app/clusters/air-quality-server/air-quality-server.cpp @@ -39,7 +39,7 @@ Instance::Instance(EndpointId aEndpointId, BitMask aFeature) : Instance::~Instance() { - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } CHIP_ERROR Instance::Init() @@ -47,8 +47,7 @@ CHIP_ERROR Instance::Init() // Check if the cluster has been selected in zap VerifyOrDie(emberAfContainsServer(mEndpointId, Id) == true); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index 1485ea46d5c461..2dfaca6fbb719d 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -246,5 +246,5 @@ CHIP_ERROR ApplicationBasicAttrAccess::ReadAllowedVendorListAttribute(app::Attri void MatterApplicationBasicPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationBasicAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gApplicationBasicAttrAccess); } diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 537862cc523b8b..da5314f380e607 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -495,5 +495,5 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm void MatterApplicationLauncherPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gApplicationLauncherAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gApplicationLauncherAttrAccess); } diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 43e704d7abf7b8..ec71a56feb10db 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -244,5 +244,5 @@ bool emberAfAudioOutputClusterSelectOutputCallback(app::CommandHandler * command void MatterAudioOutputPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAudioOutputAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gAudioOutputAttrAccess); } diff --git a/src/app/clusters/basic-information/basic-information.cpp b/src/app/clusters/basic-information/basic-information.cpp index 2ebbb04bf01779..d045f2de89026a 100644 --- a/src/app/clusters/basic-information/basic-information.cpp +++ b/src/app/clusters/basic-information/basic-information.cpp @@ -476,6 +476,6 @@ bool IsLocalConfigDisabled() void MatterBasicInformationPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); PlatformMgr().SetDelegate(&gPlatformMgrDelegate); } diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp index d535f2701b3ab8..409e667278b081 100644 --- a/src/app/clusters/bindings/bindings.cpp +++ b/src/app/clusters/bindings/bindings.cpp @@ -268,7 +268,7 @@ CHIP_ERROR BindingTableAccess::NotifyBindingsChanged() void MatterBindingPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } CHIP_ERROR AddBindingEntry(const EmberBindingTableEntry & entry) diff --git a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp index e3d3921ec5bb2e..ca9b7e403dbea1 100644 --- a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp +++ b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp @@ -453,5 +453,5 @@ bool emberAfBooleanStateConfigurationClusterEnableDisableAlarmCallback( void MatterBooleanStateConfigurationPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index 63555f44d2ca57..13b4a8a577a09b 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -408,5 +408,5 @@ bool emberAfChannelClusterCancelRecordProgramCallback( void MatterChannelPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gChannelAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gChannelAttrAccess); } diff --git a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h index d9021838237c67..d71c1c4b6523c8 100644 --- a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h +++ b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h @@ -327,7 +327,7 @@ class Instance this->mMeasurementUnit = aMeasurementUnit; }; - ~Instance() override { AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); }; + ~Instance() override { AttributeAccessInterfaceRegistry::Instance().Unregister(this); }; CHIP_ERROR Init() { @@ -353,8 +353,7 @@ class Instance VerifyOrReturnError(emberAfContainsServer(mEndpointId, mClusterId), CHIP_ERROR_INCORRECT_STATE); // Register the object as attribute provider - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); mFeatureMap = GenerateFeatureMap(); diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index 091290b20e6f2d..f0b5d5992e8a36 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -286,5 +286,5 @@ bool emberAfContentLauncherClusterLaunchURLCallback(CommandHandler * commandObj, void MatterContentLauncherPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gContentLauncherAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gContentLauncherAttrAccess); } diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index fa4d8899c082f9..a8e50387646d5d 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -244,5 +244,5 @@ CHIP_ERROR DescriptorAttrAccess::Read(const ConcreteReadAttributePath & aPath, A void MatterDescriptorPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 779aa944cd2661..b666efe148e11e 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -39,8 +39,7 @@ namespace DeviceEnergyManagement { CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } @@ -48,7 +47,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } bool Instance::HasFeature(Feature aFeature) const 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 7b482209dee4a4..39f3671d72d418 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -4232,7 +4232,7 @@ void MatterDoorLockPluginServerInitCallback() ChipLogProgress(Zcl, "Door Lock server initialized"); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gFabricDelegate); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&DoorLockServer::Instance()); + AttributeAccessInterfaceRegistry::Instance().Register(&DoorLockServer::Instance()); } void MatterDoorLockClusterServerAttributeChangedCallback(const app::ConcreteAttributePath & attributePath) {} diff --git a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp index f74a878c8586ba..9cc38c63c0e1b3 100644 --- a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp +++ b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp @@ -42,14 +42,13 @@ MeasurementData gMeasurements[MATTER_DM_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_SE CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Init() { - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } void ElectricalEnergyMeasurementAttrAccess::Shutdown() { - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, diff --git a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp index a145d8b3e7c843..c03cd06cc6e60c 100644 --- a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp +++ b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.cpp @@ -42,14 +42,13 @@ namespace ElectricalPowerMeasurement { CHIP_ERROR Instance::Init() { - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } void Instance::Shutdown() { - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.cpp b/src/app/clusters/energy-evse-server/energy-evse-server.cpp index 1978cec27730f9..d89a4ded391f54 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.cpp +++ b/src/app/clusters/energy-evse-server/energy-evse-server.cpp @@ -39,8 +39,7 @@ namespace EnergyEvse { CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } @@ -48,7 +47,7 @@ CHIP_ERROR Instance::Init() void Instance::Shutdown() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/energy-preference-server/energy-preference-server.cpp b/src/app/clusters/energy-preference-server/energy-preference-server.cpp index 1f1eeabf082188..7b59f919dfc539 100644 --- a/src/app/clusters/energy-preference-server/energy-preference-server.cpp +++ b/src/app/clusters/energy-preference-server/energy-preference-server.cpp @@ -18,7 +18,7 @@ #include "energy-preference-server.h" #include -#include // Needed for AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride +#include // Needed for AttributeAccessInterfaceRegistry::Instance().Register #include #include @@ -228,5 +228,5 @@ Status MatterEnergyPreferenceClusterServerPreAttributeChangedCallback(const Conc void MatterEnergyPreferencePluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gEnergyPrefAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gEnergyPrefAttrAccess); } diff --git a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp index f4851ecf37825d..0e15f2f9987439 100644 --- a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp +++ b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp @@ -186,5 +186,5 @@ bool emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(app::CommandHan void MatterEthernetNetworkDiagnosticsPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/fixed-label-server/fixed-label-server.cpp b/src/app/clusters/fixed-label-server/fixed-label-server.cpp index aaa7656619f475..4a21dbbd3d6b47 100644 --- a/src/app/clusters/fixed-label-server/fixed-label-server.cpp +++ b/src/app/clusters/fixed-label-server/fixed-label-server.cpp @@ -110,5 +110,5 @@ CHIP_ERROR FixedLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, A void MatterFixedLabelPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 407dfe9a5ae9d6..4bf97face53740 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -343,7 +343,7 @@ void OnPlatformEventHandler(const DeviceLayer::ChipDeviceEvent * event, intptr_t void MatterGeneralCommissioningPluginServerInitCallback() { Breadcrumb::Set(0, 0); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler); } diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp index d619afedc08f97..e04410d29788c2 100644 --- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp +++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp @@ -491,7 +491,7 @@ void MatterGeneralDiagnosticsPluginServerInitCallback() { BootReasonEnum bootReason; - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); ConnectivityMgr().SetDelegate(&gDiagnosticDelegate); if (GetDiagnosticDataProvider().GetBootReason(bootReason) == CHIP_NO_ERROR) diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index 70fee6de3f9d57..39b9f59d23a5ca 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -436,7 +436,7 @@ GroupKeyManagementAttributeAccess gAttribute; void MatterGroupKeyManagementPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttribute); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttribute); } // diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp index 7e2fc334b795e4..d11922a130fe73 100644 --- a/src/app/clusters/icd-management-server/icd-management-server.cpp +++ b/src/app/clusters/icd-management-server/icd-management-server.cpp @@ -458,7 +458,7 @@ void MatterIcdManagementPluginServerInitCallback() // Configure and register Attribute Access Override gAttribute.Init(storage, symmetricKeystore, fabricTable, icdConfigurationData); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttribute); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttribute); // Configure ICD Management ICDManagementServer::Init(storage, symmetricKeystore, icdConfigurationData); diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index 0de0ef8eb96c24..6ca7a6dd46767d 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -196,5 +196,5 @@ bool emberAfKeypadInputClusterSendKeyCallback(app::CommandHandler * command, con void MatterKeypadInputPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gKeypadInputAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gKeypadInputAttrAccess); } diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp index 3fd3653d510c08..c4f2d200c1ed8d 100644 --- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp +++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp @@ -149,7 +149,7 @@ CHIP_ERROR LaundryDryerControlsServer::ReadSupportedDrynessLevels(const Concrete void MatterLaundryDryerControlsPluginServerInitCallback() { LaundryDryerControlsServer & laundryDryerControlsServer = LaundryDryerControlsServer::Instance(); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&laundryDryerControlsServer); + AttributeAccessInterfaceRegistry::Instance().Register(&laundryDryerControlsServer); } Status MatterLaundryDryerControlsClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp index bd608e3027de28..9b5a88f2103827 100644 --- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp +++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp @@ -187,7 +187,7 @@ CHIP_ERROR LaundryWasherControlsServer::ReadSupportedRinses(const ConcreteReadAt void MatterLaundryWasherControlsPluginServerInitCallback() { LaundryWasherControlsServer & laundryWasherControlsServer = LaundryWasherControlsServer::Instance(); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&laundryWasherControlsServer); + AttributeAccessInterfaceRegistry::Instance().Register(&laundryWasherControlsServer); } Status MatterLaundryWasherControlsClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, diff --git a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp index 8e63de7a770383..da061a4cfcab1f 100644 --- a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp +++ b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp @@ -221,5 +221,5 @@ void emberAfLocalizationConfigurationClusterServerInitCallback(EndpointId endpoi void MatterLocalizationConfigurationPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index c5596377842df1..e0f85f7223dee7 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -294,5 +294,5 @@ bool emberAfMediaInputClusterRenameInputCallback(app::CommandHandler * command, void MatterMediaInputPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaInputAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gMediaInputAttrAccess); } diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 06434bbcb67203..5f762cf8048ba0 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -708,5 +708,5 @@ void MatterMediaPlaybackClusterServerAttributeChangedCallback(const chip::app::C void MatterMediaPlaybackPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMediaPlaybackAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gMediaPlaybackAttrAccess); } diff --git a/src/app/clusters/messages-server/messages-server.cpp b/src/app/clusters/messages-server/messages-server.cpp index 218bc19562781e..f75368133cf36d 100644 --- a/src/app/clusters/messages-server/messages-server.cpp +++ b/src/app/clusters/messages-server/messages-server.cpp @@ -293,5 +293,5 @@ bool emberAfMessagesClusterCancelMessagesRequestCallback( void MatterMessagesPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gMessagesAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gMessagesAttrAccess); } diff --git a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp index aa10c8150dfa0b..73a3eb8a96774b 100644 --- a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp +++ b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.cpp @@ -55,7 +55,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClus Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } CHIP_ERROR Instance::Init() @@ -90,8 +90,7 @@ CHIP_ERROR Instance::Init() "Microwave Oven Control: feature bits error, if feature supports PowerNumberLimits it must support PowerAsNumber")); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); // If the PowerInWatts feature is supported, get the count of supported watt levels so we can later // ensure incoming watt level values are valid. if (HasFeature(MicrowaveOvenControl::Feature::kPowerInWatts)) diff --git a/src/app/clusters/mode-base-server/mode-base-server.cpp b/src/app/clusters/mode-base-server/mode-base-server.cpp index ce0e4bb2c1e4a4..092985d082fe06 100644 --- a/src/app/clusters/mode-base-server/mode-base-server.cpp +++ b/src/app/clusters/mode-base-server/mode-base-server.cpp @@ -65,7 +65,7 @@ void Instance::Shutdown() } UnregisterThisInstance(); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } CHIP_ERROR Instance::Init() @@ -79,8 +79,7 @@ CHIP_ERROR Instance::Init() LoadPersistentAttributes(); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); RegisterThisInstance(); ReturnErrorOnFailure(mDelegate->Init()); diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp index c200fa988dd602..c5fb49708aa663 100644 --- a/src/app/clusters/mode-select-server/mode-select-server.cpp +++ b/src/app/clusters/mode-select-server/mode-select-server.cpp @@ -219,7 +219,7 @@ inline bool areStartUpModeAndCurrentModeNonVolatile(EndpointId endpointId) void MatterModeSelectPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gModeSelectAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gModeSelectAttrAccess); } /** diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index 1cbd8ee9c813bc..7bb8aa665c5585 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -359,8 +359,7 @@ Instance::Instance(EndpointId aEndpointId, EthernetDriver * apDelegate) : CHIP_ERROR Instance::Init() { ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler, reinterpret_cast(this))); ReturnErrorOnFailure(mpBaseDriver->Init(this)); mLastNetworkingStatusValue.SetNull(); diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index db8947b88b8a44..ffc6a980039a3a 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -396,7 +396,7 @@ OpCredsFabricTableDelegate gFabricDelegate; void MatterOperationalCredentialsPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gFabricDelegate); diff --git a/src/app/clusters/operational-state-server/operational-state-server.cpp b/src/app/clusters/operational-state-server/operational-state-server.cpp index 3b513773a049dc..6c2d0e1c408bee 100644 --- a/src/app/clusters/operational-state-server/operational-state-server.cpp +++ b/src/app/clusters/operational-state-server/operational-state-server.cpp @@ -50,7 +50,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId) : Instance(aDel Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } CHIP_ERROR Instance::Init() @@ -64,8 +64,7 @@ CHIP_ERROR Instance::Init() ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp index a8d91cc77dadd6..26814231a23856 100644 --- a/src/app/clusters/ota-requestor/ota-requestor-server.cpp +++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp @@ -295,5 +295,5 @@ bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOTAProviderCallback( void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp index e300a01ddfd24e..421420884e31b2 100644 --- a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp +++ b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp @@ -100,5 +100,5 @@ CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(const ConcreteReadAttributeP void MatterPowerSourceConfigurationPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/power-source-server/power-source-server.cpp b/src/app/clusters/power-source-server/power-source-server.cpp index ecde2aede86c9b..7d95eca0da5ec5 100644 --- a/src/app/clusters/power-source-server/power-source-server.cpp +++ b/src/app/clusters/power-source-server/power-source-server.cpp @@ -91,7 +91,7 @@ PowerSourceClusterInfo * sPowerSourceClusterInfo = nullptr; void MatterPowerSourcePluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } namespace chip { diff --git a/src/app/clusters/power-topology-server/power-topology-server.cpp b/src/app/clusters/power-topology-server/power-topology-server.cpp index dcfd9e949a9aa1..31a85459eee882 100644 --- a/src/app/clusters/power-topology-server/power-topology-server.cpp +++ b/src/app/clusters/power-topology-server/power-topology-server.cpp @@ -41,14 +41,13 @@ namespace PowerTopology { CHIP_ERROR Instance::Init() { - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } void Instance::Shutdown() { - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } bool Instance::HasFeature(Feature aFeature) const diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp index 218ab7aa184cea..b8d885599245a4 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp @@ -60,7 +60,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClus Instance::~Instance() { CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); } CHIP_ERROR Instance::Init() @@ -73,8 +73,7 @@ CHIP_ERROR Instance::Init() LoadPersistentAttributes(); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); ChipLogDetail(Zcl, "ResourceMonitoring: calling mDelegate->Init()"); ReturnErrorOnFailure(mDelegate->Init()); diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h index 468dc7767a58f9..cec1efa82fa168 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h @@ -75,7 +75,7 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface * @return CHIP_ERROR_INVALID_ARGUMENT If the CommandHandler or Attribute Handler could not be registered. * @return CHIP_ERROR_INCORRECT_STATE If the CommandHandler was already registered * @return CHIP_ERROR_INCORRECT_STATE If the - * AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride fails. + * AttributeAccessInterfaceRegistry::Instance().Register fails. * @return CHIP_ERROR If the AppInit() method returned an error. This is application specific. * * @return CHIP_NO_ERROR If the cluster was initialised successfully. diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.cpp b/src/app/clusters/sample-mei-server/sample-mei-server.cpp index 2e1853256f2942..7677e3b1035cc7 100644 --- a/src/app/clusters/sample-mei-server/sample-mei-server.cpp +++ b/src/app/clusters/sample-mei-server/sample-mei-server.cpp @@ -31,8 +31,7 @@ void MatterSampleMeiPluginServerInitCallback() ChipLogProgress(Zcl, "Sample MEI Init. Ep %d, Total Ep %u", MATTER_DM_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT, static_cast(kNumSupportedEndpoints)); ReturnOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&SampleMeiServer::Instance())); - VerifyOrReturn(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&SampleMeiServer::Instance()), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(AttributeAccessInterfaceRegistry::Instance().Register(&SampleMeiServer::Instance()), CHIP_ERROR_INCORRECT_STATE); } void emberAfSampleMeiClusterServerInitCallback(chip::EndpointId endpoint) diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index 9f1fd1225cf633..b4c2d63d5659fa 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -340,8 +340,7 @@ CHIP_ERROR ScenesServer::Init() VerifyOrReturnError(!mIsInitialized, CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(chip::app::CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), - CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); mGroupProvider = Credentials::GetGroupDataProvider(); SceneTable * sceneTable = scenes::GetSceneTableImpl(); diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp index 21dab347a71cff..9f9235a16f46d8 100644 --- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp +++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp @@ -230,6 +230,6 @@ bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandle void MatterSoftwareDiagnosticsPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(&gCommandHandler); } diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 583edd0b2e6d6f..e42673a8bfbebb 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -261,5 +261,5 @@ void MatterTargetNavigatorClusterServerAttributeChangedCallback(const chip::app: void MatterTargetNavigatorPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gTargetNavigatorAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gTargetNavigatorAttrAccess); } diff --git a/src/app/clusters/temperature-control-server/temperature-control-server.cpp b/src/app/clusters/temperature-control-server/temperature-control-server.cpp index 510260a880cad4..2faab863d2b2f9 100644 --- a/src/app/clusters/temperature-control-server/temperature-control-server.cpp +++ b/src/app/clusters/temperature-control-server/temperature-control-server.cpp @@ -228,5 +228,5 @@ void emberAfTemperatureControlClusterServerInitCallback(EndpointId endpoint) {} void MatterTemperatureControlPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index d4ff1c9128f771..158d43d18509de 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -1119,5 +1119,5 @@ bool emberAfUnitTestingClusterTestSecondBatchHelperRequestCallback( void MatterUnitTestingPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index 54298746290d7c..24d762b93d6a67 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -928,5 +928,5 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co void MatterThermostatPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gThermostatAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gThermostatAttrAccess); } diff --git a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp index bc3b9a88dc02d9..f4ec69e05b1fa5 100644 --- a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp +++ b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp @@ -204,6 +204,6 @@ bool emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandl void MatterThreadNetworkDiagnosticsPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); GetDiagnosticDataProvider().SetThreadDiagnosticsDelegate(&gDiagnosticDelegate); } diff --git a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp index 6d4feb6f4d4864..631ee8087c3a91 100644 --- a/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp +++ b/src/app/clusters/thread-network-directory-server/thread-network-directory-server.cpp @@ -47,13 +47,13 @@ ThreadNetworkDirectoryServer::ThreadNetworkDirectoryServer(EndpointId endpoint, ThreadNetworkDirectoryServer::~ThreadNetworkDirectoryServer() { - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } CHIP_ERROR ThreadNetworkDirectoryServer::Init() { - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 6a35087a839718..04345ee649e48a 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -232,5 +232,5 @@ void emberAfTimeFormatLocalizationClusterServerInitCallback(EndpointId endpoint) void MatterTimeFormatLocalizationPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp index 6aace08ae1c263..8ef3d967b5d655 100644 --- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp +++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp @@ -1290,5 +1290,5 @@ bool emberAfTimeSynchronizationClusterSetDefaultNTPCallback( void MatterTimeSynchronizationPluginServerInitCallback() { TimeSynchronizationServer::Instance().Init(); - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/user-label-server/user-label-server.cpp b/src/app/clusters/user-label-server/user-label-server.cpp index 84ef0a1874b7d0..5daae5ab179ac3 100644 --- a/src/app/clusters/user-label-server/user-label-server.cpp +++ b/src/app/clusters/user-label-server/user-label-server.cpp @@ -219,6 +219,6 @@ UserLabelFabricTableDelegate gUserLabelFabricDelegate; void MatterUserLabelPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); Server::GetInstance().GetFabricTable().AddFabricDelegate(&gUserLabelFabricDelegate); } diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp index e35a117a90f28d..f6fa4e8fee6332 100644 --- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp +++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp @@ -514,5 +514,5 @@ bool emberAfValveConfigurationAndControlClusterCloseCallback( void MatterValveConfigurationAndControlPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp index 107448fbc0e5d9..5f3b7bb6d3a7d1 100644 --- a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp @@ -142,5 +142,5 @@ CHIP_ERROR WakeOnLanAttrAccess::ReadMacAddressAttribute(app::AttributeValueEncod void MatterWakeOnLanPluginServerInitCallback() { - app::AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gWakeOnLanAttrAccess); + app::AttributeAccessInterfaceRegistry::Instance().Register(&gWakeOnLanAttrAccess); } diff --git a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp index e05789ecba12d9..416c7179c10f60 100644 --- a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp +++ b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp @@ -317,6 +317,6 @@ bool emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandler void MatterWiFiNetworkDiagnosticsPluginServerInitCallback() { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&gAttrAccess); + AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); GetDiagnosticDataProvider().SetWiFiDiagnosticsDelegate(&gDiagnosticDelegate); } diff --git a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp index 7b92a797105c09..0883b74f56590b 100644 --- a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp +++ b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp @@ -63,13 +63,13 @@ WiFiNetworkManagementServer::WiFiNetworkManagementServer(EndpointId endpoint) : WiFiNetworkManagementServer::~WiFiNetworkManagementServer() { - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Unregister(this); CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); } CHIP_ERROR WiFiNetworkManagementServer::Init() { - VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); + VerifyOrReturnError(AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); return CHIP_NO_ERROR; } diff --git a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp index ca25fc4161143e..c2613654669408 100644 --- a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp @@ -591,12 +591,9 @@ class RegisteredAttributeAccessInterface template RegisteredAttributeAccessInterface(Args &&... args) : mData(std::forward(args)...) { - VerifyOrDie(AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&mData)); - } - ~RegisteredAttributeAccessInterface() - { - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(&mData); + VerifyOrDie(AttributeAccessInterfaceRegistry::Instance().Register(&mData)); } + ~RegisteredAttributeAccessInterface() { AttributeAccessInterfaceRegistry::Instance().Unregister(&mData); } T * operator->() { return &mData; } T & operator*() { return mData; } diff --git a/src/controller/tests/TestEventChunking.cpp b/src/controller/tests/TestEventChunking.cpp index a8befd5c6c15bc..60eaf037ada087 100644 --- a/src/controller/tests/TestEventChunking.cpp +++ b/src/controller/tests/TestEventChunking.cpp @@ -220,7 +220,7 @@ class TestAttrAccess : public app::AttributeAccessInterface // Register for the Test Cluster cluster on all endpoints. TestAttrAccess() : AttributeAccessInterface(Optional::Missing(), Clusters::UnitTesting::Id) { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Register(this); } CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; diff --git a/src/controller/tests/TestReadChunking.cpp b/src/controller/tests/TestReadChunking.cpp index b45e5219d28c24..b5e33ede85eca4 100644 --- a/src/controller/tests/TestReadChunking.cpp +++ b/src/controller/tests/TestReadChunking.cpp @@ -360,7 +360,7 @@ class TestAttrAccess : public app::AttributeAccessInterface // Register for the Test Cluster cluster on all endpoints. TestAttrAccess() : AttributeAccessInterface(Optional::Missing(), Clusters::UnitTesting::Id) { - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(this); + AttributeAccessInterfaceRegistry::Instance().Register(this); } CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; diff --git a/src/controller/tests/TestWriteChunking.cpp b/src/controller/tests/TestWriteChunking.cpp index 3a396e73de9392..5bb7ef95214ce9 100644 --- a/src/controller/tests/TestWriteChunking.cpp +++ b/src/controller/tests/TestWriteChunking.cpp @@ -217,7 +217,7 @@ TEST_F(TestWriteChunking, TestListChunking) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().Register(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); // @@ -290,7 +290,7 @@ TEST_F(TestWriteChunking, TestBadChunking) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().Register(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); @@ -369,7 +369,7 @@ TEST_F(TestWriteChunking, TestConflictWrite) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().Register(&testServer); app::AttributePathParams attributePath(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); @@ -443,7 +443,7 @@ TEST_F(TestWriteChunking, TestNonConflictWrite) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().Register(&testServer); app::AttributePathParams attributePath1(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute); app::AttributePathParams attributePath2(kTestEndpointId, app::Clusters::UnitTesting::Id, kTestListAttribute2); @@ -591,7 +591,7 @@ TEST_F(TestWriteChunking, TestTransactionalList) emberAfSetDynamicEndpoint(0, kTestEndpointId, &testEndpoint, Span(dataVersionStorage)); // Register our fake attribute access interface. - AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(&testServer); + AttributeAccessInterfaceRegistry::Instance().Register(&testServer); // Test 1: we should receive transaction notifications ChipLogProgress(Zcl, "Test 1: we should receive transaction notifications"); diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm index 66f111b9e3989b..172ce2bd0d0797 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm @@ -379,7 +379,7 @@ - (void)registerMatterCluster std::lock_guard lock(_lock); - if (!AttributeAccessInterfaceRegistry::Instance().RegisterAttributeAccessOverride(_attributeAccessInterface.get())) { + if (!AttributeAccessInterfaceRegistry::Instance().Register(_attributeAccessInterface.get())) { // This should only happen if we somehow managed to register an // AttributeAccessInterface for the same (endpoint, cluster) pair. MTR_LOG_ERROR("Could not register AttributeAccessInterface for endpoint %u, cluster 0x%llx", @@ -394,7 +394,7 @@ - (void)unregisterMatterCluster std::lock_guard lock(_lock); if (_attributeAccessInterface != nullptr) { - AttributeAccessInterfaceRegistry::Instance().UnregisterAttributeAccessOverride(_attributeAccessInterface.get()); + AttributeAccessInterfaceRegistry::Instance().Unregister(_attributeAccessInterface.get()); } } From 0f3aca82eec2704e008c8f2111e264e84cb29225 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:20:12 -0400 Subject: [PATCH 21/32] Fix endpoint id usage that was awkward in aai --- src/app/AttributeAccessInterfaceRegistry.cpp | 4 ++-- src/app/AttributeAccessInterfaceRegistry.h | 3 +-- src/app/util/attribute-storage.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index b43042aad2aba8..f3c8ee7093cb02 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -67,10 +67,10 @@ AttributeAccessInterfaceRegistry & AttributeAccessInterfaceRegistry::Instance() return instance; } -void AttributeAccessInterfaceRegistry::UnregisterAllForEndpoint(EmberAfDefinedEndpoint * definedEndpoint) +void AttributeAccessInterfaceRegistry::UnregisterAllForEndpoint(EndpointId endpointId) { UnregisterMatchingAttributeAccessInterfaces( - [endpoint = definedEndpoint->endpoint](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpoint); }, + [endpointId](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpointId); }, mAttributeAccessOverrides); } diff --git a/src/app/AttributeAccessInterfaceRegistry.h b/src/app/AttributeAccessInterfaceRegistry.h index 48b1d4d5edaa1b..26527e6d26250a 100644 --- a/src/app/AttributeAccessInterfaceRegistry.h +++ b/src/app/AttributeAccessInterfaceRegistry.h @@ -17,7 +17,6 @@ #include #include -#include namespace chip { namespace app { @@ -47,7 +46,7 @@ class AttributeAccessInterfaceRegistry /** * Unregister all attribute access interfaces that match this given endpoint. */ - void UnregisterAllForEndpoint(EmberAfDefinedEndpoint * definedEndpoint); + void UnregisterAllForEndpoint(EndpointId endpointId); /** * Get the registered attribute access override. nullptr when attribute access override is not found. diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 90b2e8cf11c556..b9d54fceb85fb5 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -423,7 +423,7 @@ static void shutdownEndpoint(EmberAfDefinedEndpoint * definedEndpoint) } CommandHandlerInterfaceRegistry::Instance().UnregisterAllCommandHandlersForEndpoint(definedEndpoint->endpoint); - AttributeAccessInterfaceRegistry::Instance().UnregisterAllForEndpoint(definedEndpoint); + AttributeAccessInterfaceRegistry::Instance().UnregisterAllForEndpoint(definedEndpoint->endpoint); } // Calls the init functions. From ee9f0cc87640375a0fb6603bd44f55ad68c4a442 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:20:43 -0400 Subject: [PATCH 22/32] Restyle --- src/app/AttributeAccessInterfaceRegistry.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index f3c8ee7093cb02..08458a63388ea2 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -70,8 +70,7 @@ AttributeAccessInterfaceRegistry & AttributeAccessInterfaceRegistry::Instance() void AttributeAccessInterfaceRegistry::UnregisterAllForEndpoint(EndpointId endpointId) { UnregisterMatchingAttributeAccessInterfaces( - [endpointId](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpointId); }, - mAttributeAccessOverrides); + [endpointId](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpointId); }, mAttributeAccessOverrides); } AttributeAccessInterface * AttributeAccessInterfaceRegistry::Get(EndpointId endpointId, ClusterId clusterId) From 5303e8163b87b5b9a38cd40b840f37185bdfd517 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:21:59 -0400 Subject: [PATCH 23/32] Code simplification and some namespace removal --- src/app/AttributeAccessInterfaceRegistry.cpp | 4 ++-- src/app/AttributeAccessInterfaceRegistry.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index 08458a63388ea2..603189e2742e07 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -18,10 +18,10 @@ #include -using namespace chip::app; - namespace { +using chip::app::AttributeAccessInterface; + // shouldUnregister returns true if the given AttributeAccessInterface should be // unregistered. template diff --git a/src/app/AttributeAccessInterfaceRegistry.h b/src/app/AttributeAccessInterfaceRegistry.h index 26527e6d26250a..19cebd5edca594 100644 --- a/src/app/AttributeAccessInterfaceRegistry.h +++ b/src/app/AttributeAccessInterfaceRegistry.h @@ -35,13 +35,13 @@ class AttributeAccessInterfaceRegistry * conflict with. In this case the override is not registered. * @return true if registration was successful. */ - bool Register(chip::app::AttributeAccessInterface * attrOverride); + bool Register(AttributeAccessInterface * attrOverride); /** * Unregister an attribute access override (for example if the object * implementing AttributeAccessInterface is being destroyed). */ - void Unregister(chip::app::AttributeAccessInterface * attrOverride); + void Unregister(AttributeAccessInterface * attrOverride); /** * Unregister all attribute access interfaces that match this given endpoint. From d47d0b5de8235340b96458382040b24851cfee7d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:23:42 -0400 Subject: [PATCH 24/32] Fix comment --- .../resource-monitoring-server/resource-monitoring-server.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h index cec1efa82fa168..45c96c39f30074 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h @@ -74,8 +74,7 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface * @die If the endpoint and cluster ID have not been enabled in zap. * @return CHIP_ERROR_INVALID_ARGUMENT If the CommandHandler or Attribute Handler could not be registered. * @return CHIP_ERROR_INCORRECT_STATE If the CommandHandler was already registered - * @return CHIP_ERROR_INCORRECT_STATE If the - * AttributeAccessInterfaceRegistry::Instance().Register fails. + * @return CHIP_ERROR_INCORRECT_STATE If the AttributeAccessInterfaceRegistry::Register fails. * @return CHIP_ERROR If the AppInit() method returned an error. This is application specific. * * @return CHIP_NO_ERROR If the cluster was initialised successfully. From 947ef984b62e2158e5b78dd4e056170fd84268a1 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:25:32 -0400 Subject: [PATCH 25/32] re-order of methods --- src/app/AttributeAccessInterfaceRegistry.cpp | 45 ++++++++++---------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index 603189e2742e07..30d152087de5e2 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -73,6 +73,29 @@ void AttributeAccessInterfaceRegistry::UnregisterAllForEndpoint(EndpointId endpo [endpointId](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpointId); }, mAttributeAccessOverrides); } +void AttributeAccessInterfaceRegistry::Unregister(AttributeAccessInterface * attrOverride) +{ + mAttributeAccessInterfaceCache.Invalidate(); + UnregisterMatchingAttributeAccessInterfaces([attrOverride](AttributeAccessInterface * entry) { return entry == attrOverride; }, + mAttributeAccessOverrides); +} + +bool AttributeAccessInterfaceRegistry::Register(AttributeAccessInterface * attrOverride) +{ + mAttributeAccessInterfaceCache.Invalidate(); + for (auto * cur = mAttributeAccessOverrides; cur; cur = cur->GetNext()) + { + if (cur->Matches(*attrOverride)) + { + ChipLogError(InteractionModel, "Duplicate attribute override registration failed"); + return false; + } + } + attrOverride->SetNext(mAttributeAccessOverrides); + mAttributeAccessOverrides = attrOverride; + return true; +} + AttributeAccessInterface * AttributeAccessInterfaceRegistry::Get(EndpointId endpointId, ClusterId clusterId) { using CacheResult = AttributeAccessInterfaceCache::CacheResult; @@ -104,28 +127,6 @@ AttributeAccessInterface * AttributeAccessInterfaceRegistry::Get(EndpointId endp return nullptr; } -void AttributeAccessInterfaceRegistry::Unregister(AttributeAccessInterface * attrOverride) -{ - mAttributeAccessInterfaceCache.Invalidate(); - UnregisterMatchingAttributeAccessInterfaces([attrOverride](AttributeAccessInterface * entry) { return entry == attrOverride; }, - mAttributeAccessOverrides); -} - -bool AttributeAccessInterfaceRegistry::Register(AttributeAccessInterface * attrOverride) -{ - mAttributeAccessInterfaceCache.Invalidate(); - for (auto * cur = mAttributeAccessOverrides; cur; cur = cur->GetNext()) - { - if (cur->Matches(*attrOverride)) - { - ChipLogError(InteractionModel, "Duplicate attribute override registration failed"); - return false; - } - } - attrOverride->SetNext(mAttributeAccessOverrides); - mAttributeAccessOverrides = attrOverride; - return true; -} } // namespace app } // namespace chip From 6c8839fb4b6f3123cdf151fd2eea7528cc5b9db6 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:28:04 -0400 Subject: [PATCH 26/32] One more move to preserve previous order --- src/app/AttributeAccessInterfaceRegistry.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index 30d152087de5e2..2fffa380b50c2e 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -67,12 +67,6 @@ AttributeAccessInterfaceRegistry & AttributeAccessInterfaceRegistry::Instance() return instance; } -void AttributeAccessInterfaceRegistry::UnregisterAllForEndpoint(EndpointId endpointId) -{ - UnregisterMatchingAttributeAccessInterfaces( - [endpointId](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpointId); }, mAttributeAccessOverrides); -} - void AttributeAccessInterfaceRegistry::Unregister(AttributeAccessInterface * attrOverride) { mAttributeAccessInterfaceCache.Invalidate(); @@ -80,6 +74,12 @@ void AttributeAccessInterfaceRegistry::Unregister(AttributeAccessInterface * att mAttributeAccessOverrides); } +void AttributeAccessInterfaceRegistry::UnregisterAllForEndpoint(EndpointId endpointId) +{ + UnregisterMatchingAttributeAccessInterfaces( + [endpointId](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpointId); }, mAttributeAccessOverrides); +} + bool AttributeAccessInterfaceRegistry::Register(AttributeAccessInterface * attrOverride) { mAttributeAccessInterfaceCache.Invalidate(); From 3740379b5c4e8a88eea82b86bc59a50b1f682602 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 15:31:14 -0400 Subject: [PATCH 27/32] Restyle --- src/app/AttributeAccessInterfaceRegistry.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index 2fffa380b50c2e..e17f741e07b322 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -127,6 +127,5 @@ AttributeAccessInterface * AttributeAccessInterfaceRegistry::Get(EndpointId endp return nullptr; } - } // namespace app } // namespace chip From b9a7ad0c7024b9e270144aa5f0146cb198f3fd94 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Jul 2024 16:50:06 -0400 Subject: [PATCH 28/32] Add back the odd clear --- src/app/InteractionModelEngine.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 8219046f0eb492..822bdf17b9f11b 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -99,6 +99,13 @@ CHIP_ERROR InteractionModelEngine::Init(Messaging::ExchangeManager * apExchangeM void InteractionModelEngine::Shutdown() { mpExchangeMgr->GetSessionManager()->SystemLayer()->CancelTimer(ResumeSubscriptionsTimerCallback, this); + + // TODO: individual object clears the entire command handler interface registry. + // This may not be expected as IME does NOT own the command handler interface registry. + // + // This is to be cleaned up once InteractionModelEngine maintains a data model fully and + // the code-generation model can do its clear in its shutdown method. + CommandHandlerInterfaceRegistry::Instance().UnregisterAllHandlers(); mCommandResponderObjs.ReleaseAll(); mTimedHandlers.ForEachActiveObject([this](TimedHandler * obj) -> Loop { From eeb4454503bf6526bfb17c89848cb5f9efa4276b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 29 Jul 2024 10:00:35 -0400 Subject: [PATCH 29/32] Add missing invalidation of AAI cache --- .../py_matter_idl/matter_idl/test_idl_generator.py | 13 ++++++++----- src/app/AttributeAccessInterfaceRegistry.cpp | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/test_idl_generator.py b/scripts/py_matter_idl/matter_idl/test_idl_generator.py index 9f40b111bff96f..e2682b915f86ad 100755 --- a/scripts/py_matter_idl/matter_idl/test_idl_generator.py +++ b/scripts/py_matter_idl/matter_idl/test_idl_generator.py @@ -55,8 +55,8 @@ def ReadMatterIdl(repo_path: str) -> str: return stream.read() -def ParseMatterIdl(repo_path: str, skip_meta: bool) -> Idl: - return CreateParser(skip_meta=skip_meta).parse(ReadMatterIdl(repo_path)) +def ParseMatterIdl(repo_path: str, skip_meta: bool, merge_globals: bool) -> Idl: + return CreateParser(skip_meta=skip_meta, merge_globals=merge_globals).parse(ReadMatterIdl(repo_path)) def RenderAsIdlTxt(idl: Idl) -> str: @@ -106,8 +106,11 @@ def test_client_clusters(self): # Files MUST be identical except the header comments which are different original = SkipLeadingComments(ReadMatterIdl(path), also_strip=[ " // NOTE: Default/not specifically set"]) + + # Do not merge globals: zap generators do not generate IDLs with + # globals inside structures (i.e. no comments about referenced globals) generated = SkipLeadingComments(RenderAsIdlTxt( - ParseMatterIdl(path, skip_meta=False))) + ParseMatterIdl(path, skip_meta=False, merge_globals=False))) self.assertTextEqual(original, generated) @@ -126,9 +129,9 @@ def test_app_rendering(self): ] for path in test_paths: - idl = ParseMatterIdl(path, skip_meta=True) + idl = ParseMatterIdl(path, skip_meta=True, merge_globals=True) txt = RenderAsIdlTxt(idl) - idl2 = CreateParser(skip_meta=True).parse(txt) + idl2 = CreateParser(skip_meta=True, merge_globals=True).parse(txt) # checks that data types and content is the same self.assertEqual(idl, idl2) diff --git a/src/app/AttributeAccessInterfaceRegistry.cpp b/src/app/AttributeAccessInterfaceRegistry.cpp index e17f741e07b322..6af136699c3bdd 100644 --- a/src/app/AttributeAccessInterfaceRegistry.cpp +++ b/src/app/AttributeAccessInterfaceRegistry.cpp @@ -76,6 +76,7 @@ void AttributeAccessInterfaceRegistry::Unregister(AttributeAccessInterface * att void AttributeAccessInterfaceRegistry::UnregisterAllForEndpoint(EndpointId endpointId) { + mAttributeAccessInterfaceCache.Invalidate(); UnregisterMatchingAttributeAccessInterfaces( [endpointId](AttributeAccessInterface * entry) { return entry->MatchesEndpoint(endpointId); }, mAttributeAccessOverrides); } From f5c2faad3943721a8b719dd37ea4bde3edea121b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 6 Aug 2024 14:09:33 -0400 Subject: [PATCH 30/32] Fix compile --- .../ecosystem-information-server.cpp | 2 +- .../occupancy-sensor-server/occupancy-sensor-server.cpp | 4 ++-- .../clusters/service-area-server/service-area-server.cpp | 4 ++-- .../thread-border-router-management-server.cpp | 2 +- .../water-heater-management-server.cpp | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp index 74a27f21779ff9..333fddcb76e526 100644 --- a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp +++ b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp @@ -391,5 +391,5 @@ chip::app::Clusters::EcosystemInformation::AttrAccess gAttrAccess; void MatterEcosystemInformationPluginServerInitCallback() { - registerAttributeAccessOverride(&gAttrAccess); + chip::app::AttributeAccessInterfaceRegistry::Instance().Register(&gAttrAccess); } diff --git a/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp b/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp index 4a3ba4103a0b0d..eb3b8101d1a41e 100644 --- a/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp +++ b/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp @@ -41,13 +41,13 @@ uint16_t sHoldTime[MATTER_DM_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT + C CHIP_ERROR OccupancySensingAttrAccess::Init() { - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } void OccupancySensingAttrAccess::Shutdown() { - unregisterAttributeAccessOverride(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().Unregister(this); } CHIP_ERROR OccupancySensingAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) diff --git a/src/app/clusters/service-area-server/service-area-server.cpp b/src/app/clusters/service-area-server/service-area-server.cpp index fa5d626a5ab06c..54a554bfba294a 100644 --- a/src/app/clusters/service-area-server/service-area-server.cpp +++ b/src/app/clusters/service-area-server/service-area-server.cpp @@ -57,7 +57,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, BitMaskInit(); } diff --git a/src/app/clusters/thread-border-router-management-server/thread-border-router-management-server.cpp b/src/app/clusters/thread-border-router-management-server/thread-border-router-management-server.cpp index 5592da410100c2..3e11e4fe551854 100644 --- a/src/app/clusters/thread-border-router-management-server/thread-border-router-management-server.cpp +++ b/src/app/clusters/thread-border-router-management-server/thread-border-router-management-server.cpp @@ -341,7 +341,7 @@ CHIP_ERROR ServerInstance::Init() { ReturnErrorCodeIf(!mDelegate, CHIP_ERROR_INVALID_ARGUMENT); ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler, reinterpret_cast(this))); return mDelegate->Init(this); } diff --git a/src/app/clusters/water-heater-management-server/water-heater-management-server.cpp b/src/app/clusters/water-heater-management-server/water-heater-management-server.cpp index 6af249370e8fb8..0806638dd7ee4d 100644 --- a/src/app/clusters/water-heater-management-server/water-heater-management-server.cpp +++ b/src/app/clusters/water-heater-management-server/water-heater-management-server.cpp @@ -40,16 +40,16 @@ constexpr uint16_t kClusterRevision = 1; CHIP_ERROR Instance::Init() { - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); - VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); + VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } void Instance::Shutdown() { - CommandHandlerInterfaceRegistry::UnregisterCommandHandler(this); - unregisterAttributeAccessOverride(this); + CommandHandlerInterfaceRegistry::Instance().UnregisterCommandHandler(this); + chip::app::AttributeAccessInterfaceRegistry::Instance().Unregister(this); } bool Instance::HasFeature(Feature aFeature) const From 1756f4de8346e391df8cf86bf1515b067b9ed55b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 6 Aug 2024 14:16:35 -0400 Subject: [PATCH 31/32] one more compile fix --- .../thread-border-router-management-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/thread-border-router-management-server/thread-border-router-management-server.cpp b/src/app/clusters/thread-border-router-management-server/thread-border-router-management-server.cpp index 3e11e4fe551854..ba396ae2b03da7 100644 --- a/src/app/clusters/thread-border-router-management-server/thread-border-router-management-server.cpp +++ b/src/app/clusters/thread-border-router-management-server/thread-border-router-management-server.cpp @@ -340,7 +340,7 @@ void ServerInstance::OnPlatformEventHandler(const DeviceLayer::ChipDeviceEvent * CHIP_ERROR ServerInstance::Init() { ReturnErrorCodeIf(!mDelegate, CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::RegisterCommandHandler(this)); + ReturnErrorOnFailure(CommandHandlerInterfaceRegistry::Instance().RegisterCommandHandler(this)); VerifyOrReturnError(chip::app::AttributeAccessInterfaceRegistry::Instance().Register(this), CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(OnPlatformEventHandler, reinterpret_cast(this))); return mDelegate->Init(this); From cd9558201eb7a9a0336ba8713f63d6812cf9c386 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 6 Aug 2024 15:09:53 -0400 Subject: [PATCH 32/32] more compile fixes --- src/app/clusters/service-area-server/service-area-server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/clusters/service-area-server/service-area-server.cpp b/src/app/clusters/service-area-server/service-area-server.cpp index 54a554bfba294a..a220559a7bde7b 100644 --- a/src/app/clusters/service-area-server/service-area-server.cpp +++ b/src/app/clusters/service-area-server/service-area-server.cpp @@ -56,7 +56,7 @@ Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, BitMask