From 4c406889b74ba6658cff4e189a99675522cf0f5c Mon Sep 17 00:00:00 2001 From: Juan Erasmo Trejo Date: Tue, 21 Jan 2025 22:21:56 +0000 Subject: [PATCH] Added missing commands to refrigerator alarm. --- .../all-clusters-app.matter | 13 ++ ...eraturecontrolledcabinet_ffdb696680.matter | 13 ++ .../data_model/refrigerator-thread-app.matter | 13 ++ .../data_model/refrigerator-wifi-app.matter | 13 ++ .../data-model/chip/refrigerator-alarm.xml | 14 ++ .../data_model/controller-clusters.matter | 13 ++ .../devicecontroller/ClusterIDMapping.java | 40 ++++- .../python/chip/clusters/CHIPClusters.py | 14 ++ .../python/chip/clusters/Objects.py | 33 ++++ .../CHIP/zap-generated/MTRBaseClusters.h | 13 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 49 ++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 4 + .../CHIP/zap-generated/MTRClusterNames.mm | 8 + .../CHIP/zap-generated/MTRClusters.h | 7 +- .../CHIP/zap-generated/MTRClusters.mm | 54 ++++++ .../zap-generated/MTRCommandPayloadsObjc.h | 60 +++++++ .../zap-generated/MTRCommandPayloadsObjc.mm | 158 ++++++++++++++++++ .../MTRCommandPayloads_Internal.h | 12 ++ .../app-common/zap-generated/callback.h | 12 ++ .../zap-generated/cluster-objects.cpp | 78 ++++++++- .../zap-generated/cluster-objects.h | 82 +++++++++ .../app-common/zap-generated/ids/Commands.h | 14 ++ .../zap-generated/cluster/Commands.h | 81 ++++++++- .../cluster/logging/EntryToText.cpp | 11 ++ .../zap-generated/cluster/Commands.h | 115 +++++++++++++ 25 files changed, 918 insertions(+), 6 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index be6f4c0622c94a..6ec108dda3135b 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3419,6 +3419,19 @@ cluster RefrigeratorAlarm = 87 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct ResetRequest { + AlarmBitmap alarms = 0; + } + + request struct ModifyEnabledAlarmsRequest { + AlarmBitmap mask = 0; + } + + /** Reset alarm */ + command Reset(ResetRequest): DefaultSuccess = 0; + /** Modify enabled alarms */ + command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1; } /** Attributes and commands for selecting a mode from a list of supported options. */ diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 686d67e3fa49aa..fd198e72c50149 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -1371,6 +1371,19 @@ cluster RefrigeratorAlarm = 87 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct ResetRequest { + AlarmBitmap alarms = 0; + } + + request struct ModifyEnabledAlarmsRequest { + AlarmBitmap mask = 0; + } + + /** Reset alarm */ + command Reset(ResetRequest): DefaultSuccess = 0; + /** Modify enabled alarms */ + command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1; } /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter index 838776ac2a823b..8fb41134001727 100644 --- a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter @@ -1710,6 +1710,19 @@ cluster RefrigeratorAlarm = 87 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct ResetRequest { + AlarmBitmap alarms = 0; + } + + request struct ModifyEnabledAlarmsRequest { + AlarmBitmap mask = 0; + } + + /** Reset alarm */ + command Reset(ResetRequest): DefaultSuccess = 0; + /** Modify enabled alarms */ + command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1; } endpoint 0 { diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter index 530f00d32fd7ab..67aadeb285a928 100644 --- a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter @@ -1621,6 +1621,19 @@ cluster RefrigeratorAlarm = 87 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct ResetRequest { + AlarmBitmap alarms = 0; + } + + request struct ModifyEnabledAlarmsRequest { + AlarmBitmap mask = 0; + } + + /** Reset alarm */ + command Reset(ResetRequest): DefaultSuccess = 0; + /** Modify enabled alarms */ + command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1; } endpoint 0 { diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml index ca091a5deab23e..66113ea3c052d1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml +++ b/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml @@ -39,6 +39,20 @@ limitations under the License. + + Reset alarm + + + + + + + + Modify enabled alarms + + + + Notify diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 492c4c50b706c8..463be40ff47aba 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3637,6 +3637,19 @@ cluster RefrigeratorAlarm = 87 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct ResetRequest { + AlarmBitmap alarms = 0; + } + + request struct ModifyEnabledAlarmsRequest { + AlarmBitmap mask = 0; + } + + /** Reset alarm */ + command Reset(ResetRequest): DefaultSuccess = 0; + /** Modify enabled alarms */ + command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1; } /** Attributes and commands for selecting a mode from a list of supported options. */ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index e8440163d37360..7437344a2a19ed 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -7198,7 +7198,9 @@ public static Event value(long id) throws NoSuchFieldError { } } - public enum Command {; + public enum Command { + Reset(0L), + ModifyEnabledAlarms(1L),; private final long id; Command(long id) { this.id = id; @@ -7216,7 +7218,41 @@ public static Command value(long id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }@Override + }public enum ResetCommandField {Alarms(0),; + private final int id; + ResetCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ResetCommandField value(int id) throws NoSuchFieldError { + for (ResetCommandField field : ResetCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ModifyEnabledAlarmsCommandField {Mask(0),; + private final int id; + ModifyEnabledAlarmsCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ModifyEnabledAlarmsCommandField value(int id) throws NoSuchFieldError { + for (ModifyEnabledAlarmsCommandField field : ModifyEnabledAlarmsCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); } diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 60e9236bfe38f6..889b249fbbef8e 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4656,6 +4656,20 @@ class ChipClusters: "clusterName": "RefrigeratorAlarm", "clusterId": 0x00000057, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "Reset", + "args": { + "alarms": "int", + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "ModifyEnabledAlarms", + "args": { + "mask": "int", + }, + }, }, "attributes": { 0x00000000: { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index dc6aea8c321eda..b26c250dc7575b 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -17017,6 +17017,39 @@ class Bitmaps: class AlarmBitmap(IntFlag): kDoorOpen = 0x1 + class Commands: + @dataclass + class Reset(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000057 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="alarms", Tag=0, Type=uint), + ]) + + alarms: uint = 0 + + @dataclass + class ModifyEnabledAlarms(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000057 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[typing.Optional[str]] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="mask", Tag=0, Type=uint), + ]) + + mask: uint = 0 + class Attributes: @dataclass class Mask(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 887015ba107a8c..fbbcfdf715323b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -5208,6 +5208,19 @@ MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) @interface MTRBaseClusterRefrigeratorAlarm : MTRGenericBaseCluster +/** + * Command Reset + * + * Reset alarm + */ +- (void)resetWithParams:(MTRRefrigeratorAlarmClusterResetParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command ModifyEnabledAlarms + * + * Modify enabled alarms + */ +- (void)modifyEnabledAlarmsWithParams:(MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeMaskWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); - (void)subscribeAttributeMaskWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index e8a309f9d15454..96a2c9855a6833 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -39191,6 +39191,55 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @implementation MTRBaseClusterRefrigeratorAlarm +- (void)resetWithParams:(MTRRefrigeratorAlarmClusterResetParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRRefrigeratorAlarmClusterResetParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = RefrigeratorAlarm::Commands::Reset::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)modifyEnabledAlarmsWithParams:(MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + - (void)readAttributeMaskWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = RefrigeratorAlarm::Attributes::Mask::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 3081901bc1d25b..6c92ef07b61241 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -6311,6 +6311,10 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { // Cluster TemperatureControl commands MTRCommandIDTypeClusterTemperatureControlCommandSetTemperatureID MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x00000000, + // Cluster RefrigeratorAlarm commands + MTRCommandIDTypeClusterRefrigeratorAlarmCommandResetID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterRefrigeratorAlarmCommandModifyEnabledAlarmsID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster DishwasherMode commands MTRCommandIDTypeClusterDishwasherModeCommandChangeToModeID MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x00000000, MTRCommandIDTypeClusterDishwasherModeCommandChangeToModeResponseID MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x00000001, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 33c0e2d31eb079..807f7aad2067bd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -9428,6 +9428,14 @@ switch (commandID) { + case MTRCommandIDTypeClusterRefrigeratorAlarmCommandResetID: + result = @"Reset"; + break; + + case MTRCommandIDTypeClusterRefrigeratorAlarmCommandModifyEnabledAlarmsID: + result = @"ModifyEnabledAlarms"; + break; + default: result = [NSString stringWithFormat:@"", commandID]; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 56423696e3dfeb..66a7fc201db466 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -2480,6 +2480,9 @@ MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) @interface MTRClusterRefrigeratorAlarm : MTRGenericCluster +- (void)resetWithParams:(MTRRefrigeratorAlarmClusterResetParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)modifyEnabledAlarmsWithParams:(MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeMaskWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); - (NSDictionary * _Nullable)readAttributeStateWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); @@ -2504,8 +2507,8 @@ MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) @interface MTRClusterRefrigeratorAlarm (Availability) /** - * The queue is currently unused, but may be used in the future for calling completions - * for command invocations if commands are added to this cluster. + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 908d6b385fd4bf..978e6863b1b33b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -6859,6 +6859,60 @@ - (void)setTemperatureWithParams:(MTRTemperatureControlClusterSetTemperaturePara @implementation MTRClusterRefrigeratorAlarm +- (void)resetWithParams:(MTRRefrigeratorAlarmClusterResetParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRRefrigeratorAlarmClusterResetParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = RefrigeratorAlarm::Commands::Reset::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)modifyEnabledAlarmsWithParams:(MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + - (NSDictionary * _Nullable)readAttributeMaskWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeRefrigeratorAlarmID) attributeID:@(MTRAttributeIDTypeClusterRefrigeratorAlarmAttributeMaskID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 2677a33dedbcd7..d31b300607cccb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4388,6 +4388,66 @@ MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRRefrigeratorAlarmClusterResetParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull alarms MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull mask MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) @interface MTRDishwasherModeClusterChangeToModeParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index b56e51e21d1b06..32822ee6a3f052 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -11991,6 +11991,164 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRRefrigeratorAlarmClusterResetParams +- (instancetype)init +{ + if (self = [super init]) { + + _alarms = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRefrigeratorAlarmClusterResetParams alloc] init]; + + other.alarms = self.alarms; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: alarms:%@; >", NSStringFromClass([self class]), _alarms]; + return descriptionString; +} + +@end + +@implementation MTRRefrigeratorAlarmClusterResetParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.alarms = static_cast>(self.alarms.unsignedIntValue); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams +- (instancetype)init +{ + if (self = [super init]) { + + _mask = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams alloc] init]; + + other.mask = self.mask; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: mask:%@; >", NSStringFromClass([self class]), _mask]; + return descriptionString; +} + +@end + +@implementation MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.mask = static_cast>(self.mask.unsignedIntValue); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTRDishwasherModeClusterChangeToModeParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 5ebfd4fc86cd5b..b2fc812e8ba487 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -796,6 +796,18 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRRefrigeratorAlarmClusterResetParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRDishwasherModeClusterChangeToModeParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 35c7efe18b98cf..85e768127768b8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -6086,6 +6086,18 @@ bool emberAfModeSelectClusterChangeToModeCallback( bool emberAfTemperatureControlClusterSetTemperatureCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TemperatureControl::Commands::SetTemperature::DecodableType & commandData); +/** + * @brief Refrigerator Alarm Cluster Reset Command callback (from client) + */ +bool emberAfRefrigeratorAlarmClusterResetCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::DecodableType & commandData); +/** + * @brief Refrigerator Alarm Cluster ModifyEnabledAlarms Command callback (from client) + */ +bool emberAfRefrigeratorAlarmClusterModifyEnabledAlarmsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RefrigeratorAlarm::Commands::ModifyEnabledAlarms::DecodableType & commandData); /** * @brief Smoke CO Alarm Cluster SelfTestRequest Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index ccc6e6041a7de4..81951c37397db4 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -11771,7 +11771,76 @@ namespace Events {} // namespace Events } // namespace TemperatureControl namespace RefrigeratorAlarm { -namespace Commands {} // namespace Commands +namespace Commands { +namespace Reset { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAlarms), alarms); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kAlarms)) + { + err = DataModel::Decode(reader, alarms); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Reset. +namespace ModifyEnabledAlarms { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kMask), mask); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kMask)) + { + err = DataModel::Decode(reader, mask); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ModifyEnabledAlarms. +} // namespace Commands namespace Attributes { CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) @@ -35004,6 +35073,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::RefrigeratorAlarm::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::DishwasherMode::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 8eaa141995b304..2c5d42b7b51fba 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -15853,6 +15853,88 @@ struct TypeInfo } // namespace TemperatureControl namespace RefrigeratorAlarm { +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Reset { +struct Type; +struct DecodableType; +} // namespace Reset + +namespace ModifyEnabledAlarms { +struct Type; +struct DecodableType; +} // namespace ModifyEnabledAlarms + +} // namespace Commands + +namespace Commands { +namespace Reset { +enum class Fields : uint8_t +{ + kAlarms = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Reset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + + chip::BitMask alarms = static_cast>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Reset::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + + chip::BitMask alarms = static_cast>(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Reset +namespace ModifyEnabledAlarms { +enum class Fields : uint8_t +{ + kMask = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ModifyEnabledAlarms::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + + chip::BitMask mask = static_cast>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ModifyEnabledAlarms::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAlarm::Id; } + + chip::BitMask mask = static_cast>(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ModifyEnabledAlarms +} // namespace Commands + namespace Attributes { namespace Mask { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 40954ab0ea5f29..eaca93d1e04126 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -747,6 +747,20 @@ static constexpr CommandId Id = 0x00000000; } // namespace Commands } // namespace TemperatureControl +namespace RefrigeratorAlarm { +namespace Commands { + +namespace Reset { +static constexpr CommandId Id = 0x00000000; +} // namespace Reset + +namespace ModifyEnabledAlarms { +static constexpr CommandId Id = 0x00000001; +} // namespace ModifyEnabledAlarms + +} // namespace Commands +} // namespace RefrigeratorAlarm + namespace DishwasherMode { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index c2df08e2957dfc..a34442d6eca12f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -5191,6 +5191,8 @@ class TemperatureControlSetTemperature : public ClusterCommand | Cluster RefrigeratorAlarm | 0x0057 | |------------------------------------------------------------------------------| | Commands: | | +| * Reset | 0x00 | +| * ModifyEnabledAlarms | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Mask | 0x0000 | @@ -5206,6 +5208,81 @@ class TemperatureControlSetTemperature : public ClusterCommand | * Notify | 0x0000 | \*----------------------------------------------------------------------------*/ +/* + * Command Reset + */ +class RefrigeratorAlarmReset : public ClusterCommand +{ +public: + RefrigeratorAlarmReset(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("reset", credsIssuerConfig) + { + AddArgument("Alarms", 0, UINT32_MAX, &mRequest.alarms); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::RefrigeratorAlarm::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::RefrigeratorAlarm::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Type mRequest; +}; + +/* + * Command ModifyEnabledAlarms + */ +class RefrigeratorAlarmModifyEnabledAlarms : public ClusterCommand +{ +public: + RefrigeratorAlarmModifyEnabledAlarms(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("modify-enabled-alarms", credsIssuerConfig) + { + AddArgument("Mask", 0, UINT32_MAX, &mRequest.mask); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::RefrigeratorAlarm::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::RefrigeratorAlarm::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster DishwasherMode | 0x0059 | |------------------------------------------------------------------------------| @@ -20453,7 +20530,9 @@ void registerClusterRefrigeratorAlarm(Commands & commands, CredentialIssuerComma // // Commands // - make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index 1994301e279689..849c9612058204 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -5065,6 +5065,17 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::RefrigeratorAlarm::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Id: + return "Reset"; + case chip::app::Clusters::RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Id: + return "ModifyEnabledAlarms"; + default: + return "Unknown"; + } + } case chip::app::Clusters::DishwasherMode::Id: { switch (id) { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 2d61cb58b2f359..3e5eed92ae7d3c 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -53338,6 +53338,8 @@ class SubscribeAttributeTemperatureControlClusterRevision : public SubscribeAttr | Cluster RefrigeratorAlarm | 0x0057 | |------------------------------------------------------------------------------| | Commands: | | +| * Reset | 0x00 | +| * ModifyEnabledAlarms | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Mask | 0x0000 | @@ -53353,6 +53355,113 @@ class SubscribeAttributeTemperatureControlClusterRevision : public SubscribeAttr | * Notify | 0x0000 | \*----------------------------------------------------------------------------*/ +#if MTR_ENABLE_PROVISIONAL +/* + * Command Reset + */ +class RefrigeratorAlarmReset : public ClusterCommand { +public: + RefrigeratorAlarmReset() + : ClusterCommand("reset") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Alarms", 0, UINT32_MAX, &mRequest.alarms); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::RefrigeratorAlarm::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRRefrigeratorAlarmClusterResetParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.alarms = [NSNumber numberWithUnsignedInt:mRequest.alarms.Raw()]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster resetWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::RefrigeratorAlarm::Commands::Reset::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ModifyEnabledAlarms + */ +class RefrigeratorAlarmModifyEnabledAlarms : public ClusterCommand { +public: + RefrigeratorAlarmModifyEnabledAlarms() + : ClusterCommand("modify-enabled-alarms") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Mask", 0, UINT32_MAX, &mRequest.mask); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::RefrigeratorAlarm::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRRefrigeratorAlarmClusterModifyEnabledAlarmsParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.mask = [NSNumber numberWithUnsignedInt:mRequest.mask.Raw()]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster modifyEnabledAlarmsWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::RefrigeratorAlarm::Commands::ModifyEnabledAlarms::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute Mask */ @@ -176629,6 +176738,12 @@ void registerClusterRefrigeratorAlarm(Commands & commands) commands_list clusterCommands = { make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // make_unique(Id), //