Skip to content

Commit

Permalink
Adjust Darwin availability annotations for Time Synchronization updat…
Browse files Browse the repository at this point in the history
…es. (#26436)

This aims to as much as possible undo the changes from #26332 to Darwin
generated code, by listing the set of renames and then marking almost all the
new names provisional.

The two exceptions are:

1) The attributes that got renamed, for which the codegen sets the old id
   constants equal to the new id constants, so we have to generate the new id
   constants.
2) The nullability change for validUntil in DSTOffsetStruct, which we have no
   way to make conditional based on availability.
  • Loading branch information
bzbarsky-apple committed May 9, 2023
1 parent e5eb60d commit 05d9050
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 27 deletions.
9 changes: 9 additions & 0 deletions src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{availability cluster co
{{/inline}}
{{> commandIdDecl cluster=(asUpperCamelCase ../clusterName preserveAcronyms=true)
command=(asUpperCamelCase name preserveAcronyms=true)}}
{{! 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) command=(asUpperCamelCase name preserveAcronyms=true) isForIds=true)
(not (wasIntroducedBeforeRelease "First after major API revamp" (asUpperCamelCase ../clusterName preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForIds=true))
(isSupported (compatClusterNameRemapping ../clusterName) command=(compatCommandNameRemapping ../clusterName name) isForIds=true))}}
{{> commandIdDecl cluster=(compatClusterNameRemapping ../clusterName)
command=(compatCommandNameRemapping ../clusterName name)}}
{{/if}}
{{#last}}

{{/last}}
Expand Down
68 changes: 68 additions & 0 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7139,6 +7139,12 @@
Scenes:
ScenesFeature:
- SceneNames
ids:
attributes:
TimeSynchronization:
- TrustedTimeSource
- DefaultNTP
- NTPServerAvailable
deprecated:
bitmaps:
Groups:
Expand Down Expand Up @@ -7172,10 +7178,72 @@
- ProductFinishEnum
- ColorEnum
renames:
attributes:
TimeSynchronization:
TrustedTimeSource: TrustedTimeNodeId
DefaultNTP: DefaultNtp
NTPServerAvailable: NtpServerPort
commands:
TimeSynchronization:
SetUTCTime: SetUtcTime
enum values:
TimeSynchronization:
TimeSourceEnum:
NonMatterSNTP: NonFabricSntp
NonMatterNTP: NonFabricNtp
MatterSNTP: FabricSntp
MatterNTP: FabricNtp
MixedNTP: MixedNtp
NonMatterSNTPNTS: NonFabricSntpNts
NonMatterNTPNTS: NonFabricNtpNts
MatterSNTPNTS: FabricSntpNts
MatterNTPNTS: FabricNtpNts
MixedNTPNTS: MixedNtpNts
PTP: Ptp
GNSS: Gnss
bitmaps:
Groups:
GroupsFeature: GroupClusterFeature
PressureMeasurement:
PressureMeasurementFeature: PressureFeature
PumpConfigurationAndControl:
PumpConfigurationAndControlFeature: PumpFeature
provisional:
# Once we actually unmark TimeSynchronization as provisional, all these bits should go away too, and we should instead
# mark things as introduced/deprecated as needed. The "ids" entries should go away, in particular.
ids:
attributes:
TimeSynchronization:
- TimeZoneListMaxSize
- DSTOffsetListMaxSize
- SupportsDNSResolve
commands:
TimeSynchronization:
- SetUTCTime
- SetTrustedTimeSource
- SetTimeZone
- SetTimeZoneResponse
- SetDSTOffset
- SetDefaultNTP
events:
TimeSynchronization:
- DSTTableEmpty
- DSTStatus
- TimeZoneStatus
- TimeFailure
- MissingTrustedTimeSource
enum values:
TimeSynchronization:
TimeSourceEnum:
- NonMatterSNTP
- NonMatterNTP
- MatterSNTP
- MatterNTP
- MixedNTP
- NonMatterSNTPNTS
- NonMatterNTPNTS
- MatterSNTPNTS
- MatterNTPNTS
- MixedNTPNTS
- PTP
- GNSS
24 changes: 12 additions & 12 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.

42 changes: 27 additions & 15 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.

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

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

37 changes: 37 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm

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

0 comments on commit 05d9050

Please sign in to comment.