Skip to content

Commit

Permalink
Add DEM_M and EVSE_M cluster XML (#31506)
Browse files Browse the repository at this point in the history
* Committing the necessary changes before regen_all.py

* Updated mode base to include cluster references so that zap_regen_all now works.

* Added autogen code

* Added new files created as part autogen. Also added missing data_model/clusters/Mode_DeviceEnergyManagement.xml

* Fixed misspell

* Added to python __init__.py

* Restyled by isort

* Updates to map into spec PR #8763

* Updated autogen for DEM Modes to include no optimization etc.

* Updated data model for EEVSEM

* Disabled ember for generating command hooks

* Finally working

* Restyled by gn

* Updated zap files after merge to master.

* Added support into Example EnergyManagementApp

* Restyled by gn

* Resolving merge conflict

* Updated copyright to 2024

* Converted to using std::unique_ptr instead of new/delete

* Made modes constexpr per review comment

* Added Shutdown() to free Mode clusters and avoid VerifyOrDie failure at src/lib/support/IntrusiveList.h:290: Empty()

* Copyright update

* Copyright update

Co-authored-by: Nivi Sarkar <[email protected]>

---------

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Nivi Sarkar <[email protected]>
  • Loading branch information
3 people authored Jan 19, 2024
1 parent ace7a86 commit e09d5c8
Show file tree
Hide file tree
Showing 85 changed files with 15,959 additions and 44 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,15 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/fault-injection-cluster.xml \
Expand Down
64 changes: 64 additions & 0 deletions data_model/clusters/Mode_DeviceEnergyManagement.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0"?>
<!--
Copyright (C) Connectivity Standards Alliance (2024). All rights reserved.
The information within this document is the property of the Connectivity
Standards Alliance and its use and disclosure are restricted, except as
expressly set forth herein.
Connectivity Standards Alliance hereby grants you a fully-paid, non-exclusive,
nontransferable, worldwide, limited and revocable license (without the right to
sublicense), under Connectivity Standards Alliance's applicable copyright
rights, to view, download, save, reproduce and use the document solely for your
own internal purposes and in accordance with the terms of the license set forth
herein. This license does not authorize you to, and you expressly warrant that
you shall not: (a) permit others (outside your organization) to use this
document; (b) post or publish this document; (c) modify, adapt, translate, or
otherwise change this document in any manner or create any derivative work
based on this document; (d) remove or modify any notice or label on this
document, including this Copyright Notice, License and Disclaimer. The
Connectivity Standards Alliance does not grant you any license hereunder other
than as expressly stated herein.
Elements of this document may be subject to third party intellectual property
rights, including without limitation, patent, copyright or trademark rights,
and any such third party may or may not be a member of the Connectivity
Standards Alliance. Connectivity Standards Alliance members grant other
Connectivity Standards Alliance members certain intellectual property rights as
set forth in the Connectivity Standards Alliance IPR Policy. Connectivity
Standards Alliance members do not grant you any rights under this license. The
Connectivity Standards Alliance is not responsible for, and shall not be held
responsible in any manner for, identifying or failing to identify any or all
such third party intellectual property rights. Please visit www.csa-iot.org for
more information on how to become a member of the Connectivity Standards
Alliance.
This document and the information contained herein are provided on an “AS IS”
basis and the Connectivity Standards Alliance DISCLAIMS ALL WARRANTIES EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO (A) ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OF THIRD PARTIES (INCLUDING
WITHOUT LIMITATION ANY INTELLECTUAL PROPERTY RIGHTS INCLUDING PATENT, COPYRIGHT
OR TRADEMARK RIGHTS); OR (B) ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, TITLE OR NONINFRINGEMENT. IN NO EVENT WILL THE
CONNECTIVITY STANDARDS ALLIANCE BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF
BUSINESS, LOSS OF USE OF DATA, INTERRUPTION OF BUSINESS, OR FOR ANY OTHER
DIRECT, INDIRECT, SPECIAL OR EXEMPLARY, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
DAMAGES OF ANY KIND, IN CONTRACT OR IN TORT, IN CONNECTION WITH THIS DOCUMENT
OR THE INFORMATION CONTAINED HEREIN, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
LOSS OR DAMAGE.
All company, brand and product names in this document may be trademarks that
are the sole property of their respective owners.
This notice and disclaimer must be included on all copies of this document.
Connectivity Standards Alliance
508 Second Street, Suite 206
Davis, CA 95616, USA
-->
<cluster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="types types.xsd cluster cluster.xsd" id="0x009F" name="Device Energy Management Mode" revision="1">
<revisionHistory>
<revision revision="1" summary="Initial Release"/>
</revisionHistory>
<classification hierarchy="derived" baseCluster="Mode Base" role="application" picsCode="DEMM" scope="Endpoint"/>
</cluster>
17 changes: 9 additions & 8 deletions data_model/clusters/Mode_EVSE.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<?xml version="1.0"?>
<!--
Copyright (C) Connectivity Standards Alliance (2023). All rights reserved.
Copyright (C) Connectivity Standards Alliance (2024). All rights reserved.
The information within this document is the property of the Connectivity
Standards Alliance and its use and disclosure are restricted, except as
expressly set forth herein.
Expand Down Expand Up @@ -54,10 +55,10 @@ This notice and disclaimer must be included on all copies of this document.
Connectivity Standards Alliance
508 Second Street, Suite 206
Davis, CA 95616, USA
-->
<cluster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="types types.xsd cluster cluster.xsd" id="" name="EVSE Mode" revision="1">
<revisionHistory>
<revision revision="1" summary="Initial Release"/>
</revisionHistory>
<classification hierarchy="derived" baseCluster="Mode Base" role="application" picsCode="EVSEM" scope="Endpoint"/>
-->
<cluster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="types types.xsd cluster cluster.xsd" id="0x009D" name="Energy EVSE Mode" revision="1">
<revisionHistory>
<revision revision="1" summary="Initial Release"/>
</revisionHistory>
<classification hierarchy="derived" baseCluster="Mode Base" role="application" picsCode="EEVSEM" scope="Endpoint"/>
</cluster>
2 changes: 2 additions & 0 deletions docs/clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ Generally regenerate using one of:
| 152 | 0x98 | DeviceEnergyManagement |
| 153 | 0x99 | EnergyEvse |
| 155 | 0x9B | EnergyPreference |
| 157 | 0x9D | EnergyEvseMode |
| 159 | 0x9F | DeviceEnergyManagementMode |
| 257 | 0x101 | DoorLock |
| 258 | 0x102 | WindowCovering |
| 259 | 0x103 | BarrierControl |
Expand Down
129 changes: 129 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4376,6 +4376,107 @@ provisional cluster EnergyEvse = 153 {
timed command ClearTargets(): DefaultSuccess = 7;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
provisional cluster EnergyEvseMode = 157 {
revision 1;

enum ModeTag : enum16 {
kManual = 16384;
kTimeOfUse = 16385;
kSolarCharging = 16386;
}

bitmap Feature : bitmap32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute optional nullable int8u startUpMode = 2;
attribute optional nullable int8u onMode = 3;
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;

request struct ChangeToModeRequest {
int8u newMode = 0;
}

response struct ChangeToModeResponse = 1 {
enum8 status = 0;
optional char_string<64> statusText = 1;
}

/** This command is used to change device modes.
On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */
command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
provisional cluster DeviceEnergyManagementMode = 159 {
revision 1;

enum ModeTag : enum16 {
kNoOptimization = 16384;
kDeviceOptimization = 16385;
kLocalOptimization = 16386;
kGridOptimization = 16387;
}

bitmap Feature : bitmap32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute optional nullable int8u startUpMode = 2;
attribute optional nullable int8u onMode = 3;
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;

request struct ChangeToModeRequest {
int8u newMode = 0;
}

response struct ChangeToModeResponse = 1 {
enum8 status = 0;
optional char_string<64> statusText = 1;
}

/** This command is used to change device modes.
On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */
command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** Provides an interface for controlling and adjusting automatic window coverings. */
cluster WindowCovering = 258 {
revision 5;
Expand Down Expand Up @@ -8105,6 +8206,34 @@ endpoint 1 {
handle command ClearTargets;
}

server cluster EnergyEvseMode {
callback attribute supportedModes;
callback attribute currentMode;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
ram attribute clusterRevision default = 1;

handle command ChangeToMode;
handle command ChangeToModeResponse;
}

server cluster DeviceEnergyManagementMode {
callback attribute supportedModes;
callback attribute currentMode;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
callback attribute featureMap;
ram attribute clusterRevision default = 1;

handle command ChangeToMode;
handle command ChangeToModeResponse;
}

server cluster WindowCovering {
ram attribute type default = 0x08;
ram attribute physicalClosedLimitLift default = 0xFFFF;
Expand Down
Loading

0 comments on commit e09d5c8

Please sign in to comment.