From 2f41f30f3629a7bcf03851cd930113f9147dd125 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 6 Jun 2023 10:46:50 -0400 Subject: [PATCH] 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 https://github.com/project-chip/connectedhomeip/issues/27085 (with the first item in there fixed in https://github.com/project-chip/connectedhomeip/pull/27088). --- .../Framework/CHIP/MTRBackwardsCompatShims.h | 6 + .../Framework/CHIP/MTRBackwardsCompatShims.mm | 27 ++++ .../CHIP/templates/availability.yaml | 55 ++++++- .../CHIP/zap-generated/MTRBaseClusters.h | 33 +--- .../CHIP/zap-generated/MTRBaseClusters.mm | 46 ------ .../CHIP/zap-generated/MTRCallbackBridge.h | 150 ------------------ .../CHIP/zap-generated/MTRCallbackBridge.mm | 111 ------------- .../CHIP/zap-generated/MTRClusterConstants.h | 2 - .../CHIP/zap-generated/MTRClusters.h | 5 - .../CHIP/zap-generated/MTRClusters.mm | 85 ---------- .../zap-generated/MTRCommandPayloadsObjc.h | 51 ------ .../zap-generated/MTRCommandPayloadsObjc.mm | 123 -------------- .../MTRCommandPayloads_Internal.h | 7 - .../CHIP/zap-generated/MTRStructsObjc.h | 7 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 20 ++- .../CHIPTests/MTRBackwardsCompatTests.m | 8 + .../Matter.xcodeproj/project.pbxproj | 4 + .../zap-generated/cluster/Commands.h | 49 ------ 18 files changed, 116 insertions(+), 673 deletions(-) create mode 100644 src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm diff --git a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h index fa7ddd4f8f2088..034f024ef03b59 100644 --- a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h +++ b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h @@ -17,6 +17,7 @@ #import #import +#import /** * This file defines manual backwards-compat shims of various sorts to handle @@ -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 diff --git a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm new file mode 100644 index 00000000000000..77949e0c765759 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm @@ -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 + +#import + +/** + * This file defines implementations of manual backwards-compat shims of various sorts to handle + * API changes that happened. + */ + +@implementation MTRModeSelectClusterSemanticTagStruct +@end diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 54831840352e57..0498e5ea11da89 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -5316,8 +5316,6 @@ - ThreadMetricsStruct GeneralDiagnostics: - NetworkInterface - ModeSelect: - - SemanticTagStruct OperationalCredentials: - FabricDescriptorStruct DoorLock: @@ -5434,10 +5432,6 @@ - iPv4Addresses - iPv6Addresses - type - ModeSelect: - SemanticTagStruct: - - mfgCode - - value OperationalCredentials: FabricDescriptorStruct: - rootPublicKey @@ -6534,8 +6528,6 @@ ThreadMetricsStruct: ThreadMetrics GeneralDiagnostics: NetworkInterface: NetworkInterfaceType - ModeSelect: - SemanticTagStruct: SemanticTag OperationalCredentials: FabricDescriptorStruct: FabricDescriptor DoorLock: @@ -8164,6 +8156,8 @@ - ProductAppearanceStruct BridgedDeviceBasicInformation: - ProductAppearanceStruct + ModeSelect: + - ModeTagStruct NetworkCommissioning: - WiFiInterfaceScanResultStruct - ThreadInterfaceScanResultStruct @@ -8190,6 +8184,12 @@ ProductAppearanceStruct: - finish - primaryColor + ModeSelect: + ModeTagStruct: + - mfgCode + - value + ModeOptionStruct: + - modeTags NetworkCommissioning: WiFiInterfaceScanResultStruct: - security @@ -9569,6 +9569,9 @@ - GroupNames NameSupportBitmap: - GroupNames + ModeSelect: + Feature: + - OnOff NetworkCommissioning: WiFiSecurityBitmap: - Unencrypted @@ -9975,6 +9978,10 @@ ThreadNetworkDiagnostics: - NeighborTable - RouteTable + struct fields: + ModeSelect: + ModeOptionStruct: + - semanticTags bitmaps: Groups: - GroupClusterFeature @@ -9984,6 +9991,10 @@ - PressureFeature PumpConfigurationAndControl: - PumpFeature + bitmap values: + ModeSelect: + Feature: + - DEPONOFF renames: attributes: TimeSynchronization: @@ -9996,6 +10007,8 @@ structs: AccessControl: AccessControlTargetStruct: Target + ModeSelect: + ModeTagStruct: SemanticTag NetworkCommissioning: WiFiInterfaceScanResultStruct: WiFiInterfaceScanResult ThreadInterfaceScanResultStruct: ThreadInterfaceScanResult @@ -10003,6 +10016,10 @@ ThreadNetworkDiagnostics: NeighborTableStruct: NeighborTable RouteTableStruct: RouteTable + struct fields: + ModeSelect: + ModeOptionStruct: + modeTags: semanticTags enum values: TimeSynchronization: TimeSourceEnum: @@ -10031,6 +10048,10 @@ Feature: PressureFeature PumpConfigurationAndControl: Feature: PumpFeature + bitmap values: + ModeSelect: + Feature: + OnOff: DEPONOFF provisional: clusters: # Not ready to be public API yet. @@ -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: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 383eca64111dbb..04df0bb28e6fcb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7730,16 +7730,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) */ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params completion:(MTRStatusCompletion)completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -/** - * Command ChangeToModeWithStatus - * - * This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a - response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on - NewMode field, see ChangeToMode command. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - */ -- (void)changeToModeWithStatusWithParams:(MTRModeSelectClusterChangeToModeWithStatusParams *)params - completion:(void (^)(MTRModeSelectClusterChangeToModeResponseParams * _Nullable data, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributeDescriptionWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -31563,28 +31553,11 @@ typedef NS_ENUM(uint8_t, MTRGroupKeyManagementGroupKeySecurityPolicy) { MTRGroupKeyManagementGroupKeySecurityPolicyCacheAndSync API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -typedef NS_ENUM(uint16_t, MTRModeSelectModeTag) { - MTRModeSelectModeTagAuto MTR_NEWLY_AVAILABLE = 0x00, - MTRModeSelectModeTagQuick MTR_NEWLY_AVAILABLE = 0x01, - MTRModeSelectModeTagQuiet MTR_NEWLY_AVAILABLE = 0x02, - MTRModeSelectModeTagLowNoise MTR_NEWLY_AVAILABLE = 0x03, - MTRModeSelectModeTagLowEnergy MTR_NEWLY_AVAILABLE = 0x04, - MTRModeSelectModeTagVacation MTR_NEWLY_AVAILABLE = 0x05, - MTRModeSelectModeTagMin MTR_NEWLY_AVAILABLE = 0x06, - MTRModeSelectModeTagMax MTR_NEWLY_AVAILABLE = 0x07, - MTRModeSelectModeTagNight MTR_NEWLY_AVAILABLE = 0x08, - MTRModeSelectModeTagDay MTR_NEWLY_AVAILABLE = 0x09, -} MTR_NEWLY_AVAILABLE; - -typedef NS_ENUM(uint8_t, MTRModeSelectStatusCode) { - MTRModeSelectStatusCodeSuccess MTR_NEWLY_AVAILABLE = 0x00, - MTRModeSelectStatusCodeUnsupportedMode MTR_NEWLY_AVAILABLE = 0x01, - MTRModeSelectStatusCodeGenericFailure MTR_NEWLY_AVAILABLE = 0x02, -} MTR_NEWLY_AVAILABLE; - typedef NS_OPTIONS(uint32_t, MTRModeSelectFeature) { MTRModeSelectFeatureOnOff MTR_NEWLY_AVAILABLE = 0x1, - MTRModeSelectFeatureExtendedStatus MTR_NEWLY_AVAILABLE = 0x2, + MTRModeSelectFeatureDEPONOFF API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRModeSelectFeatureOnOff") + = 0x1, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRTemperatureControlFeature) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 6976a94654921f..70991b57728c06 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -46713,41 +46713,6 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params std::move(*bridge).DispatchAction(self.device); } -- (void)changeToModeWithStatusWithParams:(MTRModeSelectClusterChangeToModeWithStatusParams *)params - completion:(void (^)(MTRModeSelectClusterChangeToModeResponseParams * _Nullable data, - NSError * _Nullable error))completion -{ - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRModeSelectClusterChangeToModeResponseCallbackBridge(self.callbackQueue, completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, - ModeSelectClusterChangeToModeResponseCallbackType successCb, MTRErrorCallback failureCb, - MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ModeSelect::Commands::ChangeToModeWithStatus::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newMode = params.newMode.unsignedCharValue; - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, - timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} - - (void)readAttributeDescriptionWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; @@ -47363,17 +47328,6 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params { [self changeToModeWithParams:params completion:completionHandler]; } -- (void)changeToModeWithStatusWithParams:(MTRModeSelectClusterChangeToModeWithStatusParams *)params - completionHandler:(void (^)(MTRModeSelectClusterChangeToModeResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler -{ - [self changeToModeWithStatusWithParams:params - completion:^( - MTRModeSelectClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error) { - // Cast is safe because subclass does not add any selectors. - completionHandler(static_cast(data), error); - }]; -} - (void)readAttributeDescriptionWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 8b5a2b53e5f0b9..8caa447666c74a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -85,8 +85,6 @@ typedef void (*GroupKeyManagementClusterKeySetReadResponseCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); -typedef void (*ModeSelectClusterChangeToModeResponseCallbackType)( - void *, const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType &); typedef void (*OperationalStateClusterOperationalCommandResponseCallbackType)( void *, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType &); typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( @@ -385,12 +383,6 @@ typedef void (*GroupKeyManagementClusterGroupKeySecurityPolicyEnumAttributeCallb void *, chip::app::Clusters::GroupKeyManagement::GroupKeySecurityPolicyEnum); typedef void (*NullableGroupKeyManagementClusterGroupKeySecurityPolicyEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*ModeSelectClusterModeTagAttributeCallback)(void *, chip::app::Clusters::ModeSelect::ModeTag); -typedef void (*NullableModeSelectClusterModeTagAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*ModeSelectClusterStatusCodeAttributeCallback)(void *, chip::app::Clusters::ModeSelect::StatusCode); -typedef void (*NullableModeSelectClusterStatusCodeAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); typedef void (*AirQualityClusterAirQualityEnumAttributeCallback)(void *, chip::app::Clusters::AirQuality::AirQualityEnum); typedef void (*NullableAirQualityClusterAirQualityEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); @@ -22481,20 +22473,6 @@ class MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); }; -class MTRModeSelectClusterChangeToModeResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRModeSelectClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRModeSelectClusterChangeToModeResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType & data); -}; - class MTROperationalStateClusterOperationalCommandResponseCallbackBridge : public MTRCallbackBridge { @@ -27485,134 +27463,6 @@ class MTRNullableGroupKeyManagementClusterGroupKeySecurityPolicyEnumAttributeCal MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRModeSelectClusterModeTagAttributeCallbackBridge : public MTRCallbackBridge -{ -public: - MTRModeSelectClusterModeTagAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRModeSelectClusterModeTagAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::ModeSelect::ModeTag value); -}; - -class MTRModeSelectClusterModeTagAttributeCallbackSubscriptionBridge : public MTRModeSelectClusterModeTagAttributeCallbackBridge -{ -public: - MTRModeSelectClusterModeTagAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRModeSelectClusterModeTagAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRModeSelectClusterModeTagAttributeCallbackBridge::KeepAliveOnCallback; - using MTRModeSelectClusterModeTagAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRNullableModeSelectClusterModeTagAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNullableModeSelectClusterModeTagAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRNullableModeSelectClusterModeTagAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::Nullable & value); -}; - -class MTRNullableModeSelectClusterModeTagAttributeCallbackSubscriptionBridge - : public MTRNullableModeSelectClusterModeTagAttributeCallbackBridge -{ -public: - MTRNullableModeSelectClusterModeTagAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRNullableModeSelectClusterModeTagAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRNullableModeSelectClusterModeTagAttributeCallbackBridge::KeepAliveOnCallback; - using MTRNullableModeSelectClusterModeTagAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRModeSelectClusterStatusCodeAttributeCallbackBridge : public MTRCallbackBridge -{ -public: - MTRModeSelectClusterStatusCodeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRModeSelectClusterStatusCodeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::ModeSelect::StatusCode value); -}; - -class MTRModeSelectClusterStatusCodeAttributeCallbackSubscriptionBridge - : public MTRModeSelectClusterStatusCodeAttributeCallbackBridge -{ -public: - MTRModeSelectClusterStatusCodeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRModeSelectClusterStatusCodeAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRModeSelectClusterStatusCodeAttributeCallbackBridge::KeepAliveOnCallback; - using MTRModeSelectClusterStatusCodeAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRNullableModeSelectClusterStatusCodeAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNullableModeSelectClusterStatusCodeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRNullableModeSelectClusterStatusCodeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); -}; - -class MTRNullableModeSelectClusterStatusCodeAttributeCallbackSubscriptionBridge - : public MTRNullableModeSelectClusterStatusCodeAttributeCallbackBridge -{ -public: - MTRNullableModeSelectClusterStatusCodeAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRNullableModeSelectClusterStatusCodeAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRNullableModeSelectClusterStatusCodeAttributeCallbackBridge::KeepAliveOnCallback; - using MTRNullableModeSelectClusterStatusCodeAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - class MTRAirQualityClusterAirQualityEnumAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index dbd8cefc120ea2..e463baa46fc310 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -22904,18 +22904,6 @@ DispatchSuccess(context, response); }; -void MTRModeSelectClusterChangeToModeResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType & data) -{ - auto * response = [MTRModeSelectClusterChangeToModeResponseParams new]; - CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - DispatchSuccess(context, response); -}; - void MTROperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data) { @@ -26549,105 +26537,6 @@ } } -void MTRModeSelectClusterModeTagAttributeCallbackBridge::OnSuccessFn(void * context, chip::app::Clusters::ModeSelect::ModeTag value) -{ - NSNumber * _Nonnull objCValue; - objCValue = [NSNumber numberWithUnsignedShort:chip::to_underlying(value)]; - DispatchSuccess(context, objCValue); -}; - -void MTRModeSelectClusterModeTagAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() -{ - if (!mQueue) { - return; - } - - if (mEstablishedHandler != nil) { - dispatch_async(mQueue, mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - mEstablishedHandler = nil; - } -} - -void MTRNullableModeSelectClusterModeTagAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) -{ - NSNumber * _Nullable objCValue; - if (value.IsNull()) { - objCValue = nil; - } else { - objCValue = [NSNumber numberWithUnsignedShort:chip::to_underlying(value.Value())]; - } - DispatchSuccess(context, objCValue); -}; - -void MTRNullableModeSelectClusterModeTagAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() -{ - if (!mQueue) { - return; - } - - if (mEstablishedHandler != nil) { - dispatch_async(mQueue, mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - mEstablishedHandler = nil; - } -} - -void MTRModeSelectClusterStatusCodeAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ModeSelect::StatusCode value) -{ - NSNumber * _Nonnull objCValue; - objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; - DispatchSuccess(context, objCValue); -}; - -void MTRModeSelectClusterStatusCodeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() -{ - if (!mQueue) { - return; - } - - if (mEstablishedHandler != nil) { - dispatch_async(mQueue, mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - mEstablishedHandler = nil; - } -} - -void MTRNullableModeSelectClusterStatusCodeAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) -{ - NSNumber * _Nullable objCValue; - if (value.IsNull()) { - objCValue = nil; - } else { - objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; - } - DispatchSuccess(context, objCValue); -}; - -void MTRNullableModeSelectClusterStatusCodeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() -{ - if (!mQueue) { - return; - } - - if (mEstablishedHandler != nil) { - dispatch_async(mQueue, mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - mEstablishedHandler = nil; - } -} - void MTRAirQualityClusterAirQualityEnumAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::AirQuality::AirQualityEnum value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index e37b541b6ce51a..88772c814eb167 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -10184,8 +10184,6 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { // Cluster ModeSelect commands MTRCommandIDTypeClusterModeSelectCommandChangeToModeID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000000, - MTRCommandIDTypeClusterModeSelectCommandChangeToModeWithStatusID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRCommandIDTypeClusterModeSelectCommandChangeToModeResponseID MTR_NEWLY_AVAILABLE = 0x00000002, // Cluster TemperatureControl commands MTRCommandIDTypeClusterTemperatureControlCommandSetTemperatureID MTR_NEWLY_AVAILABLE = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 96048903892293..8712e1dfe2b627 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -2748,11 +2748,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)changeToModeWithStatusWithParams:(MTRModeSelectClusterChangeToModeWithStatusParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRModeSelectClusterChangeToModeResponseParams * _Nullable data, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (NSDictionary *)readAttributeDescriptionWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index d9333adcdee85d..7b128d185b4045 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -12739,76 +12739,6 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params } } -- (void)changeToModeWithStatusWithParams:(MTRModeSelectClusterChangeToModeWithStatusParams *)params - expectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRModeSelectClusterChangeToModeResponseParams * _Nullable data, - NSError * _Nullable error))completion -{ - NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeModeSelectID, - (unsigned int) MTRCommandIDTypeClusterModeSelectCommandChangeToModeWithStatusID]; - // Make a copy of params before we go async. - params = [params copy]; - NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMsParam) { - timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); - } - MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID - controller:self.device.deviceController]; - auto * bridge = new MTRModeSelectClusterChangeToModeResponseCallbackBridge( - self.device.queue, - ^(id _Nullable value, NSError * _Nullable error) { - MTRClustersLogCompletion(logPrefix, value, error); - dispatch_async(self.callbackQueue, ^{ - completion(value, error); - }); - [workItem endWork]; - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, - ModeSelectClusterChangeToModeResponseCallbackType successCb, MTRErrorCallback failureCb, - MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - ModeSelect::Commands::ChangeToModeWithStatus::Type request; - if (timedInvokeTimeoutMsParam != nil) { - timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); - } - if (params != nil) { - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout - = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.newMode = params.newMode.unsignedCharValue; - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, - self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(baseDevice); - }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; - - if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { - expectedValues = nil; - } else { - expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); - } - if (expectedValues) { - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; - } -} - - (NSDictionary *)readAttributeDescriptionWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) @@ -12962,21 +12892,6 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params expectedValueInterval:expectedValueIntervalMs completion:completionHandler]; } -- (void)changeToModeWithStatusWithParams:(MTRModeSelectClusterChangeToModeWithStatusParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completionHandler:(void (^)(MTRModeSelectClusterChangeToModeResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler -{ - [self changeToModeWithStatusWithParams:params - expectedValues:expectedDataValueDictionaries - expectedValueInterval:expectedValueIntervalMs - completion:^( - MTRModeSelectClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error) { - // Cast is safe because subclass does not add any selectors. - completionHandler(static_cast(data), error); - }]; -} @end @implementation MTRClusterTemperatureControl diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 2204f89f60f932..14ba07c1913e38 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4075,57 +4075,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end -MTR_NEWLY_AVAILABLE -@interface MTRModeSelectClusterChangeToModeWithStatusParams : NSObject - -@property (nonatomic, copy, getter=getNewMode) NSNumber * _Nonnull newMode MTR_NEWLY_AVAILABLE; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -/** - * Controls how much time, in seconds, we will allow for the server to process the command. - * - * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. - * - * If nil, the framework will try to select an appropriate timeout value itself. - */ -@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; -@end - -MTR_NEWLY_AVAILABLE -@interface MTRModeSelectClusterChangeToModeResponseParams : NSObject - -@property (nonatomic, copy) NSNumber * _Nonnull status MTR_NEWLY_AVAILABLE; - -@property (nonatomic, copy) NSString * _Nullable statusText MTR_NEWLY_AVAILABLE; - -/** - * Initialize an MTRModeSelectClusterChangeToModeResponseParams with a response-value dictionary - * of the sort that MTRDeviceResponseHandler would receive. - * - * Will return nil and hand out an error if the response-value dictionary is not - * a command data response or is not the right command response. - * - * Will return nil and hand out an error if the data response does not match the known - * schema for this command. - */ -- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue - error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; -@end - MTR_NEWLY_AVAILABLE @interface MTRTemperatureControlClusterSetTemperatureParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index de2edfc0ed5deb..e1bd15f91a8ccc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6445,129 +6445,6 @@ - (NSString *)description return descriptionString; } -@end -@implementation MTRModeSelectClusterChangeToModeWithStatusParams -- (instancetype)init -{ - if (self = [super init]) { - - _newMode = @(0); - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRModeSelectClusterChangeToModeWithStatusParams alloc] init]; - - other.newMode = self.newMode; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: newMode:%@; >", NSStringFromClass([self class]), _newMode]; - return descriptionString; -} - -@end -@implementation MTRModeSelectClusterChangeToModeResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _status = @(0); - - _statusText = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRModeSelectClusterChangeToModeResponseParams alloc] init]; - - other.status = self.status; - other.statusText = self.statusText; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: status:%@; statusText:%@; >", NSStringFromClass([self class]), _status, _statusText]; - return descriptionString; -} - -- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue - error:(NSError * __autoreleasing *)error -{ - if (!(self = [super init])) { - return nil; - } - - using DecodableType = chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType; - chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue - clusterID:DecodableType::GetClusterId() - commandID:DecodableType::GetCommandId() - error:error]; - if (buffer.IsNull()) { - return nil; - } - - chip::TLV::TLVReader reader; - reader.Init(buffer->Start(), buffer->DataLength()); - - CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); - if (err == CHIP_NO_ERROR) { - DecodableType decodedStruct; - err = chip::app::DataModel::Decode(reader, decodedStruct); - if (err == CHIP_NO_ERROR) { - err = [self _setFieldsFromDecodableStruct:decodedStruct]; - if (err == CHIP_NO_ERROR) { - return self; - } - } - } - - NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; - MTR_LOG_ERROR("%s", errorStr.UTF8String); - if (error != nil) { - NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; - *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; - } - return nil; -} - -@end - -@implementation MTRModeSelectClusterChangeToModeResponseParams (InternalMethods) - -- (CHIP_ERROR)_setFieldsFromDecodableStruct: - (const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType &)decodableStruct -{ - { - self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; - } - { - if (decodableStruct.statusText.HasValue()) { - self.statusText = AsString(decodableStruct.statusText.Value()); - if (self.statusText == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - return err; - } - } else { - self.statusText = nil; - } - } - return CHIP_NO_ERROR; -} @end @implementation MTRTemperatureControlClusterSetTemperatureParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 1cd7c13eca6af9..28f95b18ae822e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -217,13 +217,6 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface MTRModeSelectClusterChangeToModeResponseParams (InternalMethods) - -- (CHIP_ERROR)_setFieldsFromDecodableStruct: - (const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType &)decodableStruct; - -@end - @interface MTROperationalStateClusterOperationalCommandResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 273577b1546130..5c8125db0d56f6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -691,14 +691,19 @@ MTR_NEWLY_AVAILABLE @interface MTRModeSelectClusterModeTagStruct : NSObject @property (nonatomic, copy) NSNumber * _Nullable mfgCode MTR_NEWLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull value MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSString * _Nullable tagName MTR_NEWLY_AVAILABLE; @end +MTR_DEPRECATED( + "Please use MTRModeSelectClusterModeTagStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) +@interface MTRModeSelectClusterSemanticTag : MTRModeSelectClusterModeTagStruct +@end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRModeSelectClusterModeOptionStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull label API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @property (nonatomic, copy) NSNumber * _Nonnull mode API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @property (nonatomic, copy) NSArray * _Nonnull modeTags MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull semanticTags API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use modeTags"); @end MTR_NEWLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 92ccd0729578cc..007eb3f3a64620 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2626,8 +2626,6 @@ - (instancetype)init _mfgCode = nil; _value = @(0); - - _tagName = nil; } return self; } @@ -2638,20 +2636,22 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.mfgCode = self.mfgCode; other.value = self.value; - other.tagName = self.tagName; return other; } - (NSString *)description { - NSString * descriptionString = [NSString - stringWithFormat:@"<%@: mfgCode:%@; value:%@; tagName:%@; >", NSStringFromClass([self class]), _mfgCode, _value, _tagName]; + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: mfgCode:%@; value:%@; >", NSStringFromClass([self class]), _mfgCode, _value]; return descriptionString; } @end +@implementation MTRModeSelectClusterSemanticTag : MTRModeSelectClusterModeTagStruct +@end + @implementation MTRModeSelectClusterModeOptionStruct - (instancetype)init { @@ -2684,6 +2684,16 @@ - (NSString *)description return descriptionString; } +- (void)setSemanticTags:(NSArray * _Nonnull)semanticTags +{ + self.modeTags = semanticTags; +} + +- (NSArray * _Nonnull)semanticTags +{ + return self.modeTags; +} + @end @implementation MTRTemperatureControlClusterTemperatureLevelStruct diff --git a/src/darwin/Framework/CHIPTests/MTRBackwardsCompatTests.m b/src/darwin/Framework/CHIPTests/MTRBackwardsCompatTests.m index 3848ed69dd0e6f..9ec359f1280ac5 100644 --- a/src/darwin/Framework/CHIPTests/MTRBackwardsCompatTests.m +++ b/src/darwin/Framework/CHIPTests/MTRBackwardsCompatTests.m @@ -1205,6 +1205,14 @@ - (void)test047_MTRGroupKeyManagementClusterKeySetReadAllIndicesParams XCTAssertEqualObjects(params.groupKeySetIDs, @[ @(16) ]); } +- (void)test048_MTRModeSelectClusterSemanticTagStruct +{ + __auto_type * obj = [[MTRModeSelectClusterSemanticTagStruct alloc] init]; + CHECK_PROPERTY(obj, mfgCode, setMfgCode, NSNumber *); + CHECK_PROPERTY(obj, value, setValue, NSNumber *); + CHECK_PROPERTY(obj, tagName, setTagName, NSString *); +} + - (void)test999_TearDown { ResetCommissionee(GetConnectedDevice(), dispatch_get_main_queue(), self, kTimeoutInSeconds); diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index dd96371ef40a0d..7ea9959fd9fab4 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -126,6 +126,7 @@ 3DFCB3292966684500332B35 /* MTRCertificateInfoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DFCB3282966684500332B35 /* MTRCertificateInfoTests.m */; }; 3DFCB32C29678C9500332B35 /* MTRConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DFCB32B29678C9500332B35 /* MTRConversion.h */; }; 51029DF6293AA6100087AFB0 /* MTROperationalCertificateIssuer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51029DF5293AA6100087AFB0 /* MTROperationalCertificateIssuer.mm */; }; + 510470FB2A2F7DF60053EA7E /* MTRBackwardsCompatShims.mm in Sources */ = {isa = PBXBuildFile; fileRef = 510470FA2A2F7DF60053EA7E /* MTRBackwardsCompatShims.mm */; }; 510CECA8297F72970064E0B3 /* MTROperationalCertificateIssuerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 510CECA6297F72470064E0B3 /* MTROperationalCertificateIssuerTests.m */; }; 5117DD3829A931AE00FFA1AA /* MTROperationalBrowser.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5117DD3629A931AD00FFA1AA /* MTROperationalBrowser.mm */; }; 5117DD3929A931AE00FFA1AA /* MTROperationalBrowser.h in Headers */ = {isa = PBXBuildFile; fileRef = 5117DD3729A931AE00FFA1AA /* MTROperationalBrowser.h */; }; @@ -417,6 +418,7 @@ 3DFCB32A2966827F00332B35 /* MTRDefines_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDefines_Internal.h; sourceTree = ""; }; 3DFCB32B29678C9500332B35 /* MTRConversion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRConversion.h; sourceTree = ""; }; 51029DF5293AA6100087AFB0 /* MTROperationalCertificateIssuer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTROperationalCertificateIssuer.mm; sourceTree = ""; }; + 510470FA2A2F7DF60053EA7E /* MTRBackwardsCompatShims.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRBackwardsCompatShims.mm; sourceTree = ""; }; 510CECA6297F72470064E0B3 /* MTROperationalCertificateIssuerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTROperationalCertificateIssuerTests.m; sourceTree = ""; }; 5117DD3629A931AD00FFA1AA /* MTROperationalBrowser.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTROperationalBrowser.mm; sourceTree = ""; }; 5117DD3729A931AE00FFA1AA /* MTROperationalBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTROperationalBrowser.h; sourceTree = ""; }; @@ -940,6 +942,7 @@ 513DDB852761F69300DAA01A /* MTRAttributeTLVValueDecoder_Internal.h */, 75B765C02A1D71BC0014719B /* MTRAttributeSpecifiedCheck.h */, 51EF279E2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h */, + 510470FA2A2F7DF60053EA7E /* MTRBackwardsCompatShims.mm */, 51E4D120291D0EB400C8C535 /* MTRBaseClusterUtils.h */, 2C222ADE255C811800E446B9 /* MTRBaseDevice_Internal.h */, 2C222ACE255C620600E446B9 /* MTRBaseDevice.h */, @@ -1440,6 +1443,7 @@ 517BF3F1282B62B800A8B7DB /* MTRCertificates.mm in Sources */, 5A6FEC9627B5983000F25F42 /* MTRDeviceControllerXPCConnection.mm in Sources */, 511913FB28C100EF009235E9 /* MTRBaseSubscriptionCallback.mm in Sources */, + 510470FB2A2F7DF60053EA7E /* MTRBackwardsCompatShims.mm in Sources */, 5173A47629C0E2ED00F67F48 /* MTRFabricInfo.mm in Sources */, 5ACDDD7D27CD16D200EFD68A /* MTRClusterStateCacheContainer.mm in Sources */, 513DDB8A2761F6F900DAA01A /* MTRAttributeTLVValueDecoder.mm in Sources */, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 2b706ed96795e2..f4355d93c88d92 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -39673,54 +39673,6 @@ class ModeSelectChangeToMode : public ClusterCommand { chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; }; -/* - * Command ChangeToModeWithStatus - */ -class ModeSelectChangeToModeWithStatus : public ClusterCommand { -public: - ModeSelectChangeToModeWithStatus() - : ClusterCommand("change-to-mode-with-status") - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRModeSelectClusterChangeToModeWithStatusParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.newMode = [NSNumber numberWithUnsignedChar:mRequest.newMode]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster changeToModeWithStatusWithParams:params - completion:^(MTRModeSelectClusterChangeToModeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::ModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; -}; - /* * Attribute Description */ @@ -161689,7 +161641,6 @@ void registerClusterModeSelect(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // - make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), //