From 896050ecab7ba3b2734842cb98e75c739dfbac64 Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Thu, 17 Oct 2024 03:51:45 +0800 Subject: [PATCH 01/14] add temperature control cluster impl for laundry washer --- .../static-supported-temperature-levels.cpp | 77 ++++ .../static-supported-temperature-levels.h | 65 ++++ examples/chef/common/stubs.cpp | 8 + .../rootnode_laundrywasher_fb10d238c8.matter | 133 +++++++ .../rootnode_laundrywasher_fb10d238c8.zap | 334 +++++++++++++++++- examples/chef/linux/BUILD.gn | 1 + examples/chef/nrfconnect/CMakeLists.txt | 1 + 7 files changed, 614 insertions(+), 5 deletions(-) create mode 100644 examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp create mode 100644 examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp new file mode 100644 index 00000000000000..d19686bc45b34e --- /dev/null +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -0,0 +1,77 @@ +/* + * + * 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 "static-supported-temperature-levels.h" +#include + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::TemperatureControl; +using chip::Protocols::InteractionModel::Status; + + +//#ifdef MATTER_DM_PLUGIN_WASHER_SERVER +app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; + +CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan("Hot", 3), CharSpan("Warm", 4), + CharSpan("Freezing", 8) }; + +const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints + [MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { + EndpointPair(1, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, 3) // Options for Endpoint 1 + }; + +uint8_t AppSupportedTemperatureLevelsDelegate::Size() +{ + for (auto & endpointPair : AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints) + { + if (endpointPair.mEndpointId == mEndpoint) + { + return endpointPair.mSize; + } + } + return 0; +} + +CHIP_ERROR AppSupportedTemperatureLevelsDelegate::Next(MutableCharSpan & item) +{ + for (auto & endpointPair : AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints) + { + if (endpointPair.mEndpointId == mEndpoint) + { + if (endpointPair.mSize > mIndex) + { + CHIP_ERROR err = CopyCharSpanToMutableCharSpan(endpointPair.mTemperatureLevels[mIndex], item); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Error copying char span to mutable char span %s", ErrorStr(err)); + return err; + } + mIndex++; + return CHIP_NO_ERROR; + } + } + } + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; +} +void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) +{ + VerifyOrDie(endpoint == 1); // this cluster is only enabled for endpoint 1. + chip::app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); +} diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h new file mode 100644 index 00000000000000..bdbc94a1b3ca39 --- /dev/null +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h @@ -0,0 +1,65 @@ +/* + * + * 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 + +//#endif // MATTER_DM_PLUGIN_WASHER_SERVER +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace TemperatureControl { + +/** + * This implementation statically defines the options. + */ + +class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsIteratorDelegate +{ + struct EndpointPair + { + EndpointId mEndpointId; + CharSpan * mTemperatureLevels; + uint8_t mSize; + + EndpointPair(EndpointId aEndpointId, CharSpan * aTemperatureLevels, uint8_t aSize) : + mEndpointId(aEndpointId), mTemperatureLevels(aTemperatureLevels), mSize(aSize) + {} + + ~EndpointPair() {} + }; + + static CharSpan temperatureLevelOptions[3]; + +public: + static const EndpointPair supportedOptionsByEndpoints[MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT]; + + uint8_t Size() override; + + CHIP_ERROR Next(MutableCharSpan & item) override; + + ~AppSupportedTemperatureLevelsDelegate() {} +}; + +} // namespace TemperatureControl +} // namespace Clusters +} // namespace app +} // namespace chip +//#endif // MATTER_DM_PLUGIN_WASHER_SERVER diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 687b572a4ceefb..576bd6cfbb22a3 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -62,6 +62,14 @@ const Clusters::Descriptor::Structs::SemanticTagStruct::Type freezerTagList[] #include "chef-dishwasher-mode-delegate-impl.h" #endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER +#include "chef-laundry-washer-mode.h" +#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER + +#ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_CONTROLS_SERVER +#include "chef-laundry-washer-controls-delegate-impl.h" +#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_CONTROLS_SERVER + #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER #include "chef-operational-state-delegate-impl.h" #endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index e595c866c2a47b..95e5981371cb71 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -241,6 +241,78 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +/** 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; @@ -1345,6 +1417,38 @@ cluster LaundryWasherControls = 83 { readonly attribute int16u clusterRevision = 65533; } +/** 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; +} + /** 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; @@ -1640,6 +1744,20 @@ endpoint 1 { device type ma_laundry_washer = 115, version 1; + server cluster OnOff { + ram attribute onOff default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 6; + + handle command Off; + handle command On; + handle command Toggle; + } + server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1679,11 +1797,25 @@ endpoint 1 { ram attribute clusterRevision default = 1; } + server cluster TemperatureControl { + ram attribute selectedTemperatureLevel default = 0; + callback attribute supportedTemperatureLevels; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } + server cluster OperationalState { emits event OperationalError; emits event OperationCompletion; callback attribute phaseList; callback attribute currentPhase; + callback attribute countdownTime; callback attribute operationalStateList; callback attribute operationalState; callback attribute operationalError; @@ -1696,6 +1828,7 @@ endpoint 1 { handle command Pause; handle command Stop; handle command Start; + handle command Resume; handle command OperationalCommandResponse; } } diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 163f7e1b17ee79..7b0d95d3c5180b 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -1,6 +1,6 @@ { "fileFormat": 2, - "featureLevel": 103, + "featureLevel": 104, "creator": "zap", "keyValuePairs": [ { @@ -41,14 +41,16 @@ "code": 22, "profileId": 259, "label": "MA-rootdevice", - "name": "MA-rootdevice" + "name": "MA-rootdevice", + "deviceTypeOrder": 0 }, "deviceTypes": [ { "code": 22, "profileId": 259, "label": "MA-rootdevice", - "name": "MA-rootdevice" + "name": "MA-rootdevice", + "deviceTypeOrder": 0 } ], "deviceVersions": [ @@ -2670,14 +2672,16 @@ "code": 115, "profileId": 259, "label": "MA-laundry-washer", - "name": "MA-laundry-washer" + "name": "MA-laundry-washer", + "deviceTypeOrder": 0 }, "deviceTypes": [ { "code": 115, "profileId": 259, "label": "MA-laundry-washer", - "name": "MA-laundry-washer" + "name": "MA-laundry-washer", + "deviceTypeOrder": 0 } ], "deviceVersions": [ @@ -2690,6 +2694,154 @@ "deviceTypeCode": 115, "deviceTypeProfileId": 259, "clusters": [ + { + "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": "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": "6", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Descriptor", "code": 29, @@ -3170,6 +3322,154 @@ } ] }, + { + "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": "SelectedTemperatureLevel", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedTemperatureLevels", + "code": 5, + "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": "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": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Operational State", "code": 96, @@ -3202,6 +3502,14 @@ "isIncoming": 1, "isEnabled": 1 }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, { "name": "OperationalCommandResponse", "code": 4, @@ -3244,6 +3552,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "CountdownTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "OperationalStateList", "code": 3, diff --git a/examples/chef/linux/BUILD.gn b/examples/chef/linux/BUILD.gn index a65e6e7b6ad3a0..360c5fb349d147 100644 --- a/examples/chef/linux/BUILD.gn +++ b/examples/chef/linux/BUILD.gn @@ -65,6 +65,7 @@ executable("${sample_name}") { "${project_dir}/common/clusters/switch/SwitchEventHandler.cpp", "${project_dir}/common/clusters/switch/SwitchManager.cpp", "${project_dir}/common/clusters/target-navigator/TargetNavigatorManager.cpp", + "${project_dir}/common/clusters/temperature-control/static-supported-temperature-levels.cpp", "${project_dir}/common/clusters/wake-on-lan/WakeOnLanManager.cpp", "${project_dir}/common/stubs.cpp", "${project_dir}/linux/main.cpp", diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index 732398cc1bf728..32def1dbf41445 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -101,6 +101,7 @@ target_sources(app PRIVATE ${CHEF}/common/clusters/resource-monitoring/chef-resource-monitoring-delegates.cpp ${CHEF}/common/clusters/switch/SwitchEventHandler.cpp ${CHEF}/common/clusters/switch/SwitchManager.cpp + ${CHEF}/common/clusters/temperature-control/static-supported-temperature-levels.cpp ${CHEF}/common/clusters/target-navigator/TargetNavigatorManager.cpp ${CHEF}/common/clusters/wake-on-lan/WakeOnLanManager.cpp ${CHEF}/common/stubs.cpp From 0ec3f4d4fc66a891a6849cafa8ce7ee18d2b389d Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Thu, 17 Oct 2024 22:54:55 +0800 Subject: [PATCH 02/14] add washer mode reader writer --- .../chef/common/chef-laundry-washer-mode.cpp | 58 +++++++++++++++++++ .../chef/common/chef-laundry-washer-mode.h | 9 +++ .../static-supported-temperature-levels.cpp | 6 +- examples/chef/common/stubs.cpp | 16 +++++ examples/chef/esp32/main/CMakeLists.txt | 1 + 5 files changed, 87 insertions(+), 3 deletions(-) diff --git a/examples/chef/common/chef-laundry-washer-mode.cpp b/examples/chef/common/chef-laundry-washer-mode.cpp index f24e1c6cbcfec6..01de09ed5639f9 100644 --- a/examples/chef/common/chef-laundry-washer-mode.cpp +++ b/examples/chef/common/chef-laundry-washer-mode.cpp @@ -25,6 +25,7 @@ template using List = chip::app::DataModel::List; using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::Type; +#ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER static LaundryWasherModeDelegate * gLaundryWasherModeDelegate = nullptr; static ModeBase::Instance * gLaundryWasherModeInstance = nullptr; @@ -94,6 +95,62 @@ void LaundryWasherMode::Shutdown() } } +chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1 + VerifyOrDie(gLaundryWasherModeInstance != nullptr); + chip::Protocols::InteractionModel::Status ret; + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::LaundryWasherMode::Attributes::CurrentMode::Id: { + uint8_t m = static_cast(buffer[0]); + ret = gLaundryWasherModeInstance->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 Attribute ID: %d", static_cast(attributeId)); + break; + } + + return ret; +} + +chip::Protocols::InteractionModel::Status chefLaundryWasherModeReadCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) +{ + VerifyOrReturnValue(maxReadLength > 0, chip::Protocols::InteractionModel::Status::ResourceExhausted); + buffer[0] = gLaundryWasherModeInstance->GetCurrentMode(); + + chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::LaundryWasherMode::Attributes::CurrentMode::Id: { + *buffer = gLaundryWasherModeInstance->GetCurrentMode(); + ChipLogDetail(DeviceLayer, "Reading LaundryWasherMode CurrentMode : %d", static_cast(attributeId)); + } + break; + default: + ret = chip::Protocols::InteractionModel::Status::UnsupportedRead; + ChipLogDetail(DeviceLayer, "Unsupported attributeId %d from reading RvcCleanMode", static_cast(attributeId)); + break; + } + + return ret; +} + + void emberAfLaundryWasherModeClusterInitCallback(chip::EndpointId endpointId) { VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. @@ -103,3 +160,4 @@ void emberAfLaundryWasherModeClusterInitCallback(chip::EndpointId endpointId) new ModeBase::Instance(gLaundryWasherModeDelegate, 0x1, LaundryWasherMode::Id, chip::to_underlying(Feature::kOnOff)); gLaundryWasherModeInstance->Init(); } +#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER diff --git a/examples/chef/common/chef-laundry-washer-mode.h b/examples/chef/common/chef-laundry-washer-mode.h index 5d35c03d4e50cd..d02a738ea6f8f7 100644 --- a/examples/chef/common/chef-laundry-washer-mode.h +++ b/examples/chef/common/chef-laundry-washer-mode.h @@ -82,3 +82,12 @@ void Shutdown(); } // namespace Clusters } // namespace app } // namespace chip + +#ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER +chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); +chip::Protocols::InteractionModel::Status chefLaundryWasherModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); +#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER \ No newline at end of file diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index d19686bc45b34e..0160bc6a681a21 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -17,6 +17,8 @@ */ #include + +#ifdef MATTER_DM_PLUGIN_TEMPERATURE_CONTROL_SERVER #include "static-supported-temperature-levels.h" #include @@ -25,13 +27,10 @@ using namespace chip::app::Clusters; using namespace chip::app::Clusters::TemperatureControl; using chip::Protocols::InteractionModel::Status; - -//#ifdef MATTER_DM_PLUGIN_WASHER_SERVER app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan("Hot", 3), CharSpan("Warm", 4), CharSpan("Freezing", 8) }; - const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints [MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { EndpointPair(1, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, 3) // Options for Endpoint 1 @@ -75,3 +74,4 @@ void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) VerifyOrDie(endpoint == 1); // this cluster is only enabled for endpoint 1. chip::app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); } +#endif // MATTER_DM_PLUGIN_TEMPERATURE_CONTROL_SERVER \ No newline at end of file diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 576bd6cfbb22a3..cae834a8a74149 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -70,10 +70,18 @@ const Clusters::Descriptor::Structs::SemanticTagStruct::Type freezerTagList[] #include "chef-laundry-washer-controls-delegate-impl.h" #endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_CONTROLS_SERVER +#ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER +#include "chef-laundry-washer-mode.h" +#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER + #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER #include "chef-operational-state-delegate-impl.h" #endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +#ifdef MATTER_DM_PLUGIN_TEMPERATURE_CONTROL_SERVER +#include "temperature-control/static-supported-temperature-levels.h" +#endif // MATTER_DM_PLUGIN_TEMPERATURE_CONTROL_SERVER + Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength) @@ -132,6 +140,10 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin case chip::app::Clusters::DishwasherMode::Id: return chefDishwasherModeReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); #endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER + case chip::app::Clusters::LaundryWasherMode::Id: + return chefLaundryWasherModeReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); +#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER case chip::app::Clusters::OperationalState::Id: return chefOperationalStateReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); @@ -210,6 +222,10 @@ Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(Endpoi case chip::app::Clusters::DishwasherMode::Id: return chefDishwasherModeWriteCallback(endpoint, clusterId, attributeMetadata, buffer); #endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER + case chip::app::Clusters::LaundryWasherMode::Id: + return chefLaundryWasherModeWriteCallback(endpoint, clusterId, attributeMetadata, buffer); +#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER case chip::app::Clusters::OperationalState::Id: return chefOperationalStateWriteCallback(endpoint, clusterId, attributeMetadata, buffer); diff --git a/examples/chef/esp32/main/CMakeLists.txt b/examples/chef/esp32/main/CMakeLists.txt index 49f3fbabdc7113..5c8963f7735f6d 100644 --- a/examples/chef/esp32/main/CMakeLists.txt +++ b/examples/chef/esp32/main/CMakeLists.txt @@ -74,6 +74,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/../common/clusters/resource-monitoring/" "${CMAKE_SOURCE_DIR}/../common/clusters/switch/" "${CMAKE_SOURCE_DIR}/../common/clusters/target-navigator/" + "${CMAKE_SOURCE_DIR}/../common/clusters/temperature-control/" "${CMAKE_SOURCE_DIR}/../common/clusters/wake-on-lan/" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" From bd06efb6f6db800fc59dbb589523609126e316f2 Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Fri, 18 Oct 2024 19:48:44 +0800 Subject: [PATCH 03/14] remove extra import --- examples/chef/common/chef-laundry-washer-mode.h | 2 +- .../static-supported-temperature-levels.cpp | 2 +- examples/chef/common/stubs.cpp | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/chef/common/chef-laundry-washer-mode.h b/examples/chef/common/chef-laundry-washer-mode.h index d02a738ea6f8f7..9f6bae60124cdf 100644 --- a/examples/chef/common/chef-laundry-washer-mode.h +++ b/examples/chef/common/chef-laundry-washer-mode.h @@ -90,4 +90,4 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chi chip::Protocols::InteractionModel::Status chefLaundryWasherModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength); -#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER \ No newline at end of file +#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index 0160bc6a681a21..1fedc1f374acf1 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -74,4 +74,4 @@ void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) VerifyOrDie(endpoint == 1); // this cluster is only enabled for endpoint 1. chip::app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); } -#endif // MATTER_DM_PLUGIN_TEMPERATURE_CONTROL_SERVER \ No newline at end of file +#endif // MATTER_DM_PLUGIN_TEMPERATURE_CONTROL_SERVER diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index cae834a8a74149..513bb412920d74 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -70,10 +70,6 @@ const Clusters::Descriptor::Structs::SemanticTagStruct::Type freezerTagList[] #include "chef-laundry-washer-controls-delegate-impl.h" #endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_CONTROLS_SERVER -#ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER -#include "chef-laundry-washer-mode.h" -#endif // MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER - #ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER #include "chef-operational-state-delegate-impl.h" #endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER From cef24bf19911ece5065bc2222d86ae1a5a088752 Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Fri, 18 Oct 2024 20:19:31 +0800 Subject: [PATCH 04/14] fix style --- examples/chef/common/chef-laundry-washer-mode.cpp | 8 ++++---- examples/chef/common/chef-laundry-washer-mode.h | 8 ++++---- .../static-supported-temperature-levels.cpp | 4 ++-- .../static-supported-temperature-levels.h | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/chef/common/chef-laundry-washer-mode.cpp b/examples/chef/common/chef-laundry-washer-mode.cpp index 01de09ed5639f9..3a26dd935566fa 100644 --- a/examples/chef/common/chef-laundry-washer-mode.cpp +++ b/examples/chef/common/chef-laundry-washer-mode.cpp @@ -96,8 +96,8 @@ void LaundryWasherMode::Shutdown() } chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(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(gLaundryWasherModeInstance != nullptr); @@ -125,8 +125,8 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chi } chip::Protocols::InteractionModel::Status chefLaundryWasherModeReadCallback(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] = gLaundryWasherModeInstance->GetCurrentMode(); diff --git a/examples/chef/common/chef-laundry-washer-mode.h b/examples/chef/common/chef-laundry-washer-mode.h index 9f6bae60124cdf..ffbcc453210f0c 100644 --- a/examples/chef/common/chef-laundry-washer-mode.h +++ b/examples/chef/common/chef-laundry-washer-mode.h @@ -85,9 +85,9 @@ void Shutdown(); #ifdef MATTER_DM_PLUGIN_LAUNDRY_WASHER_MODE_SERVER chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, - uint8_t * buffer); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); chip::Protocols::InteractionModel::Status chefLaundryWasherModeReadCallback(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_LAUNDRY_WASHER_MODE_SERVER diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index 1fedc1f374acf1..ed736e3e7fab23 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -38,11 +38,11 @@ const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatur uint8_t AppSupportedTemperatureLevelsDelegate::Size() { - for (auto & endpointPair : AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints) + for (auto & endpointPair : AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints) { if (endpointPair.mEndpointId == mEndpoint) { - return endpointPair.mSize; + return endpointPair.mSize; } } return 0; diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h index bdbc94a1b3ca39..233ad3beea2ca1 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h @@ -18,7 +18,7 @@ #pragma once -//#endif // MATTER_DM_PLUGIN_WASHER_SERVER +// #endif // MATTER_DM_PLUGIN_WASHER_SERVER #include #include @@ -62,4 +62,4 @@ class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsI } // namespace Clusters } // namespace app } // namespace chip -//#endif // MATTER_DM_PLUGIN_WASHER_SERVER +// #endif // MATTER_DM_PLUGIN_WASHER_SERVER From 63d2048ca61e5582a613b1fb9dd7314e7c730ffe Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 18 Oct 2024 12:20:15 +0000 Subject: [PATCH 05/14] Restyled by clang-format --- examples/chef/common/chef-laundry-washer-mode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/chef/common/chef-laundry-washer-mode.cpp b/examples/chef/common/chef-laundry-washer-mode.cpp index 3a26dd935566fa..c3bf8d9e21303e 100644 --- a/examples/chef/common/chef-laundry-washer-mode.cpp +++ b/examples/chef/common/chef-laundry-washer-mode.cpp @@ -150,7 +150,6 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeReadCallback(chip return ret; } - void emberAfLaundryWasherModeClusterInitCallback(chip::EndpointId endpointId) { VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. From 431e9c40fb5d082f6b28975a91b5a2c7ec6e3a91 Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Mon, 21 Oct 2024 16:43:44 +0800 Subject: [PATCH 06/14] update temperature level --- .../static-supported-temperature-levels.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index ed736e3e7fab23..e75f46f25245e5 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -29,8 +29,8 @@ using chip::Protocols::InteractionModel::Status; app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; -CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan("Hot", 3), CharSpan("Warm", 4), - CharSpan("Freezing", 8) }; +CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan("Low", 3), CharSpan("Medium", 6), + CharSpan("High", 4) }; const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints [MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { EndpointPair(1, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, 3) // Options for Endpoint 1 From 49854f43e35ba6c0779367d659d420c10a29a404 Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Wed, 23 Oct 2024 16:58:31 +0800 Subject: [PATCH 07/14] string span; OnOff DF feature; --- .../chef/common/chef-laundry-washer-mode.cpp | 2 +- .../static-supported-temperature-levels.cpp | 8 ++- .../static-supported-temperature-levels.h | 11 +-- .../rootnode_laundrywasher_fb10d238c8.matter | 8 +-- .../rootnode_laundrywasher_fb10d238c8.zap | 70 +------------------ 5 files changed, 14 insertions(+), 85 deletions(-) diff --git a/examples/chef/common/chef-laundry-washer-mode.cpp b/examples/chef/common/chef-laundry-washer-mode.cpp index c3bf8d9e21303e..6b0a295d9005ab 100644 --- a/examples/chef/common/chef-laundry-washer-mode.cpp +++ b/examples/chef/common/chef-laundry-washer-mode.cpp @@ -107,7 +107,7 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chi switch (attributeId) { case chip::app::Clusters::LaundryWasherMode::Attributes::CurrentMode::Id: { - uint8_t m = static_cast(buffer[0]); + uint8_t m = buffer[0]; ret = gLaundryWasherModeInstance->UpdateCurrentMode(m); if (chip::Protocols::InteractionModel::Status::Success != ret) { diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index e75f46f25245e5..abefaf1779892e 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -29,11 +29,13 @@ using chip::Protocols::InteractionModel::Status; app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; -CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan("Low", 3), CharSpan("Medium", 6), - CharSpan("High", 4) }; +CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { "Low"_span, "Medium"_span, "High"_span }; +// uint8_t kLevelCount = ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions); + const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints [MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { - EndpointPair(1, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, 3) // Options for Endpoint 1 + EndpointPair(1, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, + ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions)) // Supported level options for endPoint 1 }; uint8_t AppSupportedTemperatureLevelsDelegate::Size() diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h index 233ad3beea2ca1..8758473fe57827 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.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"); @@ -18,7 +18,7 @@ #pragma once -// #endif // MATTER_DM_PLUGIN_WASHER_SERVER + #include #include @@ -27,10 +27,6 @@ namespace app { namespace Clusters { namespace TemperatureControl { -/** - * This implementation statically defines the options. - */ - class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsIteratorDelegate { struct EndpointPair @@ -42,8 +38,6 @@ class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsI EndpointPair(EndpointId aEndpointId, CharSpan * aTemperatureLevels, uint8_t aSize) : mEndpointId(aEndpointId), mTemperatureLevels(aTemperatureLevels), mSize(aSize) {} - - ~EndpointPair() {} }; static CharSpan temperatureLevelOptions[3]; @@ -62,4 +56,3 @@ class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsI } // namespace Clusters } // namespace app } // namespace chip -// #endif // MATTER_DM_PLUGIN_WASHER_SERVER diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 00345a50956b94..2e76d3f34a3a85 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -1748,9 +1748,8 @@ endpoint 1 { ram attribute onOff default = 0; callback attribute generatedCommandList; callback attribute acceptedCommandList; - callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + ram attribute featureMap default = 2; ram attribute clusterRevision default = 6; handle command Off; @@ -1785,8 +1784,8 @@ endpoint 1 { server cluster LaundryWasherControls { callback attribute spinSpeeds; - ram attribute spinSpeedCurrent; - ram attribute numberOfRinses; + ram attribute spinSpeedCurrent default = 1; + ram attribute numberOfRinses default = 1; callback attribute supportedRinses; callback attribute generatedCommandList; callback attribute acceptedCommandList; @@ -1800,7 +1799,6 @@ endpoint 1 { callback attribute supportedTemperatureLevels; callback attribute generatedCommandList; callback attribute acceptedCommandList; - callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 2; ram attribute clusterRevision default = 1; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 7b0d95d3c5180b..4de60f90e7afa2 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -2776,22 +2776,6 @@ "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, @@ -2818,7 +2802,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3086,22 +3070,6 @@ "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, @@ -3186,7 +3154,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3202,7 +3170,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3256,22 +3224,6 @@ "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, @@ -3404,22 +3356,6 @@ "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, From b799c981030906a727721e7dae3f4e48fbf02cbd Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 23 Oct 2024 08:59:24 +0000 Subject: [PATCH 08/14] Restyled by clang-format --- .../static-supported-temperature-levels.cpp | 3 ++- .../temperature-control/static-supported-temperature-levels.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index abefaf1779892e..75c37f96deeeb6 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -34,7 +34,8 @@ CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { "L const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints [MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { - EndpointPair(1, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, + EndpointPair( + 1, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions)) // Supported level options for endPoint 1 }; diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h index 8758473fe57827..d20ab764446c7e 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h @@ -18,7 +18,6 @@ #pragma once - #include #include From a89a4aa6444e3987da67e2ab3d32adb9a333c277 Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Wed, 23 Oct 2024 17:04:42 +0800 Subject: [PATCH 09/14] copyright year --- .../temperature-control/static-supported-temperature-levels.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index 75c37f96deeeb6..2f0024a3ca79d2 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.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"); From 8eb39ef268f1cb6b8aa66f3c32bfa487bdcfdfae Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Fri, 25 Oct 2024 01:51:05 +0800 Subject: [PATCH 10/14] static assert --- .../chef-laundry-washer-controls-delegate-impl.cpp | 2 ++ examples/chef/common/chef-laundry-washer-mode.cpp | 2 +- .../static-supported-temperature-levels.cpp | 9 +++++---- .../static-supported-temperature-levels.h | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/chef/common/chef-laundry-washer-controls-delegate-impl.cpp b/examples/chef/common/chef-laundry-washer-controls-delegate-impl.cpp index 4811b458fe8fc0..f63acf8938bb9f 100644 --- a/examples/chef/common/chef-laundry-washer-controls-delegate-impl.cpp +++ b/examples/chef/common/chef-laundry-washer-controls-delegate-impl.cpp @@ -30,8 +30,10 @@ const CharSpan LaundryWasherControlDelegate::spinSpeedsNameOptions[] = { }; const NumberOfRinsesEnum LaundryWasherControlDelegate::supportRinsesOptions[] = { + NumberOfRinsesEnum::kNone, NumberOfRinsesEnum::kNormal, NumberOfRinsesEnum::kExtra, + NumberOfRinsesEnum::kMax, }; LaundryWasherControlDelegate LaundryWasherControlDelegate::instance; diff --git a/examples/chef/common/chef-laundry-washer-mode.cpp b/examples/chef/common/chef-laundry-washer-mode.cpp index 6b0a295d9005ab..2500a562167adb 100644 --- a/examples/chef/common/chef-laundry-washer-mode.cpp +++ b/examples/chef/common/chef-laundry-washer-mode.cpp @@ -101,6 +101,7 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chi { VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1 VerifyOrDie(gLaundryWasherModeInstance != nullptr); + chip::Protocols::InteractionModel::Status ret; chip::AttributeId attributeId = attributeMetadata->attributeId; @@ -129,7 +130,6 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeReadCallback(chip uint8_t * buffer, uint16_t maxReadLength) { VerifyOrReturnValue(maxReadLength > 0, chip::Protocols::InteractionModel::Status::ResourceExhausted); - buffer[0] = gLaundryWasherModeInstance->GetCurrentMode(); chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; chip::AttributeId attributeId = attributeMetadata->attributeId; diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index 2f0024a3ca79d2..97975d29605a71 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -30,13 +30,12 @@ using chip::Protocols::InteractionModel::Status; app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { "Low"_span, "Medium"_span, "High"_span }; -// uint8_t kLevelCount = ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions); const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints [MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { EndpointPair( - 1, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, - ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions)) // Supported level options for endPoint 1 + 1 /* endpointId */, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, + ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions)) }; uint8_t AppSupportedTemperatureLevelsDelegate::Size() @@ -74,7 +73,9 @@ CHIP_ERROR AppSupportedTemperatureLevelsDelegate::Next(MutableCharSpan & item) } void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(endpoint == 1); // this cluster is only enabled for endpoint 1. + static_assert(MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT == 1, + "This cluster is only enabled for endpoint 1"); + chip::app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); } #endif // MATTER_DM_PLUGIN_TEMPERATURE_CONTROL_SERVER diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h index d20ab764446c7e..ba0c3dee9ab417 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h @@ -34,15 +34,15 @@ class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsI CharSpan * mTemperatureLevels; uint8_t mSize; - EndpointPair(EndpointId aEndpointId, CharSpan * aTemperatureLevels, uint8_t aSize) : - mEndpointId(aEndpointId), mTemperatureLevels(aTemperatureLevels), mSize(aSize) + EndpointPair(EndpointId aEndpointId, CharSpan * TemperatureLevels, uint8_t size) : + mEndpointId(aEndpointId), mTemperatureLevels(TemperatureLevels), mSize(size) {} }; static CharSpan temperatureLevelOptions[3]; + static const EndpointPair supportedOptionsByEndpoints[MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT]; public: - static const EndpointPair supportedOptionsByEndpoints[MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT]; uint8_t Size() override; From b6baf0ec6c094415bc814cbc91b2e16d450b31d3 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 24 Oct 2024 17:52:00 +0000 Subject: [PATCH 11/14] Restyled by clang-format --- .../static-supported-temperature-levels.cpp | 11 ++++------- .../static-supported-temperature-levels.h | 1 - 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp index 97975d29605a71..045825d8faf312 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -32,11 +32,9 @@ app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSup CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { "Low"_span, "Medium"_span, "High"_span }; const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints - [MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { - EndpointPair( - 1 /* endpointId */, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, - ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions)) - }; + [MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { EndpointPair( + 1 /* endpointId */, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, + ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions)) }; uint8_t AppSupportedTemperatureLevelsDelegate::Size() { @@ -73,8 +71,7 @@ CHIP_ERROR AppSupportedTemperatureLevelsDelegate::Next(MutableCharSpan & item) } void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) { - static_assert(MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT == 1, - "This cluster is only enabled for endpoint 1"); + static_assert(MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT == 1, "This cluster is only enabled for endpoint 1"); chip::app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); } diff --git a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h index ba0c3dee9ab417..c39bb171c93c58 100644 --- a/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h @@ -43,7 +43,6 @@ class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsI static const EndpointPair supportedOptionsByEndpoints[MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT]; public: - uint8_t Size() override; CHIP_ERROR Next(MutableCharSpan & item) override; From fe1949f842781c41886634cfecea658887218588 Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Fri, 25 Oct 2024 02:25:07 +0800 Subject: [PATCH 12/14] return error --- examples/chef/common/chef-laundry-washer-mode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/chef/common/chef-laundry-washer-mode.cpp b/examples/chef/common/chef-laundry-washer-mode.cpp index 2500a562167adb..af17367ac12359 100644 --- a/examples/chef/common/chef-laundry-washer-mode.cpp +++ b/examples/chef/common/chef-laundry-washer-mode.cpp @@ -100,7 +100,7 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chi uint8_t * buffer) { VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1 - VerifyOrDie(gLaundryWasherModeInstance != nullptr); + VerifyOrReturnError(gLaundryWasherModeInstance != nullptr, chip::Protocols::InteractionModel::Status::Failure); chip::Protocols::InteractionModel::Status ret; chip::AttributeId attributeId = attributeMetadata->attributeId; From b23c83b6dd5888b25b3adf1176eefa5bda121f08 Mon Sep 17 00:00:00 2001 From: Sting Chang Date: Fri, 25 Oct 2024 08:35:43 +0800 Subject: [PATCH 13/14] verify and return --- examples/chef/common/chef-laundry-washer-mode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chef/common/chef-laundry-washer-mode.cpp b/examples/chef/common/chef-laundry-washer-mode.cpp index af17367ac12359..86beb810434145 100644 --- a/examples/chef/common/chef-laundry-washer-mode.cpp +++ b/examples/chef/common/chef-laundry-washer-mode.cpp @@ -99,8 +99,8 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chi const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) { - VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1 - VerifyOrReturnError(gLaundryWasherModeInstance != nullptr, chip::Protocols::InteractionModel::Status::Failure); + VerifyOrReturnError(endpointId == 1 || gLaundryWasherModeInstance != nullptr, + chip::Protocols::InteractionModel::Status::Failure); chip::Protocols::InteractionModel::Status ret; chip::AttributeId attributeId = attributeMetadata->attributeId; From 06ce3db115784067f682f1cb369954f5a519bdf3 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Oct 2024 00:37:04 +0000 Subject: [PATCH 14/14] Restyled by whitespace --- examples/chef/common/chef-laundry-washer-mode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/chef/common/chef-laundry-washer-mode.cpp b/examples/chef/common/chef-laundry-washer-mode.cpp index 86beb810434145..8ca637ca29404a 100644 --- a/examples/chef/common/chef-laundry-washer-mode.cpp +++ b/examples/chef/common/chef-laundry-washer-mode.cpp @@ -99,7 +99,7 @@ chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chi const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) { - VerifyOrReturnError(endpointId == 1 || gLaundryWasherModeInstance != nullptr, + VerifyOrReturnError(endpointId == 1 || gLaundryWasherModeInstance != nullptr, chip::Protocols::InteractionModel::Status::Failure); chip::Protocols::InteractionModel::Status ret;