File tree 3 files changed +18
-3
lines changed
src/darwin/Framework/CHIP
3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1313,6 +1313,21 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID
1313
1313
// here for now.
1314
1314
// TODO: https://github.com/project-chip/connectedhomeip/issues/24563
1315
1315
1316
+ if (![commandFields isKindOfClass: NSDictionary .class ]) {
1317
+ MTR_LOG_ERROR (" %@ invokeCommandWithEndpointID passed a commandFields (%@) that is not a data-value NSDictionary object" ,
1318
+ self, commandFields);
1319
+ completion (nil , [MTRError errorForCHIPErrorCode: CHIP_ERROR_INVALID_ARGUMENT]);
1320
+ return ;
1321
+ }
1322
+
1323
+ MTRDeviceDataValueDictionary fieldsDataValue = commandFields;
1324
+ if (fieldsDataValue[MTRTypeKey] != MTRStructureValueType) {
1325
+ MTR_LOG_ERROR (" %@ invokeCommandWithEndpointID passed a commandFields (%@) that is not a structure-typed data-value object" ,
1326
+ self, commandFields);
1327
+ completion (nil , [MTRError errorForCHIPErrorCode: CHIP_ERROR_INVALID_ARGUMENT]);
1328
+ return ;
1329
+ }
1330
+
1316
1331
[self _invokeCommandWithEndpointID: endpointID
1317
1332
clusterID: clusterID
1318
1333
commandID: commandID
@@ -1328,7 +1343,7 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID
1328
1343
- (void )_invokeCommandWithEndpointID : (NSNumber *)endpointID
1329
1344
clusterID : (NSNumber *)clusterID
1330
1345
commandID : (NSNumber *)commandID
1331
- commandFields : (id )commandFields
1346
+ commandFields : (MTRDeviceDataValueDictionary )commandFields
1332
1347
expectedValues : (NSArray <NSDictionary<NSString *, id> *> * _Nullable)expectedValues
1333
1348
expectedValueInterval : (NSNumber * _Nullable)expectedValueInterval
1334
1349
timedInvokeTimeout : (NSNumber * _Nullable)timeout
Original file line number Diff line number Diff line change @@ -2966,7 +2966,7 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID
2966
2966
- (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID
2967
2967
clusterID:(NSNumber *)clusterID
2968
2968
commandID:(NSNumber *)commandID
2969
- commandFields:(id )commandFields
2969
+ commandFields:(MTRDeviceDataValueDictionary )commandFields
2970
2970
expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues
2971
2971
expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval
2972
2972
timedInvokeTimeout:(NSNumber * _Nullable)timeout
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ - (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)di
234
234
- (void )_invokeCommandWithEndpointID: (NSNumber *)endpointID
235
235
clusterID: (NSNumber *)clusterID
236
236
commandID: (NSNumber *)commandID
237
- commandFields: (id )commandFields
237
+ commandFields: (MTRDeviceDataValueDictionary )commandFields
238
238
expectedValues: (NSArray <NSDictionary <NSString *, id > *> * _Nullable)expectedValues
239
239
expectedValueInterval: (NSNumber * _Nullable)expectedValueInterval
240
240
timedInvokeTimeout: (NSNumber * _Nullable)timeout
You can’t perform that action at this time.
0 commit comments