Skip to content

Commit c7d1a48

Browse files
jamesharrowhastyrestyled-commitsandreilitvin
authored
Add basic Energy gateway app example and add new XML for Energy management in 1.5 (project-chip#37902)
* Basic energy-gateway-app framework for Linux and ESP32 - linking issue due to device type problems bringing in expected clusters. * Initial attempt to add new clusters based of PR 10815 - ZAP is raising error 'Unable to find cluster extension by component' * Added missing xml files to zcl.json. Added regen of global-structs.xml and global-enums.xml (NOTE: ApparentPowerThresholds SHOULD be power_mva! but Zap does not recognise this yet. * Temporary change of "money" to int64s whilst waiting for a ZAP change. * Added Meter Identification cluster XML * Updated tests.yaml and rules.matterlint to include new clusters * .matter file updates caused by new enums * Updated files after zap_regen_all * New files after zap_regen_all * Add support for money and new electrical data types * Added new attributes for structs to attributeAccessInterfaceAttributes. Removed legacy measurement-and-sensing.xml in favour of new global-structs/global-enums.xml * Updated .matter files after subsequent regen_all * code autogen after moving to global structs/enums and updating structs in attributes- regen_all * Backed out change to support SetVidVerificationStatement etc * Enabled Commodity Price in data_model/contoller-clusters.zap. Added stub basic-type Currency. Disabled Ember in config-data.yaml. Linux now builds but aborts at start-up. * Update chip-types.xml with new energy types and money * Changed to use correct global struct CurrencyStruct * Revert changes to generated attribute-type.h file * regen_all after merging in Hasty's new types PR: project-chip#37980 * Further zap_regen_all updates after picking up fix from Hasty#s project-chip#37980 * Revert reversion of generated attribute-type.h * Fix build issue due to moving MeasurementAccuracyStruct to global-structs. * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Update attribute-type.h * Fix EEM/EPM clusters which use new global MeasurementAccuracyRangeStruct and MeasurementTypeEnum * Restyled by clang-format * Generated XML files from Alchemy for new clusters and refreshed older EM clusters with latest Alchemy. * Added missing zap_cluster_list.json * Added missing CurrencyStruct * zap_regen_all * Fix-up EEM/EPM and apps that use them because the Structs and Enums have moved to Globals:: namespace * Fix CI issue - Re-did bootstrap to pick up new ZAP, and regen_all. Updated ChipStructs.java which was different in CI * Reverted back to using existing measurement-and-sensing-.xml to avoid API backwards compatibility change. * Regen_all to revert all .matter files back to remove global MeasurementType enum * Another regen_all * Manually added missing description to the clusters to hopefully fix the IDL parsing errors. * Regen_all to include description tag from XML. * Updated ChipStructs.java after previous regen_all * Revert bad merge * Reverted removal of measurement and sensing xml * regen_all * Moved MatterCommodityPricePluginServerInitCallback() to util.cpp to resolve linker error * Reverted ElectricalPowermeasurementDelegate use of global struct * Bump zap to 2025.3.25 * Partial regen-all to update .matter files (zap-regen-all still crashes!) * Support non-nightly versions * Another update for logic * Fix bad update * Update one more extra extension * Reverted some of the xml files that were updated by alchemy and not really needed in this pr * Reverted EEM/EPM xml files * Zap regen all finally fixed with increased timeout * Merge of .github/workflows/tests.yaml had screwed up * Fixed Linux crash on startup by adding an empty cmd handler function for now and calling ChipLinuxAppInit() * Revert "Merge remote-tracking branch 'andrei/zap_update' into energy-gateway-app" This reverts commit 0cc1dea, reversing changes made to 2fd6786. * Syncd back to Master after reverting Andrei's zap changes * Per review comment - changed copyright to only 2025 * Updated more copyright to 2025 * Update copyright commodity-price-server.cpp --------- Co-authored-by: Hasty Granbery <[email protected]> Co-authored-by: Hasty Granbery <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
1 parent 8547d44 commit c7d1a48

38 files changed

+6873
-14
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2025 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/chip.gni")
16+
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
17+
import("${chip_root}/src/app/chip_data_model.gni")
18+
19+
config("config") {
20+
include_dirs = [ "include" ]
21+
}
22+
23+
chip_data_model("energy-gateway-common") {
24+
zap_file = "energy-gateway-app.zap"
25+
is_server = true
26+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
*
3+
* Copyright (c) 2025 Project CHIP Authors
4+
* All rights reserved.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#pragma once
20+
21+
void ElectricalPriceApplicationInit();
22+
void ElectricalPriceApplicationShutdown();
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
*
3+
* Copyright (c) 2025 Project CHIP Authors
4+
* All rights reserved.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#include "EnergyGatewayAppCommonMain.h"
20+
21+
#include <app-common/zap-generated/ids/Attributes.h>
22+
#include <app-common/zap-generated/ids/Clusters.h>
23+
#include <app/data-model/Nullable.h>
24+
#include <lib/support/CodeUtils.h>
25+
26+
using namespace chip;
27+
using namespace chip::app;
28+
using namespace chip::app::DataModel;
29+
using namespace chip::app::Clusters;
30+
31+
/*
32+
* @brief Creates a Delegate and Instance for CommodityPrice clusters
33+
*
34+
* The Instance is a container around the Delegate, so
35+
* create the Delegate first, then wrap it in the Instance
36+
* Then call the Instance->Init() to register the attribute and command handlers
37+
*/
38+
void ElectricalPriceApplicationInit() {}
39+
40+
void ElectricalPriceApplicationShutdown()
41+
{
42+
ChipLogDetail(AppServer, "Energy Gateway App : ElectricalPriceApplicationShutdown()");
43+
}

0 commit comments

Comments
 (0)