From d4087fca114377dbeaca10ccba7c7512db92ff0b Mon Sep 17 00:00:00 2001 From: Sting Chang <33673360+stingchang@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:27:56 +0000 Subject: [PATCH] Add temperature control cluster impl for laundry washer (#36105) * add temperature control cluster impl for laundry washer * add washer mode reader writer * remove extra import * fix style * Restyled by clang-format * update temperature level * string span; OnOff DF feature; * Restyled by clang-format * copyright year * static assert * Restyled by clang-format * return error * verify and return * Restyled by whitespace --------- Co-authored-by: Restyled.io --- ...-laundry-washer-controls-delegate-impl.cpp | 2 + .../chef/common/chef-laundry-washer-mode.cpp | 57 ++++ .../chef/common/chef-laundry-washer-mode.h | 9 + .../static-supported-temperature-levels.cpp | 78 +++++ .../static-supported-temperature-levels.h | 56 ++++ examples/chef/common/stubs.cpp | 20 ++ .../rootnode_laundrywasher_fb10d238c8.matter | 135 +++++++- .../rootnode_laundrywasher_fb10d238c8.zap | 312 ++++++++++++++++-- examples/chef/esp32/main/CMakeLists.txt | 1 + examples/chef/linux/BUILD.gn | 1 + examples/chef/nrfconnect/CMakeLists.txt | 1 + 11 files changed, 644 insertions(+), 28 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/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 f24e1c6cbcfec6..8ca637ca29404a 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,61 @@ void LaundryWasherMode::Shutdown() } } +chip::Protocols::InteractionModel::Status chefLaundryWasherModeWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) +{ + VerifyOrReturnError(endpointId == 1 || gLaundryWasherModeInstance != nullptr, + chip::Protocols::InteractionModel::Status::Failure); + + chip::Protocols::InteractionModel::Status ret; + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::LaundryWasherMode::Attributes::CurrentMode::Id: { + uint8_t m = 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); + + 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 +159,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..ffbcc453210f0c 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 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..045825d8faf312 --- /dev/null +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.cpp @@ -0,0 +1,78 @@ +/* + * + * Copyright (c) 2024 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 + +#ifdef MATTER_DM_PLUGIN_TEMPERATURE_CONTROL_SERVER +#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; + +app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; + +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)) }; + +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) +{ + 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 new file mode 100644 index 00000000000000..c39bb171c93c58 --- /dev/null +++ b/examples/chef/common/clusters/temperature-control/static-supported-temperature-levels.h @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2024 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 + +namespace chip { +namespace app { +namespace Clusters { +namespace TemperatureControl { + +class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsIteratorDelegate +{ + struct EndpointPair + { + EndpointId mEndpointId; + CharSpan * mTemperatureLevels; + uint8_t mSize; + + 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: + uint8_t Size() override; + + CHIP_ERROR Next(MutableCharSpan & item) override; + + ~AppSupportedTemperatureLevelsDelegate() {} +}; + +} // namespace TemperatureControl +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 687b572a4ceefb..513bb412920d74 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -62,10 +62,22 @@ 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 +#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) @@ -124,6 +136,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); @@ -202,6 +218,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/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index f38dd8f3dfb7fd..2e76d3f34a3a85 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,19 @@ 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 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; @@ -1667,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; @@ -1677,11 +1794,24 @@ 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 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; @@ -1694,6 +1824,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..4de60f90e7afa2 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,138 @@ "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": "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, @@ -2934,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, @@ -3034,7 +3154,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3050,7 +3170,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3105,8 +3225,124 @@ "reportableChange": 0 }, { - "name": "EventList", - "code": 65530, + "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": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "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", @@ -3146,7 +3382,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3202,6 +3438,14 @@ "isIncoming": 1, "isEnabled": 1 }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, { "name": "OperationalCommandResponse", "code": 4, @@ -3244,6 +3488,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/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" 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