Skip to content

Commit

Permalink
Align naming in Time Synchronization Cluster XML with the spec. (#25037)
Browse files Browse the repository at this point in the history
* Align naming in Time Synchronization Cluster XML with the spec.

More spec changes happened in https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/6212

Fixes #25001

* Regenerate generated code.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Dec 8, 2023
1 parent d598b2b commit 2038802
Show file tree
Hide file tree
Showing 15 changed files with 194 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ limitations under the License.
<item name="Gnss" value="0x10"/>
</enum>

<struct name="TimeZoneType">
<struct name="TimeZoneStruct">
<cluster code="0x0038"/>
<item fieldId="0" name="Offset" type="INT32S"/>
<item fieldId="1" name="ValidAt" type="epoch_us"/>
<item fieldId="2" name="Name" type="CHAR_STRING" length="64" optional="true"/>
</struct>

<struct name="DstOffsetType">
<struct name="DSTOffsetStruct">
<cluster code="0x0038"/>
<item fieldId="0" name="Offset" type="INT32S"/>
<item fieldId="1" name="ValidStarting" type="epoch_us"/>
Expand Down Expand Up @@ -84,13 +84,13 @@ security materials.</description>
<access op="read" privilege="view"/>
<access op="write" privilege="administer"/>
</attribute>
<attribute side="server" code="0x0005" define="TIME_ZONE" type="ARRAY" entryType="TimeZoneType" min="1" max="2" writable="true" optional="true">
<attribute side="server" code="0x0005" define="TIME_ZONE" type="ARRAY" entryType="TimeZoneStruct" min="1" max="2" writable="true" optional="true">
<description>TimeZone</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0006" define="DST_OFFSET" type="ARRAY" entryType="DstOffsetType" max="20" writable="true" optional="true">
<description>DstOffset</description>
<attribute side="server" code="0x0006" define="DST_OFFSET" type="ARRAY" entryType="DSTOffsetStruct" max="20" writable="true" optional="true">
<description>DSTOffset</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
Expand Down
22 changes: 11 additions & 11 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.

8 changes: 8 additions & 0 deletions src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID {{availability (a
MTRAttributeIDTypeGlobalAttribute{{asUpperCamelCase label}}ID,
{{/if}}
{{/unless}}
{{! Anything which has an old name, and the new name was introduced in the "First after major API revamp" release or later
(or just after the "First major API revamp" release, but we don't have a good way to test for that),
we need to generate the new-form id for the old name too, as long as it was not removed. }}
{{#if (and (hasOldName (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)
(not (wasIntroducedBeforeRelease "First after major API revamp" (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true))
(not (wasRemoved (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true)))}}
MTRAttributeIDTypeCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{compatAttributeNameRemapping ../clusterName label}}ID {{availability (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true minimalRelease="First major API revamp" deprecationMessage=(concat "Please use MTRAttributeIDType" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Attribute" (asUpperCamelCase label preserveAcronyms=true) "ID")}} = MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID,
{{/if}}
{{#last}}

{{/last}}
Expand Down
33 changes: 32 additions & 1 deletion src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6503,7 +6503,7 @@
HeatSetpointPresent: HeatSetpointFieldPresent
CoolSetpointPresent: CoolSetpointFieldPresent

- release: "Future"
- release: "First after major API revamp"
versions: "future"
introduced:
global attributes:
Expand Down Expand Up @@ -6565,6 +6565,7 @@
- EventList
TimeSynchronization:
- EventList
- DSTOffset
BridgedDeviceBasicInformation:
- EventList
Switch:
Expand Down Expand Up @@ -6651,14 +6652,44 @@
- EventList
FaultInjection:
- EventList
structs:
TimeSynchronization:
- DSTOffsetStruct
- TimeZoneStruct
struct fields:
TimeSynchronization:
DSTOffsetStruct:
- offset
- validStarting
- validUntil
TimeZoneStruct:
- offset
- validAt
- name
enum values:
DoorLock:
LockDataTypeEnum:
- FingerVein
deprecated:
attributes:
TimeSynchronization:
- DstOffset
structs:
TimeSynchronization:
- DstOffsetType
- TimeZoneType
removed:
enum values:
DoorLock:
DlLockDataType:
# This value never existed for this enum name so, don't start
# exposing it. It's exposed for LockDataTypeEnum
- FingerVein
renames:
structs:
TimeSynchronization:
DSTOffsetStruct: DstOffsetType
TimeZoneStruct: TimeZoneType
attributes:
TimeSynchronization:
DSTOffset: DstOffset
6 changes: 4 additions & 2 deletions src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h

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

25 changes: 17 additions & 8 deletions src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h

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

14 changes: 10 additions & 4 deletions src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm

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

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

Loading

0 comments on commit 2038802

Please sign in to comment.