Skip to content

Commit

Permalink
[XML] Correct the PCC cluster xml to reflect the specification (#17181)
Browse files Browse the repository at this point in the history
* Correct the PCC cluster xml to reflect the specification

* * Updated with small corrections to min/max

* * Added special RW VM access priviledges to LifetimerunningHours and LifetimeEnergyConsumed

* * Added ClusterRevision to be '3'

* * Added the RW VM for the OperationMode and ControlMode attributes as well

* * Changed back to hexadecimal notation for min/max

* * Re-ran the zap_regen_all.py script

* Restyled by clang-format

* * Set the LifetimeRunningHours and LifetimeEnergyConsumed to Nullable

* Restyled by clang-format

* Restyled by clang-format

* Fix error in PCC server implementation: use correct attribute types

* Changed back to ENUM8 as type in XML files for PCC

* Restyled by clang-format

* * Re-inserted the PumpOperationMode and PumpControlMode as valid types in the PCC XML
* Re-generate zap with zap_regen_all.py

* * Corrected missing use of PumpOperationMode and PumpControlMonde i PCC cluster server

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jul 26, 2023
1 parent 348f021 commit 91836fe
Show file tree
Hide file tree
Showing 34 changed files with 3,881 additions and 1,218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2686,29 +2686,29 @@ server cluster PumpConfigurationAndControl = 512 {
info event TurbineOperation = 16 {
}

readonly attribute int16s maxPressure = 0;
readonly attribute int16u maxSpeed = 1;
readonly attribute int16u maxFlow = 2;
readonly attribute int16s minConstPressure = 3;
readonly attribute int16s maxConstPressure = 4;
readonly attribute int16s minCompPressure = 5;
readonly attribute int16s maxCompPressure = 6;
readonly attribute int16u minConstSpeed = 7;
readonly attribute int16u maxConstSpeed = 8;
readonly attribute int16u minConstFlow = 9;
readonly attribute int16u maxConstFlow = 10;
readonly attribute int16s minConstTemp = 11;
readonly attribute int16s maxConstTemp = 12;
readonly attribute nullable int16s maxPressure = 0;
readonly attribute nullable int16u maxSpeed = 1;
readonly attribute nullable int16u maxFlow = 2;
readonly attribute nullable int16s minConstPressure = 3;
readonly attribute nullable int16s maxConstPressure = 4;
readonly attribute nullable int16s minCompPressure = 5;
readonly attribute nullable int16s maxCompPressure = 6;
readonly attribute nullable int16u minConstSpeed = 7;
readonly attribute nullable int16u maxConstSpeed = 8;
readonly attribute nullable int16u minConstFlow = 9;
readonly attribute nullable int16u maxConstFlow = 10;
readonly attribute nullable int16s minConstTemp = 11;
readonly attribute nullable int16s maxConstTemp = 12;
readonly attribute bitmap16 pumpStatus = 16;
readonly attribute enum8 effectiveOperationMode = 17;
readonly attribute enum8 effectiveControlMode = 18;
readonly attribute int16s capacity = 19;
readonly attribute int16u speed = 20;
attribute nullable int24u lifetimeRunningHours = 21;
readonly attribute int24u power = 22;
attribute nullable int32u lifetimeEnergyConsumed = 23;
attribute enum8 operationMode = 32;
attribute enum8 controlMode = 33;
readonly attribute PumpOperationMode effectiveOperationMode = 17;
readonly attribute PumpControlMode effectiveControlMode = 18;
readonly attribute nullable int16s capacity = 19;
readonly attribute nullable int16u speed = 20;
attribute access(write: manage) nullable int24u lifetimeRunningHours = 21;
readonly attribute nullable int24u power = 22;
attribute access(write: manage) nullable int32u lifetimeEnergyConsumed = 23;
attribute access(write: manage) PumpOperationMode operationMode = 32;
attribute access(write: manage) PumpControlMode controlMode = 33;
readonly attribute bitmap16 alarmMask = 34;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
44 changes: 22 additions & 22 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1888,29 +1888,29 @@ server cluster PumpConfigurationAndControl = 512 {
info event TurbineOperation = 16 {
}

readonly attribute int16s maxPressure = 0;
readonly attribute int16u maxSpeed = 1;
readonly attribute int16u maxFlow = 2;
readonly attribute int16s minConstPressure = 3;
readonly attribute int16s maxConstPressure = 4;
readonly attribute int16s minCompPressure = 5;
readonly attribute int16s maxCompPressure = 6;
readonly attribute int16u minConstSpeed = 7;
readonly attribute int16u maxConstSpeed = 8;
readonly attribute int16u minConstFlow = 9;
readonly attribute int16u maxConstFlow = 10;
readonly attribute int16s minConstTemp = 11;
readonly attribute int16s maxConstTemp = 12;
readonly attribute nullable int16s maxPressure = 0;
readonly attribute nullable int16u maxSpeed = 1;
readonly attribute nullable int16u maxFlow = 2;
readonly attribute nullable int16s minConstPressure = 3;
readonly attribute nullable int16s maxConstPressure = 4;
readonly attribute nullable int16s minCompPressure = 5;
readonly attribute nullable int16s maxCompPressure = 6;
readonly attribute nullable int16u minConstSpeed = 7;
readonly attribute nullable int16u maxConstSpeed = 8;
readonly attribute nullable int16u minConstFlow = 9;
readonly attribute nullable int16u maxConstFlow = 10;
readonly attribute nullable int16s minConstTemp = 11;
readonly attribute nullable int16s maxConstTemp = 12;
readonly attribute bitmap16 pumpStatus = 16;
readonly attribute enum8 effectiveOperationMode = 17;
readonly attribute enum8 effectiveControlMode = 18;
readonly attribute int16s capacity = 19;
readonly attribute int16u speed = 20;
attribute nullable int24u lifetimeRunningHours = 21;
readonly attribute int24u power = 22;
attribute nullable int32u lifetimeEnergyConsumed = 23;
attribute enum8 operationMode = 32;
attribute enum8 controlMode = 33;
readonly attribute PumpOperationMode effectiveOperationMode = 17;
readonly attribute PumpControlMode effectiveControlMode = 18;
readonly attribute nullable int16s capacity = 19;
readonly attribute nullable int16u speed = 20;
attribute access(write: manage) nullable int24u lifetimeRunningHours = 21;
readonly attribute nullable int24u power = 22;
attribute access(write: manage) nullable int32u lifetimeEnergyConsumed = 23;
attribute access(write: manage) PumpOperationMode operationMode = 32;
attribute access(write: manage) PumpControlMode controlMode = 33;
readonly attribute bitmap16 alarmMask = 34;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
44 changes: 22 additions & 22 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1888,29 +1888,29 @@ server cluster PumpConfigurationAndControl = 512 {
info event TurbineOperation = 16 {
}

readonly attribute int16s maxPressure = 0;
readonly attribute int16u maxSpeed = 1;
readonly attribute int16u maxFlow = 2;
readonly attribute int16s minConstPressure = 3;
readonly attribute int16s maxConstPressure = 4;
readonly attribute int16s minCompPressure = 5;
readonly attribute int16s maxCompPressure = 6;
readonly attribute int16u minConstSpeed = 7;
readonly attribute int16u maxConstSpeed = 8;
readonly attribute int16u minConstFlow = 9;
readonly attribute int16u maxConstFlow = 10;
readonly attribute int16s minConstTemp = 11;
readonly attribute int16s maxConstTemp = 12;
readonly attribute nullable int16s maxPressure = 0;
readonly attribute nullable int16u maxSpeed = 1;
readonly attribute nullable int16u maxFlow = 2;
readonly attribute nullable int16s minConstPressure = 3;
readonly attribute nullable int16s maxConstPressure = 4;
readonly attribute nullable int16s minCompPressure = 5;
readonly attribute nullable int16s maxCompPressure = 6;
readonly attribute nullable int16u minConstSpeed = 7;
readonly attribute nullable int16u maxConstSpeed = 8;
readonly attribute nullable int16u minConstFlow = 9;
readonly attribute nullable int16u maxConstFlow = 10;
readonly attribute nullable int16s minConstTemp = 11;
readonly attribute nullable int16s maxConstTemp = 12;
readonly attribute bitmap16 pumpStatus = 16;
readonly attribute enum8 effectiveOperationMode = 17;
readonly attribute enum8 effectiveControlMode = 18;
readonly attribute int16s capacity = 19;
readonly attribute int16u speed = 20;
attribute nullable int24u lifetimeRunningHours = 21;
readonly attribute int24u power = 22;
attribute nullable int32u lifetimeEnergyConsumed = 23;
attribute enum8 operationMode = 32;
attribute enum8 controlMode = 33;
readonly attribute PumpOperationMode effectiveOperationMode = 17;
readonly attribute PumpControlMode effectiveControlMode = 18;
readonly attribute nullable int16s capacity = 19;
readonly attribute nullable int16u speed = 20;
attribute access(write: manage) nullable int24u lifetimeRunningHours = 21;
readonly attribute nullable int24u power = 22;
attribute access(write: manage) nullable int32u lifetimeEnergyConsumed = 23;
attribute access(write: manage) PumpOperationMode operationMode = 32;
attribute access(write: manage) PumpControlMode controlMode = 33;
readonly attribute bitmap16 alarmMask = 34;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
44 changes: 22 additions & 22 deletions examples/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1189,29 +1189,29 @@ server cluster PumpConfigurationAndControl = 512 {
info event TurbineOperation = 16 {
}

readonly attribute int16s maxPressure = 0;
readonly attribute int16u maxSpeed = 1;
readonly attribute int16u maxFlow = 2;
readonly attribute int16s minConstPressure = 3;
readonly attribute int16s maxConstPressure = 4;
readonly attribute int16s minCompPressure = 5;
readonly attribute int16s maxCompPressure = 6;
readonly attribute int16u minConstSpeed = 7;
readonly attribute int16u maxConstSpeed = 8;
readonly attribute int16u minConstFlow = 9;
readonly attribute int16u maxConstFlow = 10;
readonly attribute int16s minConstTemp = 11;
readonly attribute int16s maxConstTemp = 12;
readonly attribute nullable int16s maxPressure = 0;
readonly attribute nullable int16u maxSpeed = 1;
readonly attribute nullable int16u maxFlow = 2;
readonly attribute nullable int16s minConstPressure = 3;
readonly attribute nullable int16s maxConstPressure = 4;
readonly attribute nullable int16s minCompPressure = 5;
readonly attribute nullable int16s maxCompPressure = 6;
readonly attribute nullable int16u minConstSpeed = 7;
readonly attribute nullable int16u maxConstSpeed = 8;
readonly attribute nullable int16u minConstFlow = 9;
readonly attribute nullable int16u maxConstFlow = 10;
readonly attribute nullable int16s minConstTemp = 11;
readonly attribute nullable int16s maxConstTemp = 12;
readonly attribute bitmap16 pumpStatus = 16;
readonly attribute enum8 effectiveOperationMode = 17;
readonly attribute enum8 effectiveControlMode = 18;
readonly attribute int16s capacity = 19;
readonly attribute int16u speed = 20;
attribute nullable int24u lifetimeRunningHours = 21;
readonly attribute int24u power = 22;
attribute nullable int32u lifetimeEnergyConsumed = 23;
attribute enum8 operationMode = 32;
attribute enum8 controlMode = 33;
readonly attribute PumpOperationMode effectiveOperationMode = 17;
readonly attribute PumpControlMode effectiveControlMode = 18;
readonly attribute nullable int16s capacity = 19;
readonly attribute nullable int16u speed = 20;
attribute access(write: manage) nullable int24u lifetimeRunningHours = 21;
readonly attribute nullable int24u power = 22;
attribute access(write: manage) nullable int32u lifetimeEnergyConsumed = 23;
attribute access(write: manage) PumpOperationMode operationMode = 32;
attribute access(write: manage) PumpControlMode controlMode = 33;
readonly attribute bitmap16 alarmMask = 34;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1050,13 +1050,13 @@ client cluster PumpConfigurationAndControl = 512 {
info event TurbineOperation = 16 {
}

readonly attribute int16s maxPressure = 0;
readonly attribute int16u maxSpeed = 1;
readonly attribute int16u maxFlow = 2;
readonly attribute enum8 effectiveOperationMode = 17;
readonly attribute enum8 effectiveControlMode = 18;
readonly attribute int16s capacity = 19;
attribute enum8 operationMode = 32;
readonly attribute nullable int16s maxPressure = 0;
readonly attribute nullable int16u maxSpeed = 1;
readonly attribute nullable int16u maxFlow = 2;
readonly attribute PumpOperationMode effectiveOperationMode = 17;
readonly attribute PumpControlMode effectiveControlMode = 18;
readonly attribute nullable int16s capacity = 19;
attribute access(write: manage) PumpOperationMode operationMode = 32;
readonly attribute int16u clusterRevision = 65533;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <app/util/attribute-storage.h>

using namespace chip;
using namespace chip::app::Clusters::PumpConfigurationAndControl;
using namespace chip::app::Clusters::PumpConfigurationAndControl::Attributes;

void emberAfPumpConfigurationAndControlClusterServerInitCallback(EndpointId endpoint)
Expand All @@ -40,15 +41,15 @@ void MatterPumpConfigurationAndControlClusterServerAttributeChangedCallback(cons
switch (attributePath.mAttributeId)
{
case ControlMode::Id: {
uint8_t value;
ControlMode::Get(attributePath.mEndpointId, &value);
EffectiveControlMode::Set(attributePath.mEndpointId, value);
PumpControlMode controlMode;
ControlMode::Get(attributePath.mEndpointId, &controlMode);
EffectiveControlMode::Set(attributePath.mEndpointId, controlMode);
}
break;
case OperationMode::Id: {
uint8_t value;
OperationMode::Get(attributePath.mEndpointId, &value);
EffectiveOperationMode::Set(attributePath.mEndpointId, value);
PumpOperationMode operationMode;
OperationMode::Get(attributePath.mEndpointId, &operationMode);
EffectiveOperationMode::Set(attributePath.mEndpointId, operationMode);
}
break;
default:
Expand Down
Loading

0 comments on commit 91836fe

Please sign in to comment.