Skip to content

Commit

Permalink
Align naming in Time Synchronization Cluster XML with the spec.
Browse files Browse the repository at this point in the history
More spec changes happened in CHIP-Specifications/connectedhomeip-spec#6212

Fixes #25001
  • Loading branch information
bzbarsky-apple committed Feb 14, 2023
1 parent e497117 commit 5649145
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 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
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

0 comments on commit 5649145

Please sign in to comment.