From 7cd7a9ef14bb599e7fefd53d6f6c55104f3b7102 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 17 Nov 2022 11:33:08 -0500 Subject: [PATCH] Add missing endWork calls in MTRClusters. (#23659) We were missing endWork bits for command invokes when the command has a data (not status) response. This would end up permanently blocking the MTRDevice's work queue once such a command (e.g. UpdateFabricLabel) was issued. The changes here are as follows: 1) Rearrange the logic in MTRClusters-src.zapt so that the endWork happens regardless of whether hasSpecificResponse is true. 2) Add a deprecation message to the timedInvokeTimeoutMs field in _response_ command params, since that should never be used (ran into this when writing the tests for this PR). 3) Set resubscribeIfLost to NO on various subscriptions in MTRDeviceTests, so if another test takes a while we don't fail due to the canceled subscriptions re-subscribing and over-fullfilling the subscription expectations. 4) Add a test for a mix of passing and failing commands on MTRCluster instances, with some of the commands defined as getting status-only responses and some defined as getting data responses. This test fails without the endWork fix. --- .../CHIP/templates/MTRClusters-src.zapt | 10 +- .../templates/MTRCommandPayloadsObjc.zapt | 2 +- .../CHIP/zap-generated/MTRClusters.mm | 571 +++++++++++++++--- .../zap-generated/MTRCommandPayloadsObjc.h | 168 ++++-- .../Framework/CHIPTests/MTRDeviceTests.m | 89 +++ 5 files changed, 687 insertions(+), 153 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt index fa78f8f0439559..c427058683ea2d 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -62,19 +62,19 @@ using chip::SessionHandle; MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice *baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * bridge = new MTR{{>callbackName}}CallbackBridge(self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { {{#if hasSpecificResponse}} {{! This treats completion as taking an id for the data. This is not great from a type-safety perspective, of course. }} - completion, + completion(value, error); {{else}} {{! For now, don't change the bridge API; instead just use an adapter to invoke our completion handler. This is not great from a type-safety perspective, of course. }} - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - [workItem endWork]; - }, + completion(error); {{/if}} + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, {{>callbackName}}CallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { chip::Optional timedInvokeTimeoutMs; ListFreer listFreer; diff --git a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt index 78a0c88f39d69f..3fab331d0edf2c 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt @@ -31,7 +31,7 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs {{#if (isStrEqual source "server")}}MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"){{/if}}; - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index f913d7b09f4e67..8476a3f78293bc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -291,7 +291,12 @@ - (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRGroupsClusterAddGroupResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRGroupsClusterAddGroupResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupsClusterAddGroupResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { chip::Optional timedInvokeTimeoutMs; @@ -337,7 +342,12 @@ - (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRGroupsClusterViewGroupResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRGroupsClusterViewGroupResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupsClusterViewGroupResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { chip::Optional timedInvokeTimeoutMs; @@ -382,7 +392,12 @@ - (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams * MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRGroupsClusterGetGroupMembershipResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRGroupsClusterGetGroupMembershipResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupsClusterGetGroupMembershipResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -449,7 +464,12 @@ - (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRGroupsClusterRemoveGroupResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRGroupsClusterRemoveGroupResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupsClusterRemoveGroupResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -761,7 +781,12 @@ - (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterAddSceneResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterAddSceneResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterAddSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { chip::Optional timedInvokeTimeoutMs; @@ -883,7 +908,12 @@ - (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterViewSceneResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterViewSceneResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterViewSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { chip::Optional timedInvokeTimeoutMs; @@ -929,7 +959,12 @@ - (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterRemoveSceneResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterRemoveSceneResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterRemoveSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -976,7 +1011,12 @@ - (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)param MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterRemoveAllScenesResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterRemoveAllScenesResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterRemoveAllScenesResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -1022,7 +1062,12 @@ - (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterStoreSceneResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterStoreSceneResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterStoreSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { chip::Optional timedInvokeTimeoutMs; @@ -1127,7 +1172,12 @@ - (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams * MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterGetSceneMembershipResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterGetSceneMembershipResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterGetSceneMembershipResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -1173,7 +1223,12 @@ - (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)par MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterEnhancedAddSceneResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterEnhancedAddSceneResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterEnhancedAddSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -1296,7 +1351,12 @@ - (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)p MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterEnhancedViewSceneResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterEnhancedViewSceneResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterEnhancedViewSceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -1343,7 +1403,12 @@ - (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRScenesClusterCopySceneResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRScenesClusterCopySceneResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ScenesClusterCopySceneResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { chip::Optional timedInvokeTimeoutMs; @@ -5026,7 +5091,12 @@ - (void)queryImageWithParams:(MTROtaSoftwareUpdateProviderClusterQueryImageParam MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OtaSoftwareUpdateProviderClusterQueryImageResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -5114,7 +5184,12 @@ - (void)applyUpdateRequestWithParams:(MTROtaSoftwareUpdateProviderClusterApplyUp MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -6225,7 +6300,12 @@ - (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams * MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, GeneralCommissioningClusterArmFailSafeResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -6272,7 +6352,12 @@ - (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulato MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, GeneralCommissioningClusterSetRegulatoryConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -6334,21 +6419,25 @@ - (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissio MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge - = new MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(self.callbackQueue, completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, - GeneralCommissioningClusterCommissioningCompleteResponseCallbackType successCb, MTRErrorCallback failureCb, - MTRCallbackBridgeBase * bridge) { - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - GeneralCommissioning::Commands::CommissioningComplete::Type request; - if (timedInvokeTimeoutMsParam != nil) { - timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); - } + auto * bridge = new MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + GeneralCommissioningClusterCommissioningCompleteResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GeneralCommissioning::Commands::CommissioningComplete::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } - chip::Controller::GeneralCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); - }); + chip::Controller::GeneralCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); + }); std::move(*bridge).DispatchAction(baseDevice); }; workItem.readyHandler = readyHandler; @@ -6567,7 +6656,12 @@ - (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterScanNetworksResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -6627,7 +6721,12 @@ - (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpd MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterNetworkConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -6678,7 +6777,12 @@ - (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrU MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterNetworkConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -6728,7 +6832,12 @@ - (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkPara MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterNetworkConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -6778,7 +6887,12 @@ - (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkPa MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterConnectNetworkResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -6828,7 +6942,12 @@ - (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkPa MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, NetworkCommissioningClusterNetworkConfigResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -7122,7 +7241,12 @@ - (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsReque MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DiagnosticLogsClusterRetrieveLogsResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -9352,7 +9476,12 @@ - (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestatio MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROperationalCredentialsClusterAttestationResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROperationalCredentialsClusterAttestationResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterAttestationResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -9398,7 +9527,12 @@ - (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCerti MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterCertificateChainResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -9444,7 +9578,12 @@ - (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams * MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROperationalCredentialsClusterCSRResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROperationalCredentialsClusterCSRResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterCSRResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -9494,7 +9633,12 @@ - (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterNOCResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -9548,7 +9692,12 @@ - (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)p MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterNOCResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -9598,7 +9747,12 @@ - (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabri MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterNOCResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -9644,7 +9798,12 @@ - (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricPara MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTROperationalCredentialsClusterNOCResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, OperationalCredentialsClusterNOCResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -10057,7 +10216,12 @@ - (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)par MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupKeyManagementClusterKeySetReadResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -10152,7 +10316,12 @@ - (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAl MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -11064,7 +11233,12 @@ - (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetWeekDayScheduleResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -11213,7 +11387,12 @@ - (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetYearDayScheduleResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -11363,7 +11542,12 @@ - (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetHolidayScheduleResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -11544,7 +11728,12 @@ - (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRDoorLockClusterGetUserResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRDoorLockClusterGetUserResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetUserResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { chip::Optional timedInvokeTimeoutMs; @@ -11641,7 +11830,12 @@ - (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRDoorLockClusterSetCredentialResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRDoorLockClusterSetCredentialResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterSetCredentialResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -11716,7 +11910,12 @@ - (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusPara MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DoorLockClusterGetCredentialStatusResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -14349,7 +14548,12 @@ - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ThermostatClusterGetWeeklyScheduleResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19238,7 +19442,12 @@ - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRChannelClusterChangeChannelResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRChannelClusterChangeChannelResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ChannelClusterChangeChannelResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19507,7 +19716,12 @@ - (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, TargetNavigatorClusterNavigateTargetResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19661,7 +19875,12 @@ - (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19713,7 +19932,12 @@ - (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19768,7 +19992,12 @@ - (void)stopPlaybackWithParams:(MTRMediaPlaybackClusterStopPlaybackParams * _Nul MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19823,7 +20052,12 @@ - (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable) MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19875,7 +20109,12 @@ - (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)pa MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19927,7 +20166,12 @@ - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -19979,7 +20223,12 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -20034,7 +20283,12 @@ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nulla MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -20079,7 +20333,12 @@ - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -20125,7 +20384,12 @@ - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)para MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -20171,7 +20435,12 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, MediaPlaybackClusterPlaybackResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -21065,7 +21334,12 @@ - (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRKeypadInputClusterSendKeyResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRKeypadInputClusterSendKeyResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, KeypadInputClusterSendKeyResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -21191,7 +21465,12 @@ - (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *) MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRContentLauncherClusterLaunchResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRContentLauncherClusterLaunchResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ContentLauncherClusterLaunchResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -21294,7 +21573,12 @@ - (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRContentLauncherClusterLaunchResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRContentLauncherClusterLaunchResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ContentLauncherClusterLaunchResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -21771,7 +22055,12 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ApplicationLauncherClusterLauncherResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -21822,7 +22111,12 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ApplicationLauncherClusterLauncherResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -21869,7 +22163,12 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRApplicationLauncherClusterLauncherResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, ApplicationLauncherClusterLauncherResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -22189,7 +22488,12 @@ - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRAccountLoginClusterGetSetupPINResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRAccountLoginClusterGetSetupPINResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, AccountLoginClusterGetSetupPINResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24018,7 +24322,12 @@ - (void)testSpecificWithParams:(MTRUnitTestingClusterTestSpecificParams * _Nulla MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestSpecificResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestSpecificResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestSpecificResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24120,7 +24429,12 @@ - (void)testAddArgumentsWithParams:(MTRUnitTestingClusterTestAddArgumentsParams MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestAddArgumentsResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestAddArgumentsResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestAddArgumentsResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24167,7 +24481,12 @@ - (void)testSimpleArgumentRequestWithParams:(MTRUnitTestingClusterTestSimpleArgu MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestSimpleArgumentResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestSimpleArgumentResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestSimpleArgumentResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24214,7 +24533,12 @@ - (void)testStructArrayArgumentRequestWithParams:(MTRUnitTestingClusterTestStruc MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestStructArrayArgumentResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestStructArrayArgumentResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestStructArrayArgumentResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24471,7 +24795,12 @@ - (void)testStructArgumentRequestWithParams:(MTRUnitTestingClusterTestStructArgu MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24524,7 +24853,12 @@ - (void)testNestedStructArgumentRequestWithParams:(MTRUnitTestingClusterTestNest MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24581,7 +24915,12 @@ - (void)testListStructArgumentRequestWithParams:(MTRUnitTestingClusterTestListSt MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24657,7 +24996,12 @@ - (void)testListInt8UArgumentRequestWithParams:(MTRUnitTestingClusterTestListInt MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24724,7 +25068,12 @@ - (void)testNestedStructListArgumentRequestWithParams:(MTRUnitTestingClusterTest MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -24879,7 +25228,12 @@ - (void)testListNestedStructListArgumentRequestWithParams: MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterBooleanResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterBooleanResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -25058,7 +25412,12 @@ - (void)testListInt8UReverseRequestWithParams:(MTRUnitTestingClusterTestListInt8 MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestListInt8UReverseResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestListInt8UReverseResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestListInt8UReverseResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -25125,7 +25484,12 @@ - (void)testEnumsRequestWithParams:(MTRUnitTestingClusterTestEnumsRequestParams MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestEnumsResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestEnumsResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestEnumsResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -25172,7 +25536,12 @@ - (void)testNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestNullable MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestNullableOptionalResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestNullableOptionalResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestNullableOptionalResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -25230,7 +25599,12 @@ - (void)testComplexNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestC MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestComplexNullableOptionalResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestComplexNullableOptionalResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestComplexNullableOptionalResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -25445,7 +25819,12 @@ - (void)simpleStructEchoRequestWithParams:(MTRUnitTestingClusterSimpleStructEcho MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterSimpleStructResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterSimpleStructResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterSimpleStructResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -25612,7 +25991,12 @@ - (void)testEmitTestEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestEve MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestEmitTestEventResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestEmitTestEventResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestEmitTestEventResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { @@ -25663,7 +26047,12 @@ - (void)testEmitTestEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestEve MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackBridge(self.callbackQueue, completion, + auto * bridge = new MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(value, error); + [workItem endWork]; + }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, UnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 6c5241cd905979..275e2e46bcd9db 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -109,7 +109,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -157,7 +158,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -203,7 +205,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -249,7 +252,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -349,7 +353,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -405,7 +410,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -455,7 +461,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -501,7 +508,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -551,7 +559,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -627,7 +636,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -683,7 +693,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -739,7 +750,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -795,7 +807,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -1557,7 +1570,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -1605,7 +1619,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -1707,7 +1722,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -1757,7 +1773,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -1801,7 +1818,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -1853,7 +1871,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -1953,7 +1972,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2003,7 +2023,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2083,7 +2104,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2331,7 +2353,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2375,7 +2398,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2423,7 +2447,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2503,7 +2528,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2635,7 +2661,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2701,7 +2728,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2885,7 +2913,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -2991,7 +3020,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -3095,7 +3125,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -3213,7 +3244,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -3293,7 +3325,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -3345,7 +3378,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -3609,7 +3643,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -4289,7 +4324,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -4383,7 +4419,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -4611,7 +4648,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -4783,7 +4821,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -4859,7 +4898,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -4997,7 +5037,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5041,7 +5082,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5113,7 +5155,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5165,7 +5208,8 @@ NS_ASSUME_NONNULL_BEGIN * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5240,7 +5284,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5294,7 +5339,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5348,7 +5394,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5412,7 +5459,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5470,7 +5518,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5528,7 +5577,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5600,7 +5650,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5710,7 +5761,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5767,7 +5819,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5823,7 +5876,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5879,7 +5933,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @@ -5936,7 +5991,8 @@ MTR_NEWLY_AVAILABLE * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy, nullable) + NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 2a7afeb112de66..db8e1050622e19 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -770,6 +770,7 @@ - (void)test011_ReadCachedAttribute // reportHandler returns TRUE if it got the things it was looking for or if there's an error. __block BOOL (^reportHandler)(NSArray * _Nullable value, NSError * _Nullable error); __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(2) maxInterval:@(60)]; + params.resubscribeIfLost = NO; [device subscribeWithQueue:queue params:params clusterStateCacheContainer:clusterStateCacheContainer @@ -836,6 +837,7 @@ - (void)test011_ReadCachedAttribute XCTestExpectation * newSubscriptionEstablished = [self expectationWithDescription:@"New subscription established"]; MTRSubscribeParams * newParams = [[MTRSubscribeParams alloc] initWithMinInterval:@(2) maxInterval:@(60)]; newParams.replaceExistingSubscriptions = NO; + newParams.resubscribeIfLost = NO; [cluster subscribeAttributeOnOffWithParams:newParams subscriptionEstablished:^{ NSLog(@"New subscription was established"); @@ -1023,6 +1025,7 @@ - (void)test012_SubscriptionError // Subscribe XCTestExpectation * expectation = [self expectationWithDescription:@"subscribe OnOff attribute"]; MTRSubscribeParams * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(1) maxInterval:@(10)]; + params.resubscribeIfLost = NO; [device subscribeToAttributesWithEndpointID:@1 clusterID:@6 attributeID:@0 @@ -1432,6 +1435,91 @@ - (void)test018_SubscriptionErrorWhenNotResubscribing [self waitForExpectations:@[ errorExpectation ] timeout:60]; } +- (void)test019_MTRDeviceMultipleCommands +{ +#if MANUAL_INDIVIDUAL_TEST + [self initStack]; + [self waitForCommissionee]; +#endif + + __auto_type * device = [MTRDevice deviceWithNodeID:kDeviceId deviceController:sController]; + dispatch_queue_t queue = dispatch_get_main_queue(); + + __auto_type * opcredsCluster = [[MTRClusterOperationalCredentials alloc] initWithDevice:device endpointID:@(0) queue:queue]; + __auto_type * onOffCluster = [[MTRClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:queue]; + __auto_type * badOnOffCluster = [[MTRClusterOnOff alloc] initWithDevice:device endpointID:@(0) queue:queue]; + + XCTestExpectation * onExpectation = [self expectationWithDescription:@"On command executed"]; + [onOffCluster onWithParams:nil + expectedValues:nil + expectedValueInterval:nil + completion:^(NSError * _Nullable error) { + XCTAssertNil(error); + [onExpectation fulfill]; + }]; + + XCTestExpectation * offFailedExpectation = [self expectationWithDescription:@"Off command failed"]; + [badOnOffCluster offWithParams:nil + expectedValues:nil + expectedValueInterval:nil + completion:^(NSError * _Nullable error) { + XCTAssertNotNil(error); + [offFailedExpectation fulfill]; + }]; + + XCTestExpectation * updateLabelExpectation = [self expectationWithDescription:@"Fabric label updated"]; + __auto_type * params = [[MTROperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; + params.label = @("Test"); + [opcredsCluster updateFabricLabelWithParams:params + expectedValues:nil + expectedValueInterval:nil + completion:^(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error) { + XCTAssertNil(error); + XCTAssertNotNil(data); + XCTAssertEqualObjects(data.statusCode, @(0)); + XCTAssertNotNil(data.fabricIndex); + [updateLabelExpectation fulfill]; + }]; + + XCTestExpectation * offExpectation = [self expectationWithDescription:@"Off command executed"]; + [onOffCluster offWithParams:nil + expectedValues:nil + expectedValueInterval:nil + completion:^(NSError * _Nullable error) { + XCTAssertNil(error); + [offExpectation fulfill]; + }]; + + XCTestExpectation * onFailedExpectation = [self expectationWithDescription:@"On command failed"]; + [badOnOffCluster onWithParams:nil + expectedValues:nil + expectedValueInterval:nil + completion:^(NSError * _Nullable error) { + XCTAssertNotNil(error); + [onFailedExpectation fulfill]; + }]; + + XCTestExpectation * updateLabelFailedExpectation = [self expectationWithDescription:@"Fabric label update failed"]; + params.label = @("12345678901234567890123445678901234567890"); // Too long + [opcredsCluster updateFabricLabelWithParams:params + expectedValues:nil + expectedValueInterval:nil + completion:^(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error) { + XCTAssertNotNil(error); + XCTAssertNil(data); + [updateLabelFailedExpectation fulfill]; + }]; + + [self waitForExpectations:@[ + onExpectation, offFailedExpectation, updateLabelExpectation, offExpectation, onFailedExpectation, + updateLabelFailedExpectation + ] + timeout:60 + enforceOrder:YES]; +} + - (void)test900_SubscribeAllAttributes { #if MANUAL_INDIVIDUAL_TEST @@ -1453,6 +1541,7 @@ - (void)test900_SubscribeAllAttributes __block void (^reportHandler)(id _Nullable values, NSError * _Nullable error) = nil; MTRSubscribeParams * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(2) maxInterval:@(10)]; + params.resubscribeIfLost = NO; [device subscribeToAttributesWithEndpointID:@1 clusterID:@6 attributeID:@0xffffffff