From f0d547db9aec14b3f2fb3e8377e3c253f16079a7 Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Tue, 13 Aug 2024 16:49:40 -0700 Subject: [PATCH 01/13] Update Matter data model/ZAP config for dishwasher --- .../rootnode_dishwasher_cc105034fe.matter | 265 +++++++ .../rootnode_dishwasher_cc105034fe.zap | 713 ++++++++++++++++++ 2 files changed, 978 insertions(+) diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index c8e41990993d27..2da03a25765ffa 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -284,6 +284,78 @@ cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } +/** Attributes and commands for switching devices between 'On' and 'Off' states. */ +cluster OnOff = 6 { + revision 6; + + enum DelayedAllOffEffectVariantEnum : enum8 { + kDelayedOffFastFade = 0; + kNoFade = 1; + kDelayedOffSlowFade = 2; + } + + enum DyingLightEffectVariantEnum : enum8 { + kDyingLightFadeOff = 0; + } + + enum EffectIdentifierEnum : enum8 { + kDelayedAllOff = 0; + kDyingLight = 1; + } + + enum StartUpOnOffEnum : enum8 { + kOff = 0; + kOn = 1; + kToggle = 2; + } + + bitmap Feature : bitmap32 { + kLighting = 0x1; + kDeadFrontBehavior = 0x2; + kOffOnly = 0x4; + } + + bitmap OnOffControlBitmap : bitmap8 { + kAcceptOnlyWhenOn = 0x1; + } + + readonly attribute boolean onOff = 0; + readonly attribute optional boolean globalSceneControl = 16384; + attribute optional int16u onTime = 16385; + attribute optional int16u offWaitTime = 16386; + attribute access(write: manage) optional nullable StartUpOnOffEnum startUpOnOff = 16387; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OffWithEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + enum8 effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControlBitmap onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + + /** On receipt of this command, a device SHALL enter its ‘Off’ state. This state is device dependent, but it is recommended that it is used for power off or similar functions. On receipt of the Off command, the OnTime attribute SHALL be set to 0. */ + command Off(): DefaultSuccess = 0; + /** On receipt of this command, a device SHALL enter its ‘On’ state. This state is device dependent, but it is recommended that it is used for power on or similar functions. On receipt of the On command, if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. */ + command On(): DefaultSuccess = 1; + /** On receipt of this command, if a device is in its ‘Off’ state it SHALL enter its ‘On’ state. Otherwise, if it is in its ‘On’ state it SHALL enter its ‘Off’ state. On receipt of the Toggle command, if the value of the OnOff attribute is equal to FALSE and if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. If the value of the OnOff attribute is equal to TRUE, the OnTime attribute SHALL be set to 0. */ + command Toggle(): DefaultSuccess = 2; + /** The OffWithEffect command allows devices to be turned off using enhanced ways of fading. */ + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + /** The OnWithRecallGlobalScene command allows the recall of the settings when the device was turned off. */ + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + /** The OnWithTimedOff command allows devices to be turned on for a specific duration with a guarded off duration so that SHOULD the device be subsequently switched off, further OnWithTimedOff commands, received during this time, are prevented from turning the devices back on. */ + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; @@ -1363,6 +1435,137 @@ cluster GroupKeyManagement = 63 { fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; } +/** Attributes and commands for configuring the temperature control, and reporting temperature. */ +cluster TemperatureControl = 86 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kTemperatureNumber = 0x1; + kTemperatureLevel = 0x2; + kTemperatureStep = 0x4; + } + + readonly attribute optional temperature temperatureSetpoint = 0; + readonly attribute optional temperature minTemperature = 1; + readonly attribute optional temperature maxTemperature = 2; + readonly attribute optional temperature step = 3; + readonly attribute optional int8u selectedTemperatureLevel = 4; + readonly attribute optional char_string supportedTemperatureLevels[] = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetTemperatureRequest { + optional temperature targetTemperature = 0; + optional int8u targetTemperatureLevel = 1; + } + + /** Set Temperature */ + command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +cluster DishwasherMode = 89 { + revision 2; + + enum ModeTag : enum16 { + kNormal = 16384; + kHeavy = 16385; + kLight = 16386; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for configuring the Dishwasher alarm. */ +cluster DishwasherAlarm = 93 { + revision 1; // NOTE: Default/not specifically set + + bitmap AlarmBitmap : bitmap32 { + kInflowError = 0x1; + kDrainError = 0x2; + kDoorError = 0x4; + kTempTooLow = 0x8; + kTempTooHigh = 0x10; + kWaterLevelError = 0x20; + } + + bitmap Feature : bitmap32 { + kReset = 0x1; + } + + info event Notify = 0 { + AlarmBitmap active = 0; + AlarmBitmap inactive = 1; + AlarmBitmap state = 2; + AlarmBitmap mask = 3; + } + + readonly attribute AlarmBitmap mask = 0; + readonly attribute optional AlarmBitmap latch = 1; + readonly attribute AlarmBitmap state = 2; + readonly attribute AlarmBitmap supported = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + 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; +} + /** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ cluster OperationalState = 96 { revision 1; @@ -1700,6 +1903,20 @@ endpoint 1 { handle command TriggerEffect; } + server cluster OnOff { + ram attribute onOff default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 6; + + handle command Off; + handle command On; + handle command Toggle; + } + server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1712,6 +1929,54 @@ endpoint 1 { callback attribute clusterRevision; } + server cluster TemperatureControl { + ram attribute temperatureSetpoint default = 0; + ram attribute minTemperature default = 0; + ram attribute maxTemperature default = 0; + ram attribute step default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 5; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } + + server cluster DishwasherMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute startUpMode; + callback attribute onMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 2; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } + + server cluster DishwasherAlarm { + emits event Notify; + ram attribute mask default = 0; + ram attribute latch default = 0x30; + ram attribute state default = 0; + ram attribute supported default = 0x3F; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command Reset; + handle command ModifyEnabledAlarms; + } + server cluster OperationalState { emits event OperationalError; emits event OperationCompletion; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index 770fe6edaf16d3..2139b3d8b8227b 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -3150,6 +3150,154 @@ } ] }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Descriptor", "code": 29, @@ -3304,6 +3452,571 @@ } ] }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Dishwasher Mode", + "code": 89, + "mfgCode": null, + "define": "DISHWASHER_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Dishwasher Alarm", + "code": 93, + "mfgCode": null, + "define": "DISHWASHER_ALARM_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Reset", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ModifyEnabledAlarms", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Latch", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x30", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Supported", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x3F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "Notify", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, { "name": "Operational State", "code": 96, From f32cd7a0a7e677b417da73f438a89580c0bb855b Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Wed, 21 Aug 2024 15:16:22 -0700 Subject: [PATCH 02/13] Add support for dishwasher alarm cluster --- .../chef-dishwasher-alarm-delegate-impl.cpp | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp diff --git a/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp new file mode 100644 index 00000000000000..5f040c7b60f5c9 --- /dev/null +++ b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp @@ -0,0 +1,149 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +#ifdef MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER +#include +using namespace chip::app::Clusters::DishwasherAlarm; + + +class DishwasherAlarmDelegate : public Delegate +{ +public: + /** + * @brief + * A notification that the Mask attribute will be changed. When this happens, some previously suppressed + * alarms may need to be enabled, and previously enabled alarms may need to be suppressed. + * @param[in] mask The new value of the Mask attribute. + * @return The cluster will do this update if ModifyEnabledAlarmsCallback() returns true. + * The cluster will not do this update if ModifyEnabledAlarmsCallback() returns false. + */ + bool ModifyEnabledAlarmsCallback(const BitMask mask) override; + + /** + * @brief + * A notification that resets active alarms (if possible) + * @param[in] alarms The value of reset alarms + * @return The cluster will reset active alarms if ResetAlarmsCallback() returns true. + * The cluster will not reset active alarms if ResetAlarmsCallback() returns false. + */ + bool ResetAlarmsCallback(const BitMask alarms) override; + + ~DishwasherAlarmDelegate() = default; +}; + +bool DishwasherAlarmDelegate::ModifyEnabledAlarmsCallback(const BitMask mask) +{ + // placeholder implementation + return true; +} + +bool DishwasherAlarmDelegate::ResetAlarmsCallback(const BitMask alarms) +{ + // placeholder implementation + return true; +} + +/* + * An example to present device's endpointId + */ +static constexpr EndpointId kDemoEndpointId = 1; + +void MatterDishwasherAlarmServerInit() +{ + using namespace app::Clusters; + using namespace app::Clusters::DishwasherAlarm; + + static DishwasherAlarm::DishwasherAlarmDelegate delegate; + DishwasherAlarm::SetDefaultDelegate(kDemoEndpointId, &delegate); + + // Set Supported attribute = 0x3F = 63 + // Bit Name Value + // 0 InflowError 1 + // 1 DrainError 1 + // 2 DoorError 1 + // 3 TempTooLow 1 + // 4 TempTooHigh 1 + // 5 WaterLevelError 1 + BitMask supported; + supported.SetField(AlarmMap::kInflowError, 1); + supported.SetField(AlarmMap::kDrainError, 1); + supported.SetField(AlarmMap::kDoorError, 1); + supported.SetField(AlarmMap::kTempTooLow, 1); + supported.SetField(AlarmMap::kTempTooHigh, 1); + supported.SetField(AlarmMap::kWaterLevelError, 1); + DishwasherAlarmServer::Instance().SetSupportedValue(kDemoEndpointId, supported); + + // Set Mask attribute = 0x0 = 0 + // Bit Name Value + // 0 InflowError 0 + // 1 DrainError 0 + // 2 DoorError 0 + // 3 TempTooLow 0 + // 4 TempTooHigh 0 + // 5 WaterLevelError 0 + BitMask mask; + mask.SetField(AlarmMap::kInflowError, 0); + mask.SetField(AlarmMap::kDrainError, 0); + mask.SetField(AlarmMap::kDoorError, 0); + mask.SetField(AlarmMap::kTempTooLow, 0); + mask.SetField(AlarmMap::kTempTooHigh, 0); + mask.SetField(AlarmMap::kWaterLevelError, 0); + DishwasherAlarmServer::Instance().SetMaskValue(kDemoEndpointId, mask); + + // Set Latch attribute = 0x30 + // Bit Name Value + // 0 InflowError 1 + // 1 DrainError 1 + // 2 DoorError 0 + // 3 TempTooLow 0 + // 4 TempTooHigh 0 + // 5 WaterLevelError 0 + BitMask latch; + latch.SetField(AlarmMap::kInflowError, 1); + latch.SetField(AlarmMap::kDrainError, 1); + latch.SetField(AlarmMap::kDoorError, 0); + latch.SetField(AlarmMap::kTempTooLow, 0); + latch.SetField(AlarmMap::kTempTooHigh, 0); + latch.SetField(AlarmMap::kWaterLevelError, 0); + DishwasherAlarmServer::Instance().SetLatchValue(kDemoEndpointId, latch); + + // Set State attribute = 0x00 + // Bit Name Value + // 0 InflowError 0 + // 1 DrainError 0 + // 2 DoorError 0 + // 3 TempTooLow 0 + // 4 TempTooHigh 0 + // 5 WaterLevelError 0 + BitMask state; + state.SetField(AlarmMap::kInflowError, 0); + state.SetField(AlarmMap::kDrainError, 0); + state.SetField(AlarmMap::kDoorError, 0); + state.SetField(AlarmMap::kTempTooLow, 0); + state.SetField(AlarmMap::kTempTooHigh, 0); + state.SetField(AlarmMap::kWaterLevelError, 0); + DishwasherAlarmServer::Instance().SetStateValue(kDemoEndpointId, state); +} + +#endif //MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER \ No newline at end of file From 965a37946a2abb9de355fcd3e70fda5c0a7d8840 Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Wed, 21 Aug 2024 15:17:22 -0700 Subject: [PATCH 03/13] Add support for dishwasher mode cluster --- .../chef-dishwasher-mode-delegate-impl.cpp | 154 ++++++++++++++++++ .../chef-dishwasher-mode-delegate-impl.h | 88 ++++++++++ examples/chef/common/stubs.cpp | 12 ++ 3 files changed, 254 insertions(+) create mode 100644 examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp create mode 100644 examples/chef/common/chef-dishwasher-mode-delegate-impl.h diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp new file mode 100644 index 00000000000000..a34fabf78711b0 --- /dev/null +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp @@ -0,0 +1,154 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +using namespace chip::app::Clusters; +using chip::Protocols::InteractionModel::Status; +template +using List = chip::app::DataModel::List; +using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::Type; + +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#include +using namespace chip::app::Clusters::DishwasherMode; + +static std::unique_ptr gDishwasherModeDelegate; +static std::unique_ptr gDishwasherModeInstance; + +CHIP_ERROR DishwasherModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void DishwasherModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +CHIP_ERROR DishwasherModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR DishwasherModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} + +// ModeBase::Instance * DishwasherMode::Instance() +// { +// return gDishwasherModeInstance; +// } + +void DishwasherMode::Shutdown() +{ + gDishwasherModeInstance.reset(); + gDishwasherModeDelegate.reset(); +} + +chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1 + VerifyOrDie(gDishwasherModeInstance != nullptr); + chip::Protocols::InteractionModel::Status ret; + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::DishwasherMode::Attributes::CurrentMode::Id: { + uint8_t m = static_cast(buffer[0]); + ret = gDishwasherModeInstance->UpdateCurrentMode(m); + if (chip::Protocols::InteractionModel::Status::Success != ret) + { + ChipLogError(DeviceLayer, "Invalid Attribute Update status: %d", static_cast(ret)); + } + } + break; + default: + ret = chip::Protocols::InteractionModel::Status::UnsupportedWrite; + ChipLogError(DeviceLayer, "Unsupported Writng Attribute ID: %d", static_cast(attributeId)); + break; + } + + return ret; +} + +chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) +{ + chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::DishwasherMode::Attributes::CurrentMode::Id: { + *buffer = gDishwasherModeInstance->GetCurrentMode(); + ChipLogDetail(DeviceLayer, "Reading DishwasherMode CurrentMode : %d", static_cast(attributeId)); + } + break; + default: + ret = chip::Protocols::InteractionModel::Status::UnsupportedRead; + ChipLogDetail(DeviceLayer, "Unsupported attributeId %d from reading DishwasherMode", static_cast(attributeId)); + break; + } + + return ret; +} + +void emberAfDishwasherModeClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(!gDishwasherModeDelegate && !gDishwasherModeInstance); + + gDishwasherModeDelegate = std::make_unique(); + gDishwasherModeInstance = + std::make_unique(gDishwasherModeDelegate, 0x1, DishwasherMode::Id, chip::to_underlying(Feature::kOnOff)); + gDishwasherModeInstance->Init(); +} +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER \ No newline at end of file diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h new file mode 100644 index 00000000000000..c7e329ba42a196 --- /dev/null +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h @@ -0,0 +1,88 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace DishwasherMode { + +const uint8_t ModeNormal = 0; +const uint8_t ModeHeavy = 1; +const uint8_t ModeLight = 2; + +/// This is an application level delegate to handle DishwasherMode commands according to the specific business logic. +class DishwasherModeDelegate : public ModeBase::Delegate +{ +private: + using ModeTagStructType = detail::Structs::ModeTagStruct::Type; + ModeTagStructType modeTagsNormal[1] = { { .value = to_underlying(ModeTag::kNormal) } }; + ModeTagStructType modeTagsHeavy[2] = { { .value = to_underlying(ModeBase::ModeTag::kMax) }, + { .value = to_underlying(ModeTag::kHeavy) } }; + ModeTagStructType modeTagsLight[3] = { { .value = to_underlying(ModeTag::kLight) }, + { .value = to_underlying(ModeBase::ModeTag::kNight) }, + { .value = to_underlying(ModeBase::ModeTag::kQuiet) } }; + + const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = { + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Normal"), + .mode = ModeNormal, + .modeTags = DataModel::List(modeTagsNormal) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Heavy"), + .mode = ModeHeavy, + .modeTags = DataModel::List(modeTagsHeavy) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Light"), + .mode = ModeLight, + .modeTags = DataModel::List(modeTagsLight) } + }; + + CHIP_ERROR Init() override; + void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override; + + CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override; + CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override; + CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List & tags) override; + +public: + ~DishwasherModeDelegate() override = default; +}; + +ModeBase::Instance * Instance(); + +void Shutdown(); + +} // namespace DishwasherMode + +} // namespace Clusters +} // namespace app +} // namespace chip + +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); +chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); +#endif \ No newline at end of file diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 8771bf78dccaf5..8a8999754dbe3a 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -30,6 +30,10 @@ #include "chef-rvc-operational-state-delegate.h" #endif +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#include "chef-dishwasher-mode-delegate-impl.h" +#endif + using chip::app::DataModel::Nullable; using namespace chip; @@ -84,6 +88,10 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin #ifdef MATTER_DM_PLUGIN_RVC_OPERATIONAL_STATE_SERVER case chip::app::Clusters::RvcOperationalState::Id: return chefRvcOperationalStateReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); +#endif +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER + case chip::app::Clusters::DishwasherMode::Id: + return chefDishwasherModeReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); #endif default: break; @@ -149,6 +157,10 @@ Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(Endpoi #ifdef MATTER_DM_PLUGIN_RVC_OPERATIONAL_STATE_SERVER case chip::app::Clusters::RvcOperationalState::Id: return chefRvcOperationalStateWriteCallback(endpoint, clusterId, attributeMetadata, buffer); +#endif +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER + case chip::app::Clusters::DishwasherMode::Id: + return chefDishwasherModeWriteCallback(endpoint, clusterId, attributeMetadata, buffer); #endif default: break; From 8efef59dced457417a307b94436fd349b386688d Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Wed, 21 Aug 2024 15:17:22 -0700 Subject: [PATCH 04/13] Add support for dishwasher mode cluster --- .../chef/common/chef-dishwasher-mode-delegate-impl.cpp | 7 ++++++- examples/chef/common/chef-dishwasher-mode-delegate-impl.h | 2 ++ examples/chef/linux/BUILD.gn | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp index a34fabf78711b0..2cebc4cde7cdfe 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp @@ -18,6 +18,8 @@ #include #include +using namespace chip; +using namespace chip::app; using namespace chip::app::Clusters; using chip::Protocols::InteractionModel::Status; template @@ -122,6 +124,9 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::E const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength) { + VerifyOrReturnValue(maxReadLength > 0, chip::Protocols::InteractionModel::Status::ResourceExhausted); + buffer[0] = gDishwasherModeInstance->GetCurrentMode(); + chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; chip::AttributeId attributeId = attributeMetadata->attributeId; @@ -148,7 +153,7 @@ void emberAfDishwasherModeClusterInitCallback(chip::EndpointId endpointId) gDishwasherModeDelegate = std::make_unique(); gDishwasherModeInstance = - std::make_unique(gDishwasherModeDelegate, 0x1, DishwasherMode::Id, chip::to_underlying(Feature::kOnOff)); + std::make_unique(gDishwasherModeDelegate.get(), endpointId, DishwasherMode::Id, chip::to_underlying(Feature::kOnOff)); gDishwasherModeInstance->Init(); } #endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER \ No newline at end of file diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h index c7e329ba42a196..117aa0abbdaeae 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h @@ -23,6 +23,8 @@ #include #include +using chip::Protocols::InteractionModel::Status; + namespace chip { namespace app { namespace Clusters { diff --git a/examples/chef/linux/BUILD.gn b/examples/chef/linux/BUILD.gn index c9c0be1d74156b..2c898887a939b1 100644 --- a/examples/chef/linux/BUILD.gn +++ b/examples/chef/linux/BUILD.gn @@ -45,6 +45,7 @@ executable("${sample_name}") { "${project_dir}/common/chef-fan-control-manager.cpp", "${project_dir}/common/chef-laundry-washer-controls-delegate-impl.cpp", "${project_dir}/common/chef-laundry-washer-mode.cpp", + "${project_dir}/common/chef-dishwasher-mode-delegate-impl.cpp", "${project_dir}/common/chef-operational-state-delegate-impl.cpp", "${project_dir}/common/chef-rpc-actions-worker.cpp", "${project_dir}/common/chef-rvc-mode-delegate.cpp", From 21574f0e4dc7e1bb926051bcf903662a0dc5850b Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Thu, 5 Sep 2024 16:30:44 -0700 Subject: [PATCH 05/13] Update operational state delegate Emberexteral write and read callback --- .../chef-operational-state-delegate-impl.cpp | 91 +++++++++++++++++++ .../chef-operational-state-delegate-impl.h | 14 ++- examples/chef/common/stubs.cpp | 12 +++ examples/chef/linux/BUILD.gn | 1 + examples/chef/nrfconnect/CMakeLists.txt | 2 + 5 files changed, 119 insertions(+), 1 deletion(-) diff --git a/examples/chef/common/chef-operational-state-delegate-impl.cpp b/examples/chef/common/chef-operational-state-delegate-impl.cpp index 2692417915d785..354ac169ee2d36 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.cpp +++ b/examples/chef/common/chef-operational-state-delegate-impl.cpp @@ -14,14 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include +#include #include #include +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::OperationalState; using namespace chip::app::Clusters::RvcOperationalState; +using chip::Protocols::InteractionModel::Status; static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data); @@ -186,6 +190,90 @@ void OperationalState::Shutdown() } } +chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip::EndpointId endpointId, + chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) +{ + chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gOperationalStateInstance != nullptr); + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::OperationalState::Attributes::CurrentPhase::Id: { + uint8_t m = static_cast(buffer[0]); + DataModel::Nullable aPhase(m); + CHIP_ERROR err = gOperationalStateInstance->SetCurrentPhase(aPhase); + if (CHIP_NO_ERROR == err) + { + break; + } + ret = chip::Protocols::InteractionModel::Status::ConstraintError; + ChipLogError(DeviceLayer, "Invalid Attribute Update status: %" CHIP_ERROR_FORMAT, err.Format()); + } + break; + case chip::app::Clusters::OperationalState::Attributes::OperationalState::Id: { + uint8_t currentState = gOperationalStateInstance->GetCurrentOperationalState(); + uint8_t m = static_cast(buffer[0]); + CHIP_ERROR err = gOperationalStateInstance->SetOperationalState(m); + + if (currentState == to_underlying(OperationalState::OperationalStateEnum::kStopped) && + m == to_underlying(OperationalState::OperationalStateEnum::kRunning)) + { + gOperationalStateDelegate->mCountDownTime.SetNonNull( + static_cast(gOperationalStateDelegate->kExampleCountDown)); + } + + if (CHIP_NO_ERROR == err) + { + break; + } + ret = chip::Protocols::InteractionModel::Status::ConstraintError; + ChipLogError(DeviceLayer, "Invalid Attribute Update status: %" CHIP_ERROR_FORMAT, err.Format()); + } + break; + default: + ret = chip::Protocols::InteractionModel::Status::UnsupportedAttribute; + ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast(attributeId)); + break; + } + + return ret; +} + +chip::Protocols::InteractionModel::Status chefOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) +{ + chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; + chip::AttributeId attributeId = attributeMetadata->attributeId; + switch (attributeId) + { + case chip::app::Clusters::OperationalState::Attributes::CurrentPhase::Id: { + + app::DataModel::Nullable currentPhase = gOperationalStateInstance->GetCurrentPhase(); + if (currentPhase.IsNull()) + { + ret = chip::Protocols::InteractionModel::Status::UnsupportedAttribute; + break; + } + *buffer = currentPhase.Value(); + } + break; + case chip::app::Clusters::OperationalState::Attributes::OperationalState::Id: { + *buffer = gOperationalStateInstance->GetCurrentOperationalState(); + } + break; + default: + ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast(attributeId)); + break; + } + + return ret; +} + void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) { VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. @@ -199,3 +287,6 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) gOperationalStateInstance->Init(); } + + +#endif \ No newline at end of file diff --git a/examples/chef/common/chef-operational-state-delegate-impl.h b/examples/chef/common/chef-operational-state-delegate-impl.h index 60b6b09e9b6511..45740a0317f2e1 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.h +++ b/examples/chef/common/chef-operational-state-delegate-impl.h @@ -23,6 +23,9 @@ #include +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +using chip::Protocols::InteractionModel::Status; + namespace chip { namespace app { namespace Clusters { @@ -108,9 +111,9 @@ class OperationalStateDelegate : public GenericOperationalStateDelegateImpl GenericOperationalState(to_underlying(OperationalStateEnum::kError)), }; +public: const uint32_t kExampleCountDown = 30; -public: OperationalStateDelegate() { GenericOperationalStateDelegateImpl::mOperationalStateList = Span(opStateList); @@ -145,3 +148,12 @@ void Shutdown(); } // namespace Clusters } // namespace app } // namespace chip + +chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); +chip::Protocols::InteractionModel::Status chefOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); + +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER \ No newline at end of file diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 8a8999754dbe3a..d9c62f97b210f5 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -34,6 +34,10 @@ #include "chef-dishwasher-mode-delegate-impl.h" #endif +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +#include "chef-operational-state-delegate-impl.h" +#endif + using chip::app::DataModel::Nullable; using namespace chip; @@ -92,6 +96,10 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER case chip::app::Clusters::DishwasherMode::Id: return chefDishwasherModeReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); +#endif +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER + case chip::app::Clusters::OperationalState::Id: + return chefOperationalStateReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); #endif default: break; @@ -161,6 +169,10 @@ Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(Endpoi #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER case chip::app::Clusters::DishwasherMode::Id: return chefDishwasherModeWriteCallback(endpoint, clusterId, attributeMetadata, buffer); +#endif +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER + case chip::app::Clusters::OperationalState::Id: + return chefOperationalStateWriteCallback(endpoint, clusterId, attributeMetadata, buffer); #endif default: break; diff --git a/examples/chef/linux/BUILD.gn b/examples/chef/linux/BUILD.gn index 2c898887a939b1..63ad94e04bac34 100644 --- a/examples/chef/linux/BUILD.gn +++ b/examples/chef/linux/BUILD.gn @@ -45,6 +45,7 @@ executable("${sample_name}") { "${project_dir}/common/chef-fan-control-manager.cpp", "${project_dir}/common/chef-laundry-washer-controls-delegate-impl.cpp", "${project_dir}/common/chef-laundry-washer-mode.cpp", + "${project_dir}/common/chef-dishwasher-alarm-delegate-impl.cpp", "${project_dir}/common/chef-dishwasher-mode-delegate-impl.cpp", "${project_dir}/common/chef-operational-state-delegate-impl.cpp", "${project_dir}/common/chef-rpc-actions-worker.cpp", diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index 081c510435c1e6..a6ce473e4abb67 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -83,6 +83,8 @@ target_sources(app PRIVATE ${CHEF}/common/chef-fan-control-manager.cpp ${CHEF}/common/chef-laundry-washer-controls-delegate-impl.cpp ${CHEF}/common/chef-laundry-washer-mode.cpp + ${CHEF}/common/chef-dishwasher-alarm-delegate-impl.cpp + ${CHEF}/common/chef-dishwasher-mode-delegate-impl.cpp ${CHEF}/common/chef-operational-state-delegate-impl.cpp ${CHEF}/common/chef-rvc-mode-delegate.cpp ${CHEF}/common/chef-rvc-operational-state-delegate.cpp From 90835d99d50f24de615e8223b567128ae367fb55 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 6 Sep 2024 22:13:36 +0000 Subject: [PATCH 06/13] Restyled by whitespace --- examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp | 2 +- examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp | 2 +- examples/chef/common/chef-dishwasher-mode-delegate-impl.h | 2 +- examples/chef/common/chef-operational-state-delegate-impl.cpp | 2 +- examples/chef/common/chef-operational-state-delegate-impl.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp index 5f040c7b60f5c9..3793d0be07c26b 100644 --- a/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp +++ b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp @@ -146,4 +146,4 @@ void MatterDishwasherAlarmServerInit() DishwasherAlarmServer::Instance().SetStateValue(kDemoEndpointId, state); } -#endif //MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER \ No newline at end of file +#endif //MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp index 2cebc4cde7cdfe..af3ef83934300d 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp @@ -156,4 +156,4 @@ void emberAfDishwasherModeClusterInitCallback(chip::EndpointId endpointId) std::make_unique(gDishwasherModeDelegate.get(), endpointId, DishwasherMode::Id, chip::to_underlying(Feature::kOnOff)); gDishwasherModeInstance->Init(); } -#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER \ No newline at end of file +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h index 117aa0abbdaeae..f8e82267e6ae05 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h @@ -87,4 +87,4 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip:: chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength); -#endif \ No newline at end of file +#endif diff --git a/examples/chef/common/chef-operational-state-delegate-impl.cpp b/examples/chef/common/chef-operational-state-delegate-impl.cpp index 354ac169ee2d36..aae7c53a75818b 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.cpp +++ b/examples/chef/common/chef-operational-state-delegate-impl.cpp @@ -289,4 +289,4 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) } -#endif \ No newline at end of file +#endif diff --git a/examples/chef/common/chef-operational-state-delegate-impl.h b/examples/chef/common/chef-operational-state-delegate-impl.h index 45740a0317f2e1..03a6582be98ca1 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.h +++ b/examples/chef/common/chef-operational-state-delegate-impl.h @@ -156,4 +156,4 @@ chip::Protocols::InteractionModel::Status chefOperationalStateReadCallback(chip: const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength); -#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER \ No newline at end of file +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER From a81aee1cf4ba3267c7a1827bbf0ab9eb33a47149 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 6 Sep 2024 22:13:38 +0000 Subject: [PATCH 07/13] Restyled by clang-format --- .../chef-dishwasher-alarm-delegate-impl.cpp | 22 +++++++++---------- .../chef-dishwasher-mode-delegate-impl.cpp | 12 +++++----- .../chef-dishwasher-mode-delegate-impl.h | 8 +++---- .../chef-operational-state-delegate-impl.cpp | 12 +++++----- .../chef-operational-state-delegate-impl.h | 8 +++---- 5 files changed, 29 insertions(+), 33 deletions(-) diff --git a/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp index 3793d0be07c26b..b9894b5fa3cd1f 100644 --- a/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp +++ b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp @@ -17,7 +17,6 @@ */ #include - using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; @@ -26,7 +25,6 @@ using namespace chip::app::Clusters; #include using namespace chip::app::Clusters::DishwasherAlarm; - class DishwasherAlarmDelegate : public Delegate { public: @@ -90,7 +88,7 @@ void MatterDishwasherAlarmServerInit() supported.SetField(AlarmMap::kDrainError, 1); supported.SetField(AlarmMap::kDoorError, 1); supported.SetField(AlarmMap::kTempTooLow, 1); - supported.SetField(AlarmMap::kTempTooHigh, 1); + supported.SetField(AlarmMap::kTempTooHigh, 1); supported.SetField(AlarmMap::kWaterLevelError, 1); DishwasherAlarmServer::Instance().SetSupportedValue(kDemoEndpointId, supported); @@ -107,7 +105,7 @@ void MatterDishwasherAlarmServerInit() mask.SetField(AlarmMap::kDrainError, 0); mask.SetField(AlarmMap::kDoorError, 0); mask.SetField(AlarmMap::kTempTooLow, 0); - mask.SetField(AlarmMap::kTempTooHigh, 0); + mask.SetField(AlarmMap::kTempTooHigh, 0); mask.SetField(AlarmMap::kWaterLevelError, 0); DishwasherAlarmServer::Instance().SetMaskValue(kDemoEndpointId, mask); @@ -122,10 +120,10 @@ void MatterDishwasherAlarmServerInit() BitMask latch; latch.SetField(AlarmMap::kInflowError, 1); latch.SetField(AlarmMap::kDrainError, 1); - latch.SetField(AlarmMap::kDoorError, 0); - latch.SetField(AlarmMap::kTempTooLow, 0); - latch.SetField(AlarmMap::kTempTooHigh, 0); - latch.SetField(AlarmMap::kWaterLevelError, 0); + latch.SetField(AlarmMap::kDoorError, 0); + latch.SetField(AlarmMap::kTempTooLow, 0); + latch.SetField(AlarmMap::kTempTooHigh, 0); + latch.SetField(AlarmMap::kWaterLevelError, 0); DishwasherAlarmServer::Instance().SetLatchValue(kDemoEndpointId, latch); // Set State attribute = 0x00 @@ -140,10 +138,10 @@ void MatterDishwasherAlarmServerInit() state.SetField(AlarmMap::kInflowError, 0); state.SetField(AlarmMap::kDrainError, 0); state.SetField(AlarmMap::kDoorError, 0); - state.SetField(AlarmMap::kTempTooLow, 0); - state.SetField(AlarmMap::kTempTooHigh, 0); - state.SetField(AlarmMap::kWaterLevelError, 0); + state.SetField(AlarmMap::kTempTooLow, 0); + state.SetField(AlarmMap::kTempTooHigh, 0); + state.SetField(AlarmMap::kWaterLevelError, 0); DishwasherAlarmServer::Instance().SetStateValue(kDemoEndpointId, state); } -#endif //MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER +#endif // MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp index af3ef83934300d..a600d6a24c750e 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp @@ -92,8 +92,8 @@ void DishwasherMode::Shutdown() } chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer) + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) { VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1 VerifyOrDie(gDishwasherModeInstance != nullptr); @@ -121,8 +121,8 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip:: } chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer, uint16_t maxReadLength) + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) { VerifyOrReturnValue(maxReadLength > 0, chip::Protocols::InteractionModel::Status::ResourceExhausted); buffer[0] = gDishwasherModeInstance->GetCurrentMode(); @@ -152,8 +152,8 @@ void emberAfDishwasherModeClusterInitCallback(chip::EndpointId endpointId) VerifyOrDie(!gDishwasherModeDelegate && !gDishwasherModeInstance); gDishwasherModeDelegate = std::make_unique(); - gDishwasherModeInstance = - std::make_unique(gDishwasherModeDelegate.get(), endpointId, DishwasherMode::Id, chip::to_underlying(Feature::kOnOff)); + gDishwasherModeInstance = std::make_unique(gDishwasherModeDelegate.get(), endpointId, DishwasherMode::Id, + chip::to_underlying(Feature::kOnOff)); gDishwasherModeInstance->Init(); } #endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h index f8e82267e6ae05..0b118aa3e1bab7 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h @@ -82,9 +82,9 @@ void Shutdown(); #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer, uint16_t maxReadLength); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); #endif diff --git a/examples/chef/common/chef-operational-state-delegate-impl.cpp b/examples/chef/common/chef-operational-state-delegate-impl.cpp index aae7c53a75818b..c3d337969a9637 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.cpp +++ b/examples/chef/common/chef-operational-state-delegate-impl.cpp @@ -190,10 +190,9 @@ void OperationalState::Shutdown() } } -chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip::EndpointId endpointId, - chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer) +chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) { chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. @@ -244,8 +243,8 @@ chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip } chip::Protocols::InteractionModel::Status chefOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer, uint16_t maxReadLength) + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) { chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; chip::AttributeId attributeId = attributeMetadata->attributeId; @@ -288,5 +287,4 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) gOperationalStateInstance->Init(); } - #endif diff --git a/examples/chef/common/chef-operational-state-delegate-impl.h b/examples/chef/common/chef-operational-state-delegate-impl.h index 03a6582be98ca1..bb61d5a3548395 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.h +++ b/examples/chef/common/chef-operational-state-delegate-impl.h @@ -150,10 +150,10 @@ void Shutdown(); } // namespace chip chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); chip::Protocols::InteractionModel::Status chefOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer, uint16_t maxReadLength); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); #endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER From bac60e4131d3a22d7ab517263bf20d05d917fb7d Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 6 Sep 2024 22:13:39 +0000 Subject: [PATCH 08/13] Restyled by gn --- examples/chef/linux/BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chef/linux/BUILD.gn b/examples/chef/linux/BUILD.gn index 63ad94e04bac34..238c7b4e2c1570 100644 --- a/examples/chef/linux/BUILD.gn +++ b/examples/chef/linux/BUILD.gn @@ -42,11 +42,11 @@ executable("${sample_name}") { sources = [ "${project_dir}/common/chef-air-quality.cpp", "${project_dir}/common/chef-concentration-measurement.cpp", + "${project_dir}/common/chef-dishwasher-alarm-delegate-impl.cpp", + "${project_dir}/common/chef-dishwasher-mode-delegate-impl.cpp", "${project_dir}/common/chef-fan-control-manager.cpp", "${project_dir}/common/chef-laundry-washer-controls-delegate-impl.cpp", "${project_dir}/common/chef-laundry-washer-mode.cpp", - "${project_dir}/common/chef-dishwasher-alarm-delegate-impl.cpp", - "${project_dir}/common/chef-dishwasher-mode-delegate-impl.cpp", "${project_dir}/common/chef-operational-state-delegate-impl.cpp", "${project_dir}/common/chef-rpc-actions-worker.cpp", "${project_dir}/common/chef-rvc-mode-delegate.cpp", From 1924910b26b82aa5054dfebd19868430d76bce1d Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Thu, 12 Sep 2024 11:28:35 -0700 Subject: [PATCH 09/13] Update Zap config for dishwasher on TOT --- .../rootnode_dishwasher_cc105034fe.matter | 6 +-- .../rootnode_dishwasher_cc105034fe.zap | 40 ++----------------- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 6fdaedb4842557..c957325ff4d4b2 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -1813,7 +1813,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; + ram attribute clusterRevision default = 5; handle command Identify; handle command TriggerEffect; @@ -1863,8 +1863,6 @@ endpoint 1 { server cluster DishwasherMode { callback attribute supportedModes; callback attribute currentMode; - callback attribute startUpMode; - callback attribute onMode; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; @@ -1906,7 +1904,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 3; handle command Pause; handle command Stop; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index 95695505318ea1..aed7127ce59b9b 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -2914,7 +2914,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "4", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3213,10 +3213,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3462,38 +3462,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "StartUpMode", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OnMode", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "GeneratedCommandList", "code": 65528, @@ -4009,7 +3977,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, From b1f29a49bdb5a6501bcff7546f363ad5dd5207b7 Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Thu, 12 Sep 2024 11:28:35 -0700 Subject: [PATCH 10/13] Update Zap config for dishwasher on TOT --- .../rootnode_dishwasher_cc105034fe.matter | 38 +++++ .../rootnode_dishwasher_cc105034fe.zap | 138 ++++++++++++++++++ 2 files changed, 176 insertions(+) diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index c957325ff4d4b2..40950661907ae6 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -611,6 +611,23 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + attribute access(write: manage) char_string<35> activeLocale = 0; + readonly attribute char_string supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** Nodes should be expected to be deployed to any and all regions of the world. These global regions may have differing preferences for the units in which values are conveyed in communication to a user. As such, Nodes that visually or audibly convey measurable values to the user need a @@ -1407,6 +1424,16 @@ cluster DishwasherMode = 89 { revision 2; enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; kNormal = 16384; kHeavy = 16385; kLight = 16386; @@ -1641,6 +1668,17 @@ endpoint 0 { ram attribute clusterRevision default = 3; } + server cluster LocalizationConfiguration { + ram attribute activeLocale; + callback attribute supportedLocales; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + server cluster UnitLocalization { persist attribute temperatureUnit default = 0; callback attribute generatedCommandList; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index aed7127ce59b9b..356bc8e4025c8c 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -958,6 +958,144 @@ } ] }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Unit Localization", "code": 45, From 8e9adf017bfb2e6dd2a52e82e9b2853a8c0b2929 Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Tue, 17 Sep 2024 14:16:22 -0700 Subject: [PATCH 11/13] Resolve PR comments for dishwasher --- .../common/chef-dishwasher-alarm-delegate-impl.cpp | 2 +- .../common/chef-dishwasher-mode-delegate-impl.cpp | 6 +++--- .../chef/common/chef-dishwasher-mode-delegate-impl.h | 4 ++-- .../common/chef-operational-state-delegate-impl.cpp | 5 +++-- .../common/chef-operational-state-delegate-impl.h | 2 +- examples/chef/common/stubs.cpp | 12 ++++++------ 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp index b9894b5fa3cd1f..aa1e9e66255672 100644 --- a/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp +++ b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2024 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp index a600d6a24c750e..aceb654c0de7d0 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2024 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -107,7 +107,7 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip:: ret = gDishwasherModeInstance->UpdateCurrentMode(m); if (chip::Protocols::InteractionModel::Status::Success != ret) { - ChipLogError(DeviceLayer, "Invalid Attribute Update status: %d", static_cast(ret)); + ChipLogError(DeviceLayer, "Invalid Attribute Write to CurrentMode : %d", static_cast(ret)); } } break; @@ -124,7 +124,7 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::E const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength) { - VerifyOrReturnValue(maxReadLength > 0, chip::Protocols::InteractionModel::Status::ResourceExhausted); + VerifyOrReturnValue(maxReadLength == 1 , chip::Protocols::InteractionModel::Status::ResourceExhausted); buffer[0] = gDishwasherModeInstance->GetCurrentMode(); chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h index 0b118aa3e1bab7..547ffe725fce0d 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2024 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -87,4 +87,4 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip:: chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength); -#endif +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER diff --git a/examples/chef/common/chef-operational-state-delegate-impl.cpp b/examples/chef/common/chef-operational-state-delegate-impl.cpp index 5f76c9cc039ede..97ccad04500188 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.cpp +++ b/examples/chef/common/chef-operational-state-delegate-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2024 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -238,6 +238,7 @@ chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip { gOperationalStateDelegate->mCountDownTime.SetNonNull( static_cast(gOperationalStateDelegate->kExampleCountDown)); + (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, gOperationalStateDelegate); } if (CHIP_NO_ERROR == err) @@ -302,4 +303,4 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) gOperationalStateInstance->Init(); } -#endif +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER diff --git a/examples/chef/common/chef-operational-state-delegate-impl.h b/examples/chef/common/chef-operational-state-delegate-impl.h index 884a6f28c2828c..d2b01cb01014ea 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.h +++ b/examples/chef/common/chef-operational-state-delegate-impl.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2024 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 1cbf3eed87fbfb..e469727ed11047 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -32,11 +32,11 @@ #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER #include "chef-dishwasher-mode-delegate-impl.h" -#endif +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER #include "chef-operational-state-delegate-impl.h" -#endif +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER using chip::app::DataModel::Nullable; @@ -96,11 +96,11 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER case chip::app::Clusters::DishwasherMode::Id: return chefDishwasherModeReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); -#endif +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER case chip::app::Clusters::OperationalState::Id: return chefOperationalStateReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); -#endif +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER default: break; } @@ -169,11 +169,11 @@ Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(Endpoi #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER case chip::app::Clusters::DishwasherMode::Id: return chefDishwasherModeWriteCallback(endpoint, clusterId, attributeMetadata, buffer); -#endif +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER case chip::app::Clusters::OperationalState::Id: return chefOperationalStateWriteCallback(endpoint, clusterId, attributeMetadata, buffer); -#endif +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER default: break; } From bf135942673d87ae9dfebccec73ab630857b1aca Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 17 Sep 2024 21:17:21 +0000 Subject: [PATCH 12/13] Restyled by clang-format --- .../common/chef-dishwasher-mode-delegate-impl.cpp | 2 +- .../common/chef-operational-state-delegate-impl.cpp | 5 +++-- examples/chef/common/stubs.cpp | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp index aceb654c0de7d0..b5206ef407dab6 100644 --- a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp @@ -124,7 +124,7 @@ chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::E const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength) { - VerifyOrReturnValue(maxReadLength == 1 , chip::Protocols::InteractionModel::Status::ResourceExhausted); + VerifyOrReturnValue(maxReadLength == 1, chip::Protocols::InteractionModel::Status::ResourceExhausted); buffer[0] = gDishwasherModeInstance->GetCurrentMode(); chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; diff --git a/examples/chef/common/chef-operational-state-delegate-impl.cpp b/examples/chef/common/chef-operational-state-delegate-impl.cpp index 97ccad04500188..815fc50b28d582 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.cpp +++ b/examples/chef/common/chef-operational-state-delegate-impl.cpp @@ -238,7 +238,8 @@ chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip { gOperationalStateDelegate->mCountDownTime.SetNonNull( static_cast(gOperationalStateDelegate->kExampleCountDown)); - (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, gOperationalStateDelegate); + (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, + gOperationalStateDelegate); } if (CHIP_NO_ERROR == err) @@ -303,4 +304,4 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) gOperationalStateInstance->Init(); } -#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index e469727ed11047..6ec7c9e92f4cd0 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -32,11 +32,11 @@ #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER #include "chef-dishwasher-mode-delegate-impl.h" -#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER #include "chef-operational-state-delegate-impl.h" -#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER using chip::app::DataModel::Nullable; @@ -96,11 +96,11 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER case chip::app::Clusters::DishwasherMode::Id: return chefDishwasherModeReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); -#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER case chip::app::Clusters::OperationalState::Id: return chefOperationalStateReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); -#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER default: break; } @@ -169,11 +169,11 @@ Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(Endpoi #ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER case chip::app::Clusters::DishwasherMode::Id: return chefDishwasherModeWriteCallback(endpoint, clusterId, attributeMetadata, buffer); -#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER case chip::app::Clusters::OperationalState::Id: return chefOperationalStateWriteCallback(endpoint, clusterId, attributeMetadata, buffer); -#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER default: break; } From 2ad78967fed6c0ac8a0c6e24fc8d999db76d8dc0 Mon Sep 17 00:00:00 2001 From: bakreanuj Date: Tue, 17 Sep 2024 18:00:46 -0700 Subject: [PATCH 13/13] rolve PR comments. --- examples/chef/common/chef-operational-state-delegate-impl.cpp | 2 +- examples/chef/common/chef-operational-state-delegate-impl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chef/common/chef-operational-state-delegate-impl.cpp b/examples/chef/common/chef-operational-state-delegate-impl.cpp index 815fc50b28d582..5e94acddc0e1ee 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.cpp +++ b/examples/chef/common/chef-operational-state-delegate-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Project CHIP Authors + * Copyright (c) 2023 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/examples/chef/common/chef-operational-state-delegate-impl.h b/examples/chef/common/chef-operational-state-delegate-impl.h index d2b01cb01014ea..884a6f28c2828c 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.h +++ b/examples/chef/common/chef-operational-state-delegate-impl.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2024 Project CHIP Authors + * Copyright (c) 2023 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License");