Skip to content

Commit

Permalink
Align naming in Power Source cluster with the spec. (#24240)
Browse files Browse the repository at this point in the history
* Align naming in Power Source cluster with the spec.

And enable the Power Source events, which were commented out.

* Regenerate generated files.
  • Loading branch information
bzbarsky-apple authored Jan 4, 2023
1 parent e3a3aaa commit 4e63e88
Show file tree
Hide file tree
Showing 25 changed files with 1,126 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,21 @@ server cluster PowerSource = 47 {
kReplaceable = 0x8;
}

info event WiredFaultChange = 0 {
WiredFault current[] = 0;
WiredFault previous[] = 1;
}

info event BatFaultChange = 1 {
BatFault current[] = 0;
BatFault previous[] = 1;
}

info event BatChargeFaultChange = 2 {
BatChargeFault current[] = 0;
BatChargeFault previous[] = 1;
}

readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,21 @@ server cluster PowerSource = 47 {
kReplaceable = 0x8;
}

info event WiredFaultChange = 0 {
WiredFault current[] = 0;
WiredFault previous[] = 1;
}

info event BatFaultChange = 1 {
BatFault current[] = 0;
BatFault previous[] = 1;
}

info event BatChargeFaultChange = 2 {
BatChargeFault current[] = 0;
BatChargeFault previous[] = 1;
}

readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
Expand Down
15 changes: 15 additions & 0 deletions examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,21 @@ server cluster PowerSource = 47 {
kReplaceable = 0x8;
}

info event WiredFaultChange = 0 {
WiredFault current[] = 0;
WiredFault previous[] = 1;
}

info event BatFaultChange = 1 {
BatFault current[] = 0;
BatFault previous[] = 1;
}

info event BatChargeFaultChange = 2 {
BatChargeFault current[] = 0;
BatChargeFault previous[] = 1;
}

readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
Expand Down
15 changes: 15 additions & 0 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,21 @@ server cluster PowerSource = 47 {
kReplaceable = 0x8;
}

info event WiredFaultChange = 0 {
WiredFault current[] = 0;
WiredFault previous[] = 1;
}

info event BatFaultChange = 1 {
BatFault current[] = 0;
BatFault previous[] = 1;
}

info event BatChargeFaultChange = 2 {
BatChargeFault current[] = 0;
BatChargeFault previous[] = 1;
}

readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
Expand Down
15 changes: 15 additions & 0 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,21 @@ server cluster PowerSource = 47 {
kReplaceable = 0x8;
}

info event WiredFaultChange = 0 {
WiredFault current[] = 0;
WiredFault previous[] = 1;
}

info event BatFaultChange = 1 {
BatFault current[] = 0;
BatFault previous[] = 1;
}

info event BatChargeFaultChange = 2 {
BatChargeFault current[] = 0;
BatChargeFault previous[] = 1;
}

readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
Expand Down
15 changes: 15 additions & 0 deletions examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,21 @@ server cluster PowerSource = 47 {
kReplaceable = 0x8;
}

info event WiredFaultChange = 0 {
WiredFault current[] = 0;
WiredFault previous[] = 1;
}

info event BatFaultChange = 1 {
BatFault current[] = 0;
BatFault previous[] = 1;
}

info event BatChargeFaultChange = 2 {
BatChargeFault current[] = 0;
BatChargeFault previous[] = 1;
}

readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
Expand Down
23 changes: 13 additions & 10 deletions src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,23 @@ limitations under the License.
<attribute side="server" code="0x001D" define="POWER_SOURCE_BAT_CHARGING_CURRENT" type="INT32U" min="0x00000000" max="0xFFFFFFFF" writable="false" optional="true" isNullable="true">BatChargingCurrent</attribute>
<attribute side="server" code="0x001E" define="POWER_SOURCE_ACTIVE_BAT_CHARGE_FAULTS" type="ARRAY" entryType="BatChargeFault" length="16" writable="false" optional="true">ActiveBatChargeFaults</attribute>

<!-- TODO: Do events work?
<event code="0x0000" name="WiredFaultChange" priority="info" side="server">
<event code="0x0000" name="WiredFaultChange" priority="info" side="server" optional="true">
<description>The WiredFaultChange Event SHALL indicate a change in the set of wired faults currently detected by the Node on this wired power source.</description>
<field id="1" name="WiredFaultChangeType" type="WiredFaultChangeType"/>
<field id="0" name="Current" type="WiredFault" array="true" length="8"/>
<field id="1" name="Previous" type="WiredFault" array="true" length="8"/>
</event>

<event code="0x0001" name="BatFaultChange" priority="info" side="server">
<event code="0x0001" name="BatFaultChange" priority="info" side="server" optional="true">
<description>The BatFaultChange Event SHALL indicate a change in the set of battery faults currently detected by the Node on this battery power source.</description>
<field id="1" name="BatFaultChangeType" type="BatFaultChangeType"/>
<field id="0" name="Current" type="BatFault" array="true" length="8"/>
<field id="1" name="Previous" type="BatFault" array="true" length="8"/>
</event>

<event code="0x0002" name="BatChargeFaultChange" priority="info" side="server">
<event code="0x0002" name="BatChargeFaultChange" priority="info" side="server" optional="true">
<description>The BatChargeFaultChange Event SHALL indicate a change in the set of charge faults currently detected by the Node on this battery power source.</description>
<field id="1" name="BatChargeFaultChangeType" type="BatChargeFaultChangeType"/>
<field id="0" name="Current" type="BatChargeFault" array="true" length="16"/>
<field id="1" name="Previous" type="BatChargeFault" array="true" length="16"/>
</event>
-->

</cluster>

Expand Down Expand Up @@ -131,7 +132,7 @@ limitations under the License.

<enum name="BatChargeLevel" type="ENUM8">
<cluster code="0x002F"/>
<item name="Ok" value="0x00"/>
<item name="OK" value="0x00"/>
<item name="Warning" value="0x01"/>
<item name="Critical" value="0x02"/>
</enum>
Expand All @@ -152,6 +153,8 @@ limitations under the License.
<item name="IsNotCharging" value="0x03"/>
</enum>

<!-- TODO: These structs *ChangeType structs should just be removed, after a
brief deprecation period. -->
<struct name="WiredFaultChangeType">
<cluster code="0x002F"/>
<item name="current" type="WiredFault" array="true" length="8"/>
Expand All @@ -170,4 +173,4 @@ limitations under the License.
<item name="previous" type="BatChargeFault" array="true" length="16"/>
</struct>

</configurator>
</configurator>
15 changes: 15 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,21 @@ client cluster PowerSource = 47 {
kReplaceable = 0x8;
}

info event WiredFaultChange = 0 {
WiredFault current[] = 0;
WiredFault previous[] = 1;
}

info event BatFaultChange = 1 {
BatFault current[] = 0;
BatFault previous[] = 1;
}

info event BatChargeFaultChange = 2 {
BatChargeFault current[] = 0;
BatChargeFault previous[] = 1;
}

readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
Expand Down
173 changes: 173 additions & 0 deletions src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e63e88

Please sign in to comment.