Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into Modified_yamls_matt…
Browse files Browse the repository at this point in the history
…er_1_3
  • Loading branch information
raul-marquez-csa committed Feb 16, 2024
2 parents 681ca3c + de5c6d5 commit 8b57258
Show file tree
Hide file tree
Showing 48 changed files with 3,158 additions and 950 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4455,6 +4455,27 @@ provisional cluster EnergyEvse = 153 {
timed command ClearTargets(): DefaultSuccess = 7;
}

/** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */
provisional cluster PowerTopology = 156 {
revision 1;

bitmap Feature : bitmap32 {
kNodeTopology = 0x1;
kTreeTopology = 0x2;
kSetTopology = 0x4;
kDynamicPowerFlow = 0x8;
}

readonly attribute optional endpoint_no availableEndpoints[] = 0;
readonly attribute optional endpoint_no activeEndpoints[] = 1;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
provisional cluster EnergyEvseMode = 157 {
revision 1;
Expand Down Expand Up @@ -8340,6 +8361,17 @@ endpoint 1 {
handle command ClearTargets;
}

server cluster PowerTopology {
callback attribute availableEndpoints;
callback attribute activeEndpoints;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
ram attribute clusterRevision default = 1;
}

server cluster EnergyEvseMode {
callback attribute supportedModes;
callback attribute currentMode;
Expand Down
138 changes: 138 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -14240,6 +14240,144 @@
}
]
},
{
"name": "Power Topology",
"code": 156,
"mfgCode": null,
"define": "POWER_TOPOLOGY_CLUSTER",
"side": "server",
"enabled": 1,
"attributes": [
{
"name": "AvailableEndpoints",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ActiveEndpoints",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Energy EVSE Mode",
"code": 157,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
*
* 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 <app/clusters/power-topology-server/power-topology-server.h>

using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::PowerTopology;

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;
};

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;
}

} // namespace PowerTopology
} // namespace Clusters
} // namespace app
} // namespace chip

static std::unique_ptr<PowerTopology::Delegate> gDelegate;
static std::unique_ptr<PowerTopology::Instance> gInstance;

void emberAfPowerTopologyClusterInitCallback(chip::EndpointId endpointId)
{
VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1.
VerifyOrDie(!gInstance);

gDelegate = std::make_unique<PowerTopologyDelegate>();
if (gDelegate)
{
gInstance = std::make_unique<Instance>(
endpointId, *gDelegate, BitMask<Feature, uint32_t>(Feature::kSetTopology, Feature::kDynamicPowerFlow),
BitMask<OptionalAttributes, uint32_t>(OptionalAttributes::kOptionalAttributeAvailableEndpoints,
OptionalAttributes::kOptionalAttributeActiveEndpoints));

gInstance->Init();
}
}
1 change: 1 addition & 0 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-topology-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/resource-monitoring-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server"
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp",
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
Expand Down
5 changes: 5 additions & 0 deletions scripts/tests/chiptest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def _GetChipReplUnsupportedTests() -> Set[str]:
"Test_TC_IDM_1_2.yaml", # chip-repl does not support AnyCommands (19/07/2023)
"TestGroupKeyManagementCluster.yaml", # chip-repl does not support EqualityCommands (2023-08-04)
"TestIcdManagementCluster.yaml", # TODO(#30430): add ICD registration support in chip-repl
"Test_TC_ICDM_3_4.yaml", # chip-repl does not support ICD registration
"Test_TC_S_2_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_MOD_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_MOD_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
Expand Down Expand Up @@ -264,6 +265,10 @@ def _GetChipReplUnsupportedTests() -> Set[str]:
"Test_TC_RVCCLEANM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_BINFO_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"TestDiagnosticLogs.yaml", # chip-repl does not implement a BDXTransferServerDelegate
"Test_TC_EEVSEM_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_EEVSEM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_EEVSEM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_EEVSEM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"TestDiagnosticLogsDownloadCommand.yaml", # chip-repl does not implement the bdx download command
}

Expand Down
Loading

0 comments on commit 8b57258

Please sign in to comment.