From 98b24695eaa6b1168d1c8e836fdf05e579164b38 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 27 Feb 2024 07:39:01 +0000 Subject: [PATCH] Added missing PowerTopologyDelegate.h & .cpp --- .../include/PowerTopologyDelegate.h | 42 +++++++++++++++++++ .../src/PowerTopologyDelegate.cpp | 33 +++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 examples/energy-management-app/energy-management-common/include/PowerTopologyDelegate.h create mode 100644 examples/energy-management-app/energy-management-common/src/PowerTopologyDelegate.cpp diff --git a/examples/energy-management-app/energy-management-common/include/PowerTopologyDelegate.h b/examples/energy-management-app/energy-management-common/include/PowerTopologyDelegate.h new file mode 100644 index 00000000000000..365201a6951c75 --- /dev/null +++ b/examples/energy-management-app/energy-management-common/include/PowerTopologyDelegate.h @@ -0,0 +1,42 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace PowerTopology { + +class PowerTopologyDelegate : public Delegate +{ +public: + ~PowerTopologyDelegate() = default; + + CHIP_ERROR GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) override; + CHIP_ERROR GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) override; +}; + +} // namespace PowerTopology +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/energy-management-app/energy-management-common/src/PowerTopologyDelegate.cpp b/examples/energy-management-app/energy-management-common/src/PowerTopologyDelegate.cpp new file mode 100644 index 00000000000000..71d698b39e22f0 --- /dev/null +++ b/examples/energy-management-app/energy-management-common/src/PowerTopologyDelegate.cpp @@ -0,0 +1,33 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::PowerTopology; + +CHIP_ERROR PowerTopologyDelegate::GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) +{ + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; +} + +CHIP_ERROR PowerTopologyDelegate::GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) +{ + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; +}