From 87c8e04564b46456d3763472f7729c58e5cb52c0 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 5 Feb 2025 20:34:15 -0500 Subject: [PATCH] Rename expectedResult to requiredResponse in the invokeCommands API. The old naming was too confusing, and this more accurately represents what is actually going on. --- ...ult.h => MTRCommandWithRequiredResponse.h} | 18 ++++----- ...t.mm => MTRCommandWithRequiredResponse.mm} | 40 +++++++++---------- src/darwin/Framework/CHIP/MTRDevice.h | 4 +- src/darwin/Framework/CHIP/MTRDevice.mm | 2 +- .../Framework/CHIP/MTRDeviceController_XPC.mm | 4 +- .../Framework/CHIP/MTRDevice_Concrete.mm | 14 +++---- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 2 +- src/darwin/Framework/CHIP/Matter.h | 2 +- .../CHIP/XPC Protocol/MTRXPCServerProtocol.h | 2 +- .../Framework/CHIPTests/MTRDeviceTests.m | 18 ++++----- .../Matter.xcodeproj/project.pbxproj | 16 ++++---- 11 files changed, 61 insertions(+), 61 deletions(-) rename src/darwin/Framework/CHIP/{MTRCommandWithExpectedResult.h => MTRCommandWithRequiredResponse.h} (74%) rename src/darwin/Framework/CHIP/{MTRCommandWithExpectedResult.mm => MTRCommandWithRequiredResponse.mm} (57%) diff --git a/src/darwin/Framework/CHIP/MTRCommandWithExpectedResult.h b/src/darwin/Framework/CHIP/MTRCommandWithRequiredResponse.h similarity index 74% rename from src/darwin/Framework/CHIP/MTRCommandWithExpectedResult.h rename to src/darwin/Framework/CHIP/MTRCommandWithRequiredResponse.h index e335bc24afc968..385453c19d82d8 100644 --- a/src/darwin/Framework/CHIP/MTRCommandWithExpectedResult.h +++ b/src/darwin/Framework/CHIP/MTRCommandWithRequiredResponse.h @@ -20,11 +20,11 @@ NS_ASSUME_NONNULL_BEGIN /** - * An object representing a single command to be invoked and the expected - * result of invoking it. + * An object representing a single command to be invoked and the response + * required for the invoke to be considered successful. */ MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) -@interface MTRCommandWithExpectedResult : NSObject +@interface MTRCommandWithRequiredResponse : NSObject /** * The path of the command being invoked. @@ -39,22 +39,22 @@ MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) @property (nonatomic, retain, nullable) NSDictionary * commandFields; /** - * The expected result of invoking the command. + * The response that represents this command succeeding. * * If this is nil, that indicates that the invoke is considered successful if it * does not result in an error status response. * - * If this is is not nil, then invoke is considered successful if - * it results in a data response and for each entry in the provided - * expectedResult the field whose field ID matches the key of the entry has a + * If this is is not nil, then the invoke is considered successful if + * the response is a data response and for each entry in the provided + * requiredResponse the field whose field ID matches the key of the entry has a * value that equals the value of the entry. Values of entries are data-value * dictionaries. */ -@property (nonatomic, copy, nullable) NSDictionary *> * expectedResult; +@property (nonatomic, copy, nullable) NSDictionary *> * requiredResponse; - (instancetype)initWithPath:(MTRCommandPath *)path commandFields:(nullable NSDictionary *)commandFields - expectedResult:(nullable NSDictionary *> *)expectedResult; + requiredResponse:(nullable NSDictionary *> *)requiredResponse; @end diff --git a/src/darwin/Framework/CHIP/MTRCommandWithExpectedResult.mm b/src/darwin/Framework/CHIP/MTRCommandWithRequiredResponse.mm similarity index 57% rename from src/darwin/Framework/CHIP/MTRCommandWithExpectedResult.mm rename to src/darwin/Framework/CHIP/MTRCommandWithRequiredResponse.mm index 558b7a1cc8cdcc..ddd289e57f15b5 100644 --- a/src/darwin/Framework/CHIP/MTRCommandWithExpectedResult.mm +++ b/src/darwin/Framework/CHIP/MTRCommandWithRequiredResponse.mm @@ -18,15 +18,15 @@ #import "MTRLogging_Internal.h" #import -@implementation MTRCommandWithExpectedResult +@implementation MTRCommandWithRequiredResponse - (instancetype)initWithPath:(MTRCommandPath *)path commandFields:(nullable NSDictionary *)commandFields - expectedResult:(nullable NSDictionary *> *)expectedResult + requiredResponse:(nullable NSDictionary *> *)requiredResponse { if (self = [super init]) { self.path = path; self.commandFields = commandFields; - self.expectedResult = expectedResult; + self.requiredResponse = requiredResponse; } return self; @@ -34,19 +34,19 @@ - (instancetype)initWithPath:(MTRCommandPath *)path - (id)copyWithZone:(NSZone *)zone { - return [[MTRCommandWithExpectedResult alloc] initWithPath:self.path commandFields:self.commandFields expectedResult:self.expectedResult]; + return [[MTRCommandWithRequiredResponse alloc] initWithPath:self.path commandFields:self.commandFields requiredResponse:self.requiredResponse]; } - (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p, path: %@, fields: %@, expectedResult: %@", NSStringFromClass(self.class), self, self.path, self.commandFields, self.expectedResult]; + return [NSString stringWithFormat:@"<%@: %p, path: %@, fields: %@, requiredResponse: %@", NSStringFromClass(self.class), self, self.path, self.commandFields, self.requiredResponse]; } -#pragma mark - MTRCommandWithExpectedResult NSSecureCoding implementation +#pragma mark - MTRCommandWithRequiredResponse NSSecureCoding implementation static NSString * const sPathKey = @"pathKey"; static NSString * const sFieldsKey = @"fieldsKey"; -static NSString * const sExpectedResultKey = @"expectedResultKey"; +static NSString * const sExpectedResultKey = @"requiredResponseKey"; + (BOOL)supportsSecureCoding { @@ -62,38 +62,38 @@ - (nullable instancetype)initWithCoder:(NSCoder *)decoder _path = [decoder decodeObjectOfClass:MTRCommandPath.class forKey:sPathKey]; if (!_path || ![_path isKindOfClass:MTRCommandPath.class]) { - MTR_LOG_ERROR("MTRCommandWithExpectedResult decoded %@ for endpoint, not MTRCommandPath.", _path); + MTR_LOG_ERROR("MTRCommandWithRequiredResponse decoded %@ for endpoint, not MTRCommandPath.", _path); return nil; } _commandFields = [decoder decodeObjectOfClass:NSDictionary.class forKey:sFieldsKey]; if (_commandFields) { if (![_commandFields isKindOfClass:NSDictionary.class]) { - MTR_LOG_ERROR("MTRCommandWithExpectedResult decoded %@ for commandFields, not NSDictionary.", _commandFields); + MTR_LOG_ERROR("MTRCommandWithRequiredResponse decoded %@ for commandFields, not NSDictionary.", _commandFields); return nil; } if (!MTRDataValueDictionaryIsWellFormed(_commandFields) || ![MTRStructureValueType isEqual:_commandFields[MTRTypeKey]]) { - MTR_LOG_ERROR("MTRCommandWithExpectedResult decoded %@ for commandFields, not a structure-typed data-value dictionary.", _commandFields); + MTR_LOG_ERROR("MTRCommandWithRequiredResponse decoded %@ for commandFields, not a structure-typed data-value dictionary.", _commandFields); return nil; } } - _expectedResult = [decoder decodeObjectOfClass:NSDictionary.class forKey:sExpectedResultKey]; - if (_expectedResult) { - if (![_expectedResult isKindOfClass:NSDictionary.class]) { - MTR_LOG_ERROR("MTRCommandWithExpectedResult decoded %@ for expectedResult, not NSDictionary.", _expectedResult); + _requiredResponse = [decoder decodeObjectOfClass:NSDictionary.class forKey:sExpectedResultKey]; + if (_requiredResponse) { + if (![_requiredResponse isKindOfClass:NSDictionary.class]) { + MTR_LOG_ERROR("MTRCommandWithRequiredResponse decoded %@ for requiredResponse, not NSDictionary.", _requiredResponse); return nil; } - for (id key in _expectedResult) { + for (id key in _requiredResponse) { if (![key isKindOfClass:NSNumber.class]) { - MTR_LOG_ERROR("MTRCommandWithExpectedResult decoded key %@ in expectedResult", key); + MTR_LOG_ERROR("MTRCommandWithRequiredResponse decoded key %@ in requiredResponse", key); return nil; } - if (![_expectedResult[key] isKindOfClass:NSDictionary.class] || !MTRDataValueDictionaryIsWellFormed(_expectedResult[key])) { - MTR_LOG_ERROR("MTRCommandWithExpectedResult decoded value %@ for key %@ in expectedResult", _expectedResult[key], key); + if (![_requiredResponse[key] isKindOfClass:NSDictionary.class] || !MTRDataValueDictionaryIsWellFormed(_requiredResponse[key])) { + MTR_LOG_ERROR("MTRCommandWithRequiredResponse decoded value %@ for key %@ in requiredResponse", _requiredResponse[key], key); return nil; } } @@ -111,8 +111,8 @@ - (void)encodeWithCoder:(NSCoder *)coder if (self.commandFields) { [coder encodeObject:self.commandFields forKey:sFieldsKey]; } - if (self.expectedResult) { - [coder encodeObject:self.expectedResult forKey:sExpectedResultKey]; + if (self.requiredResponse) { + [coder encodeObject:self.requiredResponse forKey:sExpectedResultKey]; } } diff --git a/src/darwin/Framework/CHIP/MTRDevice.h b/src/darwin/Framework/CHIP/MTRDevice.h index 12201d0cafa80a..84cd4ea9c8ebd9 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.h +++ b/src/darwin/Framework/CHIP/MTRDevice.h @@ -19,7 +19,7 @@ #import #import #import -#import +#import #import NS_ASSUME_NONNULL_BEGIN @@ -316,7 +316,7 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * response. In this case the data-value representing the response will be * the value of this field. */ -- (void)invokeCommands:(NSArray *> *)commands +- (void)invokeCommands:(NSArray *> *)commands queue:(dispatch_queue_t)queue completion:(MTRDeviceResponseHandler)completion MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 539bf227a83858..63555c8ebb82b9 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -523,7 +523,7 @@ - (void)_invokeKnownCommandWithEndpointID:(NSNumber *)endpointID completion:responseHandler]; } -- (void)invokeCommands:(NSArray *> *)commands +- (void)invokeCommands:(NSArray *> *)commands queue:(dispatch_queue_t)queue completion:(MTRDeviceResponseHandler)completion { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 2108e6f48fca44..ac8fa523416f80 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -150,10 +150,10 @@ - (NSXPCInterface *)_interfaceForServerProtocol argumentIndex:0 ofReply:YES]; - // invokeCommands gets handed MTRCommandWithExpectedResult (which includes + // invokeCommands gets handed MTRCommandWithRequiredResponse (which includes // MTRCommandPath, which is already in allowedClasses). [allowedClasses addObjectsFromArray:@[ - [MTRCommandWithExpectedResult class], + [MTRCommandWithRequiredResponse class], ]]; [interface setClasses:allowedClasses forSelector:@selector(deviceController:nodeID:invokeCommands:completion:) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index d26aaf9603eff5..0434f4890c2178 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -3306,7 +3306,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID commandFields]; } -- (BOOL)_invokeResponse:(MTRDeviceResponseValueDictionary)response matchesExpectedResult:(NSDictionary *)expectedResult +- (BOOL)_invokeResponse:(MTRDeviceResponseValueDictionary)response matchesRequiredResponse:(NSDictionary *)requiredResponse { if (response[MTRDataKey] == nil) { MTR_LOG_ERROR("%@ invokeCommands expects a data response for %@ but got no data", self, response[MTRCommandPathKey]); @@ -3321,7 +3321,7 @@ - (BOOL)_invokeResponse:(MTRDeviceResponseValueDictionary)response matchesExpect NSArray *> * fields = data[MTRValueKey]; - for (NSNumber * fieldID in expectedResult) { + for (NSNumber * fieldID in requiredResponse) { // Check that this field is present in the response. MTRDeviceDataValueDictionary _Nullable fieldValue = nil; for (NSDictionary * field in fields) { @@ -3336,7 +3336,7 @@ - (BOOL)_invokeResponse:(MTRDeviceResponseValueDictionary)response matchesExpect return NO; } - auto * expected = expectedResult[fieldID]; + auto * expected = requiredResponse[fieldID]; if (![expected isEqual:fieldValue]) { MTR_LOG_ERROR("%@ invokeCommands response for %@ field %@ got %@ but expected %@", self, response[MTRCommandPathKey], fieldID, fieldValue, expected); return NO; @@ -3346,7 +3346,7 @@ - (BOOL)_invokeResponse:(MTRDeviceResponseValueDictionary)response matchesExpect return YES; } -- (void)invokeCommands:(NSArray *> *)commands +- (void)invokeCommands:(NSArray *> *)commands queue:(dispatch_queue_t)queue completion:(MTRDeviceResponseHandler)completion { @@ -3361,10 +3361,10 @@ - (void)invokeCommands:(NSArray *> *)com // We want to invoke the command groups in order, stopping after failures as needed. Build up a // linked list of groups via chaining the completions, with calls out to the original // completion instead of going to the next list item when we want to stop. - for (NSArray * commandGroup in [commands reverseObjectEnumerator]) { + for (NSArray * commandGroup in [commands reverseObjectEnumerator]) { // We want to invoke all the commands in the group in order, propagating along the list of // current responses. Build up that linked list of command invokes via chaining the completions. - for (MTRCommandWithExpectedResult * command in [commandGroup reverseObjectEnumerator]) { + for (MTRCommandWithRequiredResponse * command in [commandGroup reverseObjectEnumerator]) { auto commandInvokeBlock = ^(BOOL allSucceededSoFar, NSArray * previousResponses) { [self invokeCommandWithEndpointID:command.path.endpoint clusterID:command.path.cluster @@ -3394,7 +3394,7 @@ - (void)invokeCommands:(NSArray *> *)com BOOL nextAllSucceeded = allSucceededSoFar; MTRDeviceResponseValueDictionary response = responses[0]; - if (command.expectedResult != nil && ![self _invokeResponse:response matchesExpectedResult:command.expectedResult]) { + if (command.requiredResponse != nil && ![self _invokeResponse:response matchesRequiredResponse:command.requiredResponse]) { nextAllSucceeded = NO; } diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index f1133c14286f93..31cf08287657d7 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -459,7 +459,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID } } -- (void)invokeCommands:(NSArray *> *)commands +- (void)invokeCommands:(NSArray *> *)commands queue:(dispatch_queue_t)queue completion:(MTRDeviceResponseHandler)completion { diff --git a/src/darwin/Framework/CHIP/Matter.h b/src/darwin/Framework/CHIP/Matter.h index 2e5fceac068392..9f7211c682ece1 100644 --- a/src/darwin/Framework/CHIP/Matter.h +++ b/src/darwin/Framework/CHIP/Matter.h @@ -34,7 +34,7 @@ #import #import #import -#import +#import #import #import #import diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index cbe133b8eebf1b..4e4f6a456de8be 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -52,7 +52,7 @@ MTR_AVAILABLE(ios(18.2), macos(15.2), watchos(11.2), tvos(18.2)) */ - (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID downloadLogOfType:(MTRDiagnosticLogType)type timeout:(NSTimeInterval)timeout completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; -- (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID invokeCommands:(NSArray *> *)commands completion:(MTRDeviceResponseHandler)completion MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); +- (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID invokeCommands:(NSArray *> *)commands completion:(MTRDeviceResponseHandler)completion MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); @end diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index ae8571fe85642c..71f6aa29fb35d2 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -5742,9 +5742,9 @@ - (void)test045_MTRDeviceInvokeGroups clusterID:@(MTRClusterIDTypeOnOffID) commandID:@(MTRCommandIDTypeClusterOnOffCommandOffID)]; - __auto_type * onCommand = [[MTRCommandWithExpectedResult alloc] initWithPath:onPath commandFields:nil expectedResult:nil]; - __auto_type * toggleCommand = [[MTRCommandWithExpectedResult alloc] initWithPath:togglePath commandFields:nil expectedResult:nil]; - __auto_type * offCommand = [[MTRCommandWithExpectedResult alloc] initWithPath:offPath commandFields:nil expectedResult:nil]; + __auto_type * onCommand = [[MTRCommandWithRequiredResponse alloc] initWithPath:onPath commandFields:nil requiredResponse:nil]; + __auto_type * toggleCommand = [[MTRCommandWithRequiredResponse alloc] initWithPath:togglePath commandFields:nil requiredResponse:nil]; + __auto_type * offCommand = [[MTRCommandWithRequiredResponse alloc] initWithPath:offPath commandFields:nil requiredResponse:nil]; XCTestExpectation * simpleInvokeDone = [self expectationWithDescription:@"Invoke of a single 3-command group done"]; [device invokeCommands:@[ @[ onCommand, toggleCommand, offCommand ] ] @@ -5773,7 +5773,7 @@ - (void)test045_MTRDeviceInvokeGroups __auto_type * failingTogglePath = [MTRCommandPath commandPathWithEndpointID:@(1000) // No such endpoint clusterID:@(MTRClusterIDTypeOnOffID) commandID:@(MTRCommandIDTypeClusterOnOffCommandToggleID)]; - __auto_type * failingToggleCommand = [[MTRCommandWithExpectedResult alloc] initWithPath:failingTogglePath commandFields:nil expectedResult:nil]; + __auto_type * failingToggleCommand = [[MTRCommandWithRequiredResponse alloc] initWithPath:failingTogglePath commandFields:nil requiredResponse:nil]; XCTestExpectation * failingWithStatusInvokeDone = [self expectationWithDescription:@"Invoke of commands where one fails with a status done"]; [device invokeCommands:@[ @[ failingToggleCommand, offCommand ], @[ onCommand, toggleCommand ], @[ failingToggleCommand ] ] @@ -5801,7 +5801,7 @@ - (void)test045_MTRDeviceInvokeGroups // Third test: Do an invoke with three groups. One of the commands in the // first group expects a data response but gets a status, which should be // treated as a failure. - __auto_type * onCommandExpectingData = [[MTRCommandWithExpectedResult alloc] initWithPath:onPath commandFields:nil expectedResult:@{ + __auto_type * onCommandExpectingData = [[MTRCommandWithRequiredResponse alloc] initWithPath:onPath commandFields:nil requiredResponse:@{ @(0) : @ { MTRTypeKey : MTRUnsignedIntegerValueType, MTRValueKey : @(0), @@ -5850,7 +5850,7 @@ - (void)test045_MTRDeviceInvokeGroups }, ] }; - __auto_type * updateFabricLabelNotExpectingFailureCommand = [[MTRCommandWithExpectedResult alloc] initWithPath:updateFabricLabelPath commandFields:updateFabricLabelFields expectedResult:nil]; + __auto_type * updateFabricLabelNotExpectingFailureCommand = [[MTRCommandWithRequiredResponse alloc] initWithPath:updateFabricLabelPath commandFields:updateFabricLabelFields requiredResponse:nil]; XCTestExpectation * updateFabricLabelNotExpectingFailureExpectation = [self expectationWithDescription:@"Invoke of commands where no failure is expected and data response is received done"]; [device invokeCommands:@[ @[ updateFabricLabelNotExpectingFailureCommand, onCommand ], @[ offCommand ] ] @@ -5889,7 +5889,7 @@ - (void)test045_MTRDeviceInvokeGroups // Fifth test: do an invoke with two groups. One of the commands in the // first group expects to get a data response and gets it, which should be // treated as success. - __auto_type * updateFabricLabelExpectingOKCommand = [[MTRCommandWithExpectedResult alloc] initWithPath:updateFabricLabelPath commandFields:updateFabricLabelFields expectedResult:@{ + __auto_type * updateFabricLabelExpectingOKCommand = [[MTRCommandWithRequiredResponse alloc] initWithPath:updateFabricLabelPath commandFields:updateFabricLabelFields requiredResponse:@{ @(0) : @ { MTRTypeKey : MTRUnsignedIntegerValueType, MTRValueKey : @(MTROperationalCredentialsNodeOperationalCertStatusOK), @@ -5933,7 +5933,7 @@ - (void)test045_MTRDeviceInvokeGroups // Sixth test: do an invoke with two groups. One of the commands in the // first group expects to get a data response with a field that it does not get, which should be // treated as failure. - __auto_type * updateFabricLabelExpectingNonexistentFieldCommand = [[MTRCommandWithExpectedResult alloc] initWithPath:updateFabricLabelPath commandFields:updateFabricLabelFields expectedResult:@{ + __auto_type * updateFabricLabelExpectingNonexistentFieldCommand = [[MTRCommandWithRequiredResponse alloc] initWithPath:updateFabricLabelPath commandFields:updateFabricLabelFields requiredResponse:@{ @(20) : @ { MTRTypeKey : MTRUnsignedIntegerValueType, MTRValueKey : @(MTROperationalCredentialsNodeOperationalCertStatusOK), @@ -5975,7 +5975,7 @@ - (void)test045_MTRDeviceInvokeGroups // Seventh test: do an invoke with two groups. One of the commands in the // first group expects to get a data response with a field value that does // not match what it gets, which should be treated as a failure. - __auto_type * updateFabricLabelExpectingWrongValueCommand = [[MTRCommandWithExpectedResult alloc] initWithPath:updateFabricLabelPath commandFields:updateFabricLabelFields expectedResult:@{ + __auto_type * updateFabricLabelExpectingWrongValueCommand = [[MTRCommandWithRequiredResponse alloc] initWithPath:updateFabricLabelPath commandFields:updateFabricLabelFields requiredResponse:@{ @(0) : @ { MTRTypeKey : MTRUnsignedIntegerValueType, MTRValueKey : @(MTROperationalCredentialsNodeOperationalCertStatusFabricConflict), diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index c6f16a39205c39..ae59758c821033 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -159,8 +159,8 @@ 512431282BA0C8BF000BC136 /* SetMRPParametersCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5124311C2BA0C09A000BC136 /* SetMRPParametersCommand.mm */; }; 512431292BA0C8BF000BC136 /* ResetMRPParametersCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5124311A2BA0C09A000BC136 /* ResetMRPParametersCommand.mm */; }; 5129BCFD26A9EE3300122DDF /* MTRError.h in Headers */ = {isa = PBXBuildFile; fileRef = 5129BCFC26A9EE3300122DDF /* MTRError.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 512E8E7A2D52F7B6009407E3 /* MTRCommandWithExpectedResult.mm in Sources */ = {isa = PBXBuildFile; fileRef = 512E8E792D52F7B6009407E3 /* MTRCommandWithExpectedResult.mm */; }; - 512E8E7B2D52F7B6009407E3 /* MTRCommandWithExpectedResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 512E8E782D52F7B6009407E3 /* MTRCommandWithExpectedResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 512E8E7A2D52F7B6009407E3 /* MTRCommandWithRequiredResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 512E8E792D52F7B6009407E3 /* MTRCommandWithRequiredResponse.mm */; }; + 512E8E7B2D52F7B6009407E3 /* MTRCommandWithRequiredResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 512E8E782D52F7B6009407E3 /* MTRCommandWithRequiredResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5131BF662BE2E1B000D5D6BC /* MTRTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5131BF642BE2E1B000D5D6BC /* MTRTestCase.mm */; }; 51339B1F2A0DA64D00C798C1 /* MTRCertificateValidityTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51339B1E2A0DA64D00C798C1 /* MTRCertificateValidityTests.m */; }; 5136661328067D550025EDAE /* MTRDeviceController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5136660F28067D540025EDAE /* MTRDeviceController_Internal.h */; }; @@ -674,8 +674,8 @@ 5124311B2BA0C09A000BC136 /* SetMRPParametersCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetMRPParametersCommand.h; sourceTree = ""; }; 5124311C2BA0C09A000BC136 /* SetMRPParametersCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SetMRPParametersCommand.mm; sourceTree = ""; }; 5129BCFC26A9EE3300122DDF /* MTRError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRError.h; sourceTree = ""; }; - 512E8E782D52F7B6009407E3 /* MTRCommandWithExpectedResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommandWithExpectedResult.h; sourceTree = ""; }; - 512E8E792D52F7B6009407E3 /* MTRCommandWithExpectedResult.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommandWithExpectedResult.mm; sourceTree = ""; }; + 512E8E782D52F7B6009407E3 /* MTRCommandWithRequiredResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommandWithRequiredResponse.h; sourceTree = ""; }; + 512E8E792D52F7B6009407E3 /* MTRCommandWithRequiredResponse.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommandWithRequiredResponse.mm; sourceTree = ""; }; 5131BF642BE2E1B000D5D6BC /* MTRTestCase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRTestCase.mm; sourceTree = ""; }; 5131BF652BE2E1B000D5D6BC /* MTRTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRTestCase.h; sourceTree = ""; }; 51339B1E2A0DA64D00C798C1 /* MTRCertificateValidityTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRCertificateValidityTests.m; sourceTree = ""; }; @@ -1518,8 +1518,8 @@ 5178E67F2AE098510069DF72 /* MTRCommandTimedCheck.h */, 51FE723E2ACDEF3E00437032 /* MTRCommandPayloadExtensions_Internal.h */, 5178E6802AE098520069DF72 /* MTRCommissionableBrowserResult_Internal.h */, - 512E8E782D52F7B6009407E3 /* MTRCommandWithExpectedResult.h */, - 512E8E792D52F7B6009407E3 /* MTRCommandWithExpectedResult.mm */, + 512E8E782D52F7B6009407E3 /* MTRCommandWithRequiredResponse.h */, + 512E8E792D52F7B6009407E3 /* MTRCommandWithRequiredResponse.mm */, 3D010DCD2D408FA300CFFA02 /* MTRCommissioneeInfo.h */, 3D010DD12D4091C800CFFA02 /* MTRCommissioneeInfo_Internal.h */, 3D010DCE2D408FA300CFFA02 /* MTRCommissioneeInfo.mm */, @@ -1953,7 +1953,7 @@ AF1CB86E2874B03B00865A96 /* MTROTAProviderDelegate.h in Headers */, 51D0B1402B61B3A4006E3511 /* MTRServerCluster.h in Headers */, 754F3DF427FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h in Headers */, - 512E8E7B2D52F7B6009407E3 /* MTRCommandWithExpectedResult.h in Headers */, + 512E8E7B2D52F7B6009407E3 /* MTRCommandWithRequiredResponse.h in Headers */, 3CF134AF289D90FF0017A19E /* MTROperationalCertificateIssuer.h in Headers */, 5178E6822AE098520069DF72 /* MTRCommissionableBrowserResult_Internal.h in Headers */, 516415FD2B6ACA8300D5CE11 /* MTRServerAccessControl.h in Headers */, @@ -2393,7 +2393,7 @@ 514C79F02B62ADDA00DD6D7B /* descriptor.cpp in Sources */, 5109E9B42CB8B5DF0006884B /* MTRDeviceType.mm in Sources */, 3D843757294AD25A0070D20A /* MTRCertificateInfo.mm in Sources */, - 512E8E7A2D52F7B6009407E3 /* MTRCommandWithExpectedResult.mm in Sources */, + 512E8E7A2D52F7B6009407E3 /* MTRCommandWithRequiredResponse.mm in Sources */, 3D9F2FCE2D112295003CA2BB /* MTRAttributeTLVValueDecoder_Internal.mm in Sources */, 5A7947E427C0129600434CF2 /* MTRDeviceController+XPC.mm in Sources */, 7592BD0B2CC6BCC300EB74A0 /* EmberAttributeDataBuffer.cpp in Sources */,