Skip to content

Commit

Permalink
Align Ballast Configuration XML to spec. (#29678)
Browse files Browse the repository at this point in the history
* Align Ballast Configuration XML to spec.

Fixes #29669

* Auto-update ZAP files that involve Ballast Configuration.

* Regenerate generated code.
  • Loading branch information
bzbarsky-apple authored and hnnajh committed Nov 6, 2023
1 parent 52b84ad commit 3546344
Show file tree
Hide file tree
Showing 20 changed files with 243 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4533,9 +4533,18 @@ server cluster ColorControl = 768 {

/** Attributes and commands for configuring a lighting ballast. */
server cluster BallastConfiguration = 769 {
bitmap BallastStatusBitmap : BITMAP8 {
kBallastNonOperational = 0x1;
kLampFailure = 0x2;
}

bitmap LampAlarmModeBitmap : BITMAP8 {
kLampBurnHours = 0x1;
}

readonly attribute int8u physicalMinLevel = 0;
readonly attribute int8u physicalMaxLevel = 1;
readonly attribute bitmap8 ballastStatus = 2;
readonly attribute BallastStatusBitmap ballastStatus = 2;
attribute int8u minLevel = 16;
attribute int8u maxLevel = 17;
attribute nullable int8u intrinsicBallastFactor = 20;
Expand All @@ -4545,7 +4554,7 @@ server cluster BallastConfiguration = 769 {
attribute char_string<16> lampManufacturer = 49;
attribute nullable int24u lampRatedHours = 50;
attribute nullable int24u lampBurnHours = 51;
attribute bitmap8 lampAlarmMode = 52;
attribute LampAlarmModeBitmap lampAlarmMode = 52;
attribute nullable int24u lampBurnHoursTripPoint = 53;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15098,7 +15098,7 @@
"code": 2,
"mfgCode": null,
"side": "server",
"type": "bitmap8",
"type": "BallastStatusBitmap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -15258,7 +15258,7 @@
"code": 52,
"mfgCode": null,
"side": "server",
"type": "bitmap8",
"type": "LampAlarmModeBitmap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2979,6 +2979,15 @@ server cluster ColorControl = 768 {

/** Attributes and commands for configuring a lighting ballast. */
server cluster BallastConfiguration = 769 {
bitmap BallastStatusBitmap : BITMAP8 {
kBallastNonOperational = 0x1;
kLampFailure = 0x2;
}

bitmap LampAlarmModeBitmap : BITMAP8 {
kLampBurnHours = 0x1;
}

readonly attribute int8u physicalMinLevel = 0;
readonly attribute int8u physicalMaxLevel = 1;
attribute int8u minLevel = 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ limitations under the License.
<configurator>
<domain name="Lighting"/>

<bitmap name="BallastStatusBitmap" type="bitmap8">
<cluster code="0x0301"/>
<field name="BallastNonOperational" mask="0x01"/>
<field name="LampFailure" mask="0x02"/>
</bitmap>

<bitmap name="LampAlarmModeBitmap" type="bitmap8">
<cluster code="0x0301"/>
<field name="LampBurnHours" mask="0x01"/>
</bitmap>

<cluster>
<name>Ballast Configuration</name>
<domain>Lighting</domain>
Expand All @@ -32,7 +43,7 @@ limitations under the License.
<!-- Ballast Configuration Attribute Set -->
<attribute side="server" code="0x0000" define="PHYSICAL_MIN_LEVEL" type="INT8U" min="0x01" max="0xFE" writable="false" default="0x01" optional="false">PhysicalMinLevel</attribute>
<attribute side="server" code="0x0001" define="PHYSICAL_MAX_LEVEL" type="INT8U" min="0x01" max="0xFE" writable="false" default="0xFE" optional="false">PhysicalMaxLevel</attribute>
<attribute side="server" code="0x0002" define="BALLAST_STATUS" type="BITMAP8" min="0x00" max="0x03" writable="false" default="0x00" optional="true">BallastStatus</attribute>
<attribute side="server" code="0x0002" define="BALLAST_STATUS" type="BallastStatusBitmap" min="0x00" max="0x03" writable="false" default="0x00" optional="true">BallastStatus</attribute>
<!-- Ballast Settings Attribute Set -->
<attribute side="server" code="0x0010" define="MIN_LEVEL" type="INT8U" min="0x01" max="0xFE" writable="true" default="0x01" optional="false">MinLevel</attribute>
<attribute side="server" code="0x0011" define="MAX_LEVEL" type="INT8U" min="0x01" max="0xFE" writable="true" default="0xFE" optional="false">MaxLevel</attribute>
Expand All @@ -46,7 +57,7 @@ limitations under the License.
<attribute side="server" code="0x0031" define="LAMP_MANUFACTURER" type="CHAR_STRING" length="16" writable="true" optional="true">LampManufacturer</attribute>
<attribute side="server" code="0x0032" define="LAMP_RATED_HOURS" type="INT24U" writable="true" default="0xFFFFFF" isNullable="true" optional="true">LampRatedHours</attribute>
<attribute side="server" code="0x0033" define="LAMP_BURN_HOURS" type="INT24U" writable="true" default="0x000000" isNullable="true" optional="true">LampBurnHours</attribute>
<attribute side="server" code="0x0034" define="LAMP_ALARM_MODE" type="BITMAP8" min="0x00" max="0x01" writable="true" default="0x00" optional="true">LampAlarmMode</attribute>
<attribute side="server" code="0x0034" define="LAMP_ALARM_MODE" type="LampAlarmModeBitmap" min="0x00" max="0x01" writable="true" default="0x00" optional="true">LampAlarmMode</attribute>
<attribute side="server" code="0x0035" define="LAMP_BURN_HOURS_TRIP_POINT" type="INT24U" writable="true" default="0xFFFFFF" isNullable="true" optional="true">LampBurnHoursTripPoint</attribute>
</cluster>
</configurator>
13 changes: 11 additions & 2 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5042,9 +5042,18 @@ client cluster ColorControl = 768 {

/** Attributes and commands for configuring a lighting ballast. */
client cluster BallastConfiguration = 769 {
bitmap BallastStatusBitmap : BITMAP8 {
kBallastNonOperational = 0x1;
kLampFailure = 0x2;
}

bitmap LampAlarmModeBitmap : BITMAP8 {
kLampBurnHours = 0x1;
}

readonly attribute int8u physicalMinLevel = 0;
readonly attribute int8u physicalMaxLevel = 1;
readonly attribute optional bitmap8 ballastStatus = 2;
readonly attribute optional BallastStatusBitmap ballastStatus = 2;
attribute int8u minLevel = 16;
attribute int8u maxLevel = 17;
attribute optional nullable int8u intrinsicBallastFactor = 20;
Expand All @@ -5054,7 +5063,7 @@ client cluster BallastConfiguration = 769 {
attribute optional char_string<16> lampManufacturer = 49;
attribute optional nullable int24u lampRatedHours = 50;
attribute optional nullable int24u lampBurnHours = 51;
attribute optional bitmap8 lampAlarmMode = 52;
attribute optional LampAlarmModeBitmap lampAlarmMode = 52;
attribute optional nullable int24u lampBurnHoursTripPoint = 53;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down

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

4 changes: 2 additions & 2 deletions src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp

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

8 changes: 8 additions & 0 deletions src/controller/python/chip/clusters/Objects.py

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

4 changes: 4 additions & 0 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7633,6 +7633,10 @@
BarrierControl:
- BarrierControlCapabilities
- BarrierControlSafetyStatus
BallastConfiguration:
# The BallastConfiguration cluster is provisional for now, but not marked that way.
- BallastStatusBitmap
- LampAlarmModeBitmap
attributes:
GeneralDiagnostics:
# Not in the spec yet.
Expand Down

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

9 changes: 9 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

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

18 changes: 9 additions & 9 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm

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

Loading

0 comments on commit 3546344

Please sign in to comment.