Skip to content

Commit

Permalink
Update Darwin availability annotations for Mode Select:
Browse files Browse the repository at this point in the history
* 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 project-chip#27085 (with the
first item in there fixed in project-chip#27088).
  • Loading branch information
bzbarsky-apple committed Jun 7, 2023
1 parent 1793a4c commit 2f41f30
Show file tree
Hide file tree
Showing 18 changed files with 116 additions and 673 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 @@ -8164,6 +8156,8 @@
- ProductAppearanceStruct
BridgedDeviceBasicInformation:
- ProductAppearanceStruct
ModeSelect:
- ModeTagStruct
NetworkCommissioning:
- WiFiInterfaceScanResultStruct
- ThreadInterfaceScanResultStruct
Expand All @@ -8190,6 +8184,12 @@
ProductAppearanceStruct:
- finish
- primaryColor
ModeSelect:
ModeTagStruct:
- mfgCode
- value
ModeOptionStruct:
- modeTags
NetworkCommissioning:
WiFiInterfaceScanResultStruct:
- security
Expand Down Expand Up @@ -9569,6 +9569,9 @@
- GroupNames
NameSupportBitmap:
- GroupNames
ModeSelect:
Feature:
- OnOff
NetworkCommissioning:
WiFiSecurityBitmap:
- Unencrypted
Expand Down Expand Up @@ -9975,6 +9978,10 @@
ThreadNetworkDiagnostics:
- NeighborTable
- RouteTable
struct fields:
ModeSelect:
ModeOptionStruct:
- semanticTags
bitmaps:
Groups:
- GroupClusterFeature
Expand All @@ -9984,6 +9991,10 @@
- PressureFeature
PumpConfigurationAndControl:
- PumpFeature
bitmap values:
ModeSelect:
Feature:
- DEPONOFF
renames:
attributes:
TimeSynchronization:
Expand All @@ -9996,13 +10007,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 @@ -10031,6 +10048,10 @@
Feature: PressureFeature
PumpConfigurationAndControl:
Feature: PumpFeature
bitmap values:
ModeSelect:
Feature:
OnOff: DEPONOFF
provisional:
clusters:
# Not ready to be public API yet.
Expand All @@ -10040,6 +10061,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
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 2f41f30

Please sign in to comment.