Skip to content

Commit

Permalink
Update Darwin availability annotations for Mode Select: (#27113)
Browse files Browse the repository at this point in the history
* Update Darwin availability annotations for Mode Select:

* Marks the new commands and associated feature provisional, because those
  changes might not in fact happen to Mode Select.
* Marks the new tagName field of ModeTagStruct as provisional, for the same
  reason.
* Marks the new enums provisional, for the same reason.
* Handles the rename of SemanticTagStruct to ModeTagStruct by pretending that we
  directly renamed SemanticTag to ModeTagStruct and then adding a manual
  SemanticTagStruct shim.
* Handles the renames of the OnOff feature and the ModeTags field of the
  ModeOptionsStruct.

Fixes #27085 (with the
first item in there fixed in #27088).

* Fix typos per code review.

Co-authored-by: Vivien Nicolas <vnicolas@apple.com>

---------

Co-authored-by: Vivien Nicolas <vnicolas@apple.com>
  • Loading branch information
2 people authored and pull[bot] committed Jul 20, 2023
1 parent 2a0f827 commit f2add16
Show file tree
Hide file tree
Showing 21 changed files with 119 additions and 693 deletions.
6 changes: 6 additions & 0 deletions src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import <Foundation/Foundation.h>

#import <Matter/MTRCommandPayloadsObjc.h>
#import <Matter/MTRStructsObjc.h>

/**
* This file defines manual backwards-compat shims of various sorts to handle
Expand All @@ -34,4 +35,9 @@ NS_ASSUME_NONNULL_BEGIN

@end

API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4))
MTR_NEWLY_DEPRECATED("Please use MTRModeSelectClusterModeTagStruct")
@interface MTRModeSelectClusterSemanticTagStruct : MTRModeSelectClusterModeTagStruct
@end

NS_ASSUME_NONNULL_END
27 changes: 27 additions & 0 deletions src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (c) 2023 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <Foundation/Foundation.h>

#import <Matter/MTRBackwardsCompatShims.h>

/**
* This file defines implementations of manual backwards-compat shims of various sorts to handle
* API changes that happened.
*/

@implementation MTRModeSelectClusterSemanticTagStruct
@end
55 changes: 47 additions & 8 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5316,8 +5316,6 @@
- ThreadMetricsStruct
GeneralDiagnostics:
- NetworkInterface
ModeSelect:
- SemanticTagStruct
OperationalCredentials:
- FabricDescriptorStruct
DoorLock:
Expand Down Expand Up @@ -5434,10 +5432,6 @@
- iPv4Addresses
- iPv6Addresses
- type
ModeSelect:
SemanticTagStruct:
- mfgCode
- value
OperationalCredentials:
FabricDescriptorStruct:
- rootPublicKey
Expand Down Expand Up @@ -6534,8 +6528,6 @@
ThreadMetricsStruct: ThreadMetrics
GeneralDiagnostics:
NetworkInterface: NetworkInterfaceType
ModeSelect:
SemanticTagStruct: SemanticTag
OperationalCredentials:
FabricDescriptorStruct: FabricDescriptor
DoorLock:
Expand Down Expand Up @@ -8157,6 +8149,8 @@
- ProductAppearanceStruct
BridgedDeviceBasicInformation:
- ProductAppearanceStruct
ModeSelect:
- ModeTagStruct
NetworkCommissioning:
- WiFiInterfaceScanResultStruct
- ThreadInterfaceScanResultStruct
Expand All @@ -8183,6 +8177,12 @@
ProductAppearanceStruct:
- finish
- primaryColor
ModeSelect:
ModeTagStruct:
- mfgCode
- value
ModeOptionStruct:
- modeTags
NetworkCommissioning:
WiFiInterfaceScanResultStruct:
- security
Expand Down Expand Up @@ -9562,6 +9562,9 @@
- GroupNames
NameSupportBitmap:
- GroupNames
ModeSelect:
Feature:
- OnOff
NetworkCommissioning:
WiFiSecurityBitmap:
- Unencrypted
Expand Down Expand Up @@ -9968,6 +9971,10 @@
ThreadNetworkDiagnostics:
- NeighborTable
- RouteTable
struct fields:
ModeSelect:
ModeOptionStruct:
- semanticTags
bitmaps:
Groups:
- GroupClusterFeature
Expand All @@ -9977,6 +9984,10 @@
- PressureFeature
PumpConfigurationAndControl:
- PumpFeature
bitmap values:
ModeSelect:
Feature:
- DEPONOFF
renames:
attributes:
TimeSynchronization:
Expand All @@ -9989,13 +10000,19 @@
structs:
AccessControl:
AccessControlTargetStruct: Target
ModeSelect:
ModeTagStruct: SemanticTag
NetworkCommissioning:
WiFiInterfaceScanResultStruct: WiFiInterfaceScanResult
ThreadInterfaceScanResultStruct: ThreadInterfaceScanResult
NetworkInfoStruct: NetworkInfo
ThreadNetworkDiagnostics:
NeighborTableStruct: NeighborTable
RouteTableStruct: RouteTable
struct fields:
ModeSelect:
ModeOptionStruct:
modeTags: semanticTags
enum values:
TimeSynchronization:
TimeSourceEnum:
Expand Down Expand Up @@ -10024,6 +10041,10 @@
Feature: PressureFeature
PumpConfigurationAndControl:
Feature: PumpFeature
bitmap values:
ModeSelect:
Feature:
OnOff: DEPONOFF
provisional:
clusters:
# Not ready to be public API yet.
Expand All @@ -10033,6 +10054,24 @@
- RVCRunModeSelect
- RVCCleanModeSelect
- DishwasherModeSelect
commands:
ModeSelect:
# Still very in-flux.
- ChangeToModeWithStatus
- ChangeToModeResponse
struct fields:
ModeSelect:
ModeTagStruct:
- tagName
enums:
ModeSelect:
# Still very in-flux.
- ModeTag
- StatusCode
bitmap values:
ModeSelect:
Feature:
- ExtendedStatus
# 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
{{#if_is_struct type}}
{{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new];
{{#zcl_struct_items_by_struct_and_cluster_name type cluster}}
{{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}}
{{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }}
{{/if}}
{{/zcl_struct_items_by_struct_and_cluster_name}}
{{else}}
{{#if_is_strongly_typed_chip_enum type}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
{{else}}
{{#if_is_struct type}}
{{#zcl_struct_items_by_struct_and_cluster_name type cluster}}
{{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}}
{{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}}
{{/if}}
{{/zcl_struct_items_by_struct_and_cluster_name}}
{{else}}
{{#if_is_strongly_typed_chip_enum type}}
Expand Down

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

33 changes: 3 additions & 30 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.

46 changes: 0 additions & 46 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 f2add16

Please sign in to comment.