From 30364ab57c090f2fbeb30955eb7a0c17b79ddec9 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Tue, 30 Apr 2024 20:35:53 -0400 Subject: [PATCH 1/9] Refactor AttributeValue to the appropriate Value* in AttributeValueList --- .../all-clusters-app.matter | 9 +- .../all-clusters-minimal-app.matter | 9 +- .../light-switch-app.matter | 9 +- .../light-switch-app/qpg/zap/switch.matter | 9 +- .../lighting-common/lighting-app.matter | 9 +- .../data_model/lighting-thread-app.matter | 9 +- .../data_model/lighting-wifi-app.matter | 9 +- .../placeholder/linux/apps/app1/config.matter | 9 +- .../placeholder/linux/apps/app2/config.matter | 9 +- .../nxp/zap/thermostat_matter_thread.matter | 9 +- .../nxp/zap/thermostat_matter_wifi.matter | 9 +- .../virtual-device-app.matter | 9 +- .../color-control-server.cpp | 93 +++++++++---- .../clusters/level-control/level-control.cpp | 12 +- .../clusters/on-off-server/on-off-server.cpp | 8 +- .../suites/certification/Test_TC_S_2_2.yaml | 8 +- .../suites/certification/Test_TC_S_2_3.yaml | 24 ++-- .../zcl/data-model/chip/scene.xml | 25 +++- .../data_model/controller-clusters.matter | 9 +- .../chip/devicecontroller/ChipStructs.java | 127 ++++++++++++++++-- ...enesManagementClusterAttributeValuePair.kt | 125 ++++++++++++++++- ...enesManagementClusterAttributeValuePair.kt | 125 ++++++++++++++++- .../python/chip/clusters/Objects.py | 18 ++- .../zap-generated/MTRCommandPayloadsObjc.mm | 74 +++++++++- .../CHIP/zap-generated/MTRStructsObjc.h | 9 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 27 +++- .../zap-generated/cluster-objects.cpp | 41 +++++- .../zap-generated/cluster-objects.h | 20 ++- .../cluster/ComplexArgumentParser.cpp | 69 +++++++++- .../cluster/logging/DataModelLogger.cpp | 60 ++++++++- .../zap-generated/cluster/Commands.h | 41 +++++- 31 files changed, 911 insertions(+), 112 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index fb634514fc9802..10d07dd126f683 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3515,7 +3515,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 19eb0d0b954746..cb0af97c5694eb 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -2427,7 +2427,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index dbc415a9f76771..9796791c744f09 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -2045,7 +2045,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 1965ae66663150..580786895c6ca6 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -1842,7 +1842,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index bf90ec6343f364..24cb4de083e7be 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1855,7 +1855,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 064f69b601374c..e3b8b4a20a6dd0 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1559,7 +1559,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 3f04c35e57d154..5b517a570516c4 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1850,7 +1850,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index f8663f2cf3da08..8838fcccff9a3f 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -3022,7 +3022,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 22ba33760fc585..465c590da7c107 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -2979,7 +2979,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 1ea6115cc9e85f..735d8ea195fd1e 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1755,7 +1755,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index e0c7ca67a73518..33e99d403d016f 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1666,7 +1666,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index b6b1aac3565ed0..40aee55b8befe1 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -1902,7 +1902,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 558703a8f12fce..c7179d5a26ad94 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -112,21 +112,21 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl { xValue = 0x616B; // Default X value according to spec } - AddAttributeValuePair(pairs, Attributes::CurrentX::Id, xValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::CurrentX::Id, xValue, attributeCount); uint16_t yValue; if (Status::Success != Attributes::CurrentY::Get(endpoint, &yValue)) { yValue = 0x607D; // Default Y value according to spec } - AddAttributeValuePair(pairs, Attributes::CurrentY::Id, yValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::CurrentY::Id, yValue, attributeCount); } if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kEnhancedHue)) { uint16_t hueValue = 0x0000; Attributes::EnhancedCurrentHue::Get(endpoint, &hueValue); - AddAttributeValuePair(pairs, Attributes::EnhancedCurrentHue::Id, hueValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::EnhancedCurrentHue::Id, hueValue, attributeCount); } if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kHueAndSaturation)) @@ -136,7 +136,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl { saturationValue = 0x00; } - AddAttributeValuePair(pairs, Attributes::CurrentSaturation::Id, saturationValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::CurrentSaturation::Id, saturationValue, attributeCount); } if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorLoop)) @@ -146,21 +146,21 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl { loopActiveValue = 0x00; } - AddAttributeValuePair(pairs, Attributes::ColorLoopActive::Id, loopActiveValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::ColorLoopActive::Id, loopActiveValue, attributeCount); uint8_t loopDirectionValue; if (Status::Success != Attributes::ColorLoopDirection::Get(endpoint, &loopDirectionValue)) { loopDirectionValue = 0x00; } - AddAttributeValuePair(pairs, Attributes::ColorLoopDirection::Id, loopDirectionValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::ColorLoopDirection::Id, loopDirectionValue, attributeCount); uint16_t loopTimeValue; if (Status::Success != Attributes::ColorLoopTime::Get(endpoint, &loopTimeValue)) { loopTimeValue = 0x0019; // Default loop time value according to spec } - AddAttributeValuePair(pairs, Attributes::ColorLoopTime::Id, loopTimeValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::ColorLoopTime::Id, loopTimeValue, attributeCount); } if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorTemperature)) @@ -170,7 +170,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl { temperatureValue = 0x00FA; // Default temperature value according to spec } - AddAttributeValuePair(pairs, Attributes::ColorTemperatureMireds::Id, temperatureValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::ColorTemperatureMireds::Id, temperatureValue, attributeCount); } uint8_t modeValue; @@ -178,7 +178,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl { modeValue = ColorControl::EnhancedColorMode::kCurrentXAndCurrentY; // Default mode value according to spec } - AddAttributeValuePair(pairs, Attributes::EnhancedColorMode::Id, modeValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::EnhancedColorMode::Id, modeValue, attributeCount); app::DataModel::List attributeValueList(pairs, attributeCount); @@ -237,52 +237,76 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl case Attributes::CurrentX::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY)) { - if (decodePair.attributeValue) + if (decodePair.valueUnsigned16.HasValue()) colorXTransitionState->finalValue = - std::min(static_cast(decodePair.attributeValue), colorXTransitionState->highLimit); + std::min(decodePair.valueUnsigned16.Value(), colorXTransitionState->highLimit); } break; case Attributes::CurrentY::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY)) { - colorYTransitionState->finalValue = - std::min(static_cast(decodePair.attributeValue), colorYTransitionState->highLimit); + if (decodePair.valueUnsigned16.HasValue()) + { + colorYTransitionState->finalValue = + std::min(decodePair.valueUnsigned16.Value(), colorYTransitionState->highLimit); + } } break; case Attributes::EnhancedCurrentHue::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) { - colorHueTransitionState->finalEnhancedHue = static_cast(decodePair.attributeValue); + if (decodePair.valueUnsigned16.HasValue()) + { + colorHueTransitionState->finalEnhancedHue = decodePair.valueUnsigned16.Value(); + } } break; case Attributes::CurrentSaturation::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation)) { - colorSaturationTransitionState->finalValue = - std::min(static_cast(decodePair.attributeValue), colorSaturationTransitionState->highLimit); + if (decodePair.valueUnsigned16.HasValue()) + { + colorSaturationTransitionState->finalValue = + std::min(decodePair.valueUnsigned16.Value(), colorSaturationTransitionState->highLimit); + } } break; case Attributes::ColorLoopActive::Id: - loopActiveValue = static_cast(decodePair.attributeValue); + if (decodePair.valueUnsigned8.HasValue()) + { + loopActiveValue = decodePair.valueUnsigned8.Value(); + } break; case Attributes::ColorLoopDirection::Id: - loopDirectionValue = static_cast(decodePair.attributeValue); + if (decodePair.valueUnsigned8.HasValue()) + { + loopDirectionValue = decodePair.valueUnsigned8.Value(); + } break; case Attributes::ColorLoopTime::Id: - loopTimeValue = static_cast(decodePair.attributeValue); + if (decodePair.valueUnsigned16.HasValue()) + { + loopTimeValue = decodePair.valueUnsigned16.Value(); + } break; case Attributes::ColorTemperatureMireds::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kColorTemperature)) { - colorTempTransitionState->finalValue = - std::min(static_cast(decodePair.attributeValue), colorTempTransitionState->highLimit); + if (decodePair.valueUnsigned16.HasValue()) + { + colorTempTransitionState->finalValue = + std::min(decodePair.valueUnsigned16.Value(), colorTempTransitionState->highLimit); + } } break; case Attributes::EnhancedColorMode::Id: - if (decodePair.attributeValue <= - static_cast(ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) + if (decodePair.valueUnsigned8.HasValue()) { - targetColorMode = static_cast(decodePair.attributeValue); + if (decodePair.valueUnsigned8.Value() <= + static_cast(ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) + { + targetColorMode = decodePair.valueUnsigned8.Value(); + } } break; default: @@ -371,11 +395,26 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl } } - void AddAttributeValuePair(ScenesManagement::Structs::AttributeValuePair::Type * pairs, AttributeId id, uint32_t value, + /// AddAttributeValuePair + /// @brief Helper function to add an attribute value pair to the attribute value pair array in the color control SceneHandler + /// @param pairs list of attribute value pairs + /// @param id attribute id + /// @param value attribute value + /// @param attributeCount number of attributes in the list, incremented by this function, used to keep track of how many + /// attributes from the array are being used for the list to encode + template + void AddAttributeValuePair(ScenesManagement::Structs::AttributeValuePair::Type * pairs, AttributeId id, Type value, size_t & attributeCount) { - pairs[attributeCount].attributeID = id; - pairs[attributeCount].attributeValue = value; + pairs[attributeCount].attributeID = id; + if constexpr (sizeof(Type) == sizeof(uint8_t)) + { + pairs[attributeCount].valueUnsigned8.SetValue(value); + } + else if constexpr (sizeof(Type) == sizeof(uint16_t)) + { + pairs[attributeCount].valueUnsigned16.SetValue(value); + } attributeCount++; } }; diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 2ee9f2cfa54c04..93e2aa7bce57bd 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -173,19 +173,21 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl pairs[0].attributeID = Attributes::CurrentLevel::Id; if (!level.IsNull()) { - pairs[0].attributeValue = level.Value(); + pairs[0].valueUnsigned8.SetValue(level.Value()); } else { - chip::app::NumericAttributeTraits::SetNull(pairs[0].attributeValue); + uint8_t nullValue = 0; + chip::app::NumericAttributeTraits::SetNull(nullValue); + pairs[0].valueUnsigned8.SetValue(nullValue); } size_t attributeCount = 1; if (LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency)) { uint16_t frequency; VerifyOrReturnError(Status::Success == Attributes::CurrentFrequency::Get(endpoint, &frequency), CHIP_ERROR_READ_FAILED); - pairs[attributeCount].attributeID = Attributes::CurrentFrequency::Id; - pairs[attributeCount].attributeValue = frequency; + pairs[attributeCount].attributeID = Attributes::CurrentFrequency::Id; + pairs[attributeCount].valueUnsigned16.SetValue(frequency); attributeCount++; } @@ -225,7 +227,7 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl switch (decodePair.attributeID) { case Attributes::CurrentLevel::Id: - level = static_cast(decodePair.attributeValue); + level = decodePair.valueUnsigned8.Value(); break; case Attributes::CurrentFrequency::Id: // TODO : Uncomment when frequency is supported by the level control cluster diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index c7e64cd7afc161..2da76eba63c8ee 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -163,8 +163,8 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl AttributeValuePair pairs[scenableAttributeCount]; - pairs[0].attributeID = Attributes::OnOff::Id; - pairs[0].attributeValue = currentValue; + pairs[0].attributeID = Attributes::OnOff::Id; + pairs[0].valueUnsigned8.SetValue(currentValue); app::DataModel::List attributeValueList(pairs); @@ -195,8 +195,8 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl { auto & decodePair = pair_iterator.GetValue(); VerifyOrReturnError(decodePair.attributeID == Attributes::OnOff::Id, CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorOnFailure( - mSceneEndpointStatePairs.InsertPair(OnOffEndPointPair(endpoint, static_cast(decodePair.attributeValue)))); + ReturnErrorOnFailure(mSceneEndpointStatePairs.InsertPair( + OnOffEndPointPair(endpoint, static_cast(decodePair.valueUnsigned8.Value())))); } // Verify that the EFS was completely read CHIP_ERROR err = pair_iterator.GetStatus(); diff --git a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml index 02407f8807d993..438a0b770e1b00 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml @@ -463,7 +463,7 @@ tests: [ { AttributeID: 0x0000, - AttributeValue: 0x01, + ValueUnsigned8: 0x01, }, ], }, @@ -473,7 +473,7 @@ tests: [ { AttributeID: 0x0000, - AttributeValue: 0x64, + ValueUnsigned8: 0x64, }, ], }, @@ -620,12 +620,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], }, ] response: diff --git a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml index b39a2e762a1113..6995dc5ebcaff8 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml @@ -287,12 +287,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], }, ] response: @@ -361,12 +361,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], }, ] @@ -395,8 +395,8 @@ tests: [1708071897.294574][7731:7733] CHIP:TOO: ClusterID: 6 [1708071897.294580][7731:7733] CHIP:TOO: AttributeValueList: 1 entries [1708071897.294589][7731:7733] CHIP:TOO: [1]: { - [1708071897.294593][7731:7733] CHIP:TOO: AttributeID: 1 - [1708071897.294596][7731:7733] CHIP:TOO: AttributeValue: 1 + [1708071897.294593][7731:7733] CHIP:TOO: AttributeID: 0 + [1708071897.294596][7731:7733] CHIP:TOO: ValueUnsigned8: 1 [1708071897.294599][7731:7733] CHIP:TOO: } [1708071897.294603][7731:7733] CHIP:TOO: } [1708071897.294611][7731:7733] CHIP:TOO: [2]: { @@ -404,7 +404,7 @@ tests: [1708071897.294621][7731:7733] CHIP:TOO: AttributeValueList: 1 entries [1708071897.294628][7731:7733] CHIP:TOO: [1]: { [1708071897.294633][7731:7733] CHIP:TOO: AttributeID: 0 - [1708071897.294636][7731:7733] CHIP:TOO: AttributeValue: 100 + [1708071897.294636][7731:7733] CHIP:TOO: ValueUnsigned8: 100 [1708071897.294639][7731:7733] CHIP:TOO: } [1708071897.294643][7731:7733] CHIP:TOO: } [1708071897.294647][7731:7733] CHIP:TOO: } @@ -543,12 +543,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], }, ] @@ -599,12 +599,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], }, ] - label: @@ -633,7 +633,7 @@ tests: [1707285444.028853][13682:13684] CHIP:TOO: AttributeValueList: 1 entries [1707285444.028882][13682:13684] CHIP:TOO: [1]: { [1707285444.028896][13682:13684] CHIP:TOO: AttributeID: 16386 - [1707285444.028913][13682:13684] CHIP:TOO: AttributeValue: 1 + [1707285444.028913][13682:13684] CHIP:TOO: ValueUnsigned16: 1 [1707285444.028925][13682:13684] CHIP:TOO: } [1707285444.028937][13682:13684] CHIP:TOO: } [1707285444.028950][13682:13684] CHIP:TOO: } diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index 0c1189093c4e79..fae71390eee724 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -32,7 +32,30 @@ limitations under the License. - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 961ac180ef36a3..8878336fded5b4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3758,7 +3758,14 @@ provisional cluster ScenesManagement = 98 { struct AttributeValuePair { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 35a08b3e35268d..61f9c1b60661cd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -5080,22 +5080,57 @@ public String toString() { } public static class ScenesManagementClusterAttributeValuePair { public Long attributeID; - public Long attributeValue; + public Optional valueUnsigned8; + public Optional valueSigned8; + public Optional valueUnsigned16; + public Optional valueSigned16; + public Optional valueUnsigned32; + public Optional valueSigned32; + public Optional valueUnsigned64; + public Optional valueSigned64; private static final long ATTRIBUTE_I_D_ID = 0L; - private static final long ATTRIBUTE_VALUE_ID = 1L; + private static final long VALUE_UNSIGNED8_ID = 1L; + private static final long VALUE_SIGNED8_ID = 2L; + private static final long VALUE_UNSIGNED16_ID = 3L; + private static final long VALUE_SIGNED16_ID = 4L; + private static final long VALUE_UNSIGNED32_ID = 5L; + private static final long VALUE_SIGNED32_ID = 6L; + private static final long VALUE_UNSIGNED64_ID = 7L; + private static final long VALUE_SIGNED64_ID = 8L; public ScenesManagementClusterAttributeValuePair( Long attributeID, - Long attributeValue + Optional valueUnsigned8, + Optional valueSigned8, + Optional valueUnsigned16, + Optional valueSigned16, + Optional valueUnsigned32, + Optional valueSigned32, + Optional valueUnsigned64, + Optional valueSigned64 ) { this.attributeID = attributeID; - this.attributeValue = attributeValue; + this.valueUnsigned8 = valueUnsigned8; + this.valueSigned8 = valueSigned8; + this.valueUnsigned16 = valueUnsigned16; + this.valueSigned16 = valueSigned16; + this.valueUnsigned32 = valueUnsigned32; + this.valueSigned32 = valueSigned32; + this.valueUnsigned64 = valueUnsigned64; + this.valueSigned64 = valueSigned64; } public StructType encodeTlv() { ArrayList values = new ArrayList<>(); values.add(new StructElement(ATTRIBUTE_I_D_ID, new UIntType(attributeID))); - values.add(new StructElement(ATTRIBUTE_VALUE_ID, new UIntType(attributeValue))); + values.add(new StructElement(VALUE_UNSIGNED8_ID, valueUnsigned8.map((nonOptionalvalueUnsigned8) -> new UIntType(nonOptionalvalueUnsigned8)).orElse(new EmptyType()))); + values.add(new StructElement(VALUE_SIGNED8_ID, valueSigned8.map((nonOptionalvalueSigned8) -> new IntType(nonOptionalvalueSigned8)).orElse(new EmptyType()))); + values.add(new StructElement(VALUE_UNSIGNED16_ID, valueUnsigned16.map((nonOptionalvalueUnsigned16) -> new UIntType(nonOptionalvalueUnsigned16)).orElse(new EmptyType()))); + values.add(new StructElement(VALUE_SIGNED16_ID, valueSigned16.map((nonOptionalvalueSigned16) -> new IntType(nonOptionalvalueSigned16)).orElse(new EmptyType()))); + values.add(new StructElement(VALUE_UNSIGNED32_ID, valueUnsigned32.map((nonOptionalvalueUnsigned32) -> new UIntType(nonOptionalvalueUnsigned32)).orElse(new EmptyType()))); + values.add(new StructElement(VALUE_SIGNED32_ID, valueSigned32.map((nonOptionalvalueSigned32) -> new IntType(nonOptionalvalueSigned32)).orElse(new EmptyType()))); + values.add(new StructElement(VALUE_UNSIGNED64_ID, valueUnsigned64.map((nonOptionalvalueUnsigned64) -> new UIntType(nonOptionalvalueUnsigned64)).orElse(new EmptyType()))); + values.add(new StructElement(VALUE_SIGNED64_ID, valueSigned64.map((nonOptionalvalueSigned64) -> new IntType(nonOptionalvalueSigned64)).orElse(new EmptyType()))); return new StructType(values); } @@ -5105,23 +5140,72 @@ public static ScenesManagementClusterAttributeValuePair decodeTlv(BaseTLVType tl return null; } Long attributeID = null; - Long attributeValue = null; + Optional valueUnsigned8 = Optional.empty(); + Optional valueSigned8 = Optional.empty(); + Optional valueUnsigned16 = Optional.empty(); + Optional valueSigned16 = Optional.empty(); + Optional valueUnsigned32 = Optional.empty(); + Optional valueSigned32 = Optional.empty(); + Optional valueUnsigned64 = Optional.empty(); + Optional valueSigned64 = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == ATTRIBUTE_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); attributeID = castingValue.value(Long.class); } - } else if (element.contextTagNum() == ATTRIBUTE_VALUE_ID) { + } else if (element.contextTagNum() == VALUE_UNSIGNED8_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - attributeValue = castingValue.value(Long.class); + valueUnsigned8 = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == VALUE_SIGNED8_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + valueSigned8 = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == VALUE_UNSIGNED16_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + valueUnsigned16 = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == VALUE_SIGNED16_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + valueSigned16 = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == VALUE_UNSIGNED32_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + valueUnsigned32 = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == VALUE_SIGNED32_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + valueSigned32 = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == VALUE_UNSIGNED64_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + valueUnsigned64 = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == VALUE_SIGNED64_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + valueSigned64 = Optional.of(castingValue.value(Long.class)); } } } return new ScenesManagementClusterAttributeValuePair( attributeID, - attributeValue + valueUnsigned8, + valueSigned8, + valueUnsigned16, + valueSigned16, + valueUnsigned32, + valueSigned32, + valueUnsigned64, + valueSigned64 ); } @@ -5132,8 +5216,29 @@ public String toString() { output.append("\tattributeID: "); output.append(attributeID); output.append("\n"); - output.append("\tattributeValue: "); - output.append(attributeValue); + output.append("\tvalueUnsigned8: "); + output.append(valueUnsigned8); + output.append("\n"); + output.append("\tvalueSigned8: "); + output.append(valueSigned8); + output.append("\n"); + output.append("\tvalueUnsigned16: "); + output.append(valueUnsigned16); + output.append("\n"); + output.append("\tvalueSigned16: "); + output.append(valueSigned16); + output.append("\n"); + output.append("\tvalueUnsigned32: "); + output.append(valueUnsigned32); + output.append("\n"); + output.append("\tvalueSigned32: "); + output.append(valueSigned32); + output.append("\n"); + output.append("\tvalueUnsigned64: "); + output.append(valueUnsigned64); + output.append("\n"); + output.append("\tvalueSigned64: "); + output.append(valueSigned64); output.append("\n"); output.append("}\n"); return output.toString(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt index 3cf9c98d53e6d1..df06fcafa68ecd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt @@ -17,16 +17,34 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class ScenesManagementClusterAttributeValuePair(val attributeID: ULong, val attributeValue: ULong) { +class ScenesManagementClusterAttributeValuePair( + val attributeID: ULong, + val valueUnsigned8: Optional, + val valueSigned8: Optional, + val valueUnsigned16: Optional, + val valueSigned16: Optional, + val valueUnsigned32: Optional, + val valueSigned32: Optional, + val valueUnsigned64: Optional, + val valueSigned64: Optional +) { override fun toString(): String = buildString { append("ScenesManagementClusterAttributeValuePair {\n") append("\tattributeID : $attributeID\n") - append("\tattributeValue : $attributeValue\n") + append("\tvalueUnsigned8 : $valueUnsigned8\n") + append("\tvalueSigned8 : $valueSigned8\n") + append("\tvalueUnsigned16 : $valueUnsigned16\n") + append("\tvalueSigned16 : $valueSigned16\n") + append("\tvalueUnsigned32 : $valueUnsigned32\n") + append("\tvalueSigned32 : $valueSigned32\n") + append("\tvalueUnsigned64 : $valueUnsigned64\n") + append("\tvalueSigned64 : $valueSigned64\n") append("}\n") } @@ -34,23 +52,118 @@ class ScenesManagementClusterAttributeValuePair(val attributeID: ULong, val attr tlvWriter.apply { startStructure(tlvTag) put(ContextSpecificTag(TAG_ATTRIBUTE_I_D), attributeID) - put(ContextSpecificTag(TAG_ATTRIBUTE_VALUE), attributeValue) + if (valueUnsigned8.isPresent) { + val optvalueUnsigned8 = valueUnsigned8.get() + put(ContextSpecificTag(TAG_VALUE_UNSIGNED8), optvalueUnsigned8) + } + if (valueSigned8.isPresent) { + val optvalueSigned8 = valueSigned8.get() + put(ContextSpecificTag(TAG_VALUE_SIGNED8), optvalueSigned8) + } + if (valueUnsigned16.isPresent) { + val optvalueUnsigned16 = valueUnsigned16.get() + put(ContextSpecificTag(TAG_VALUE_UNSIGNED16), optvalueUnsigned16) + } + if (valueSigned16.isPresent) { + val optvalueSigned16 = valueSigned16.get() + put(ContextSpecificTag(TAG_VALUE_SIGNED16), optvalueSigned16) + } + if (valueUnsigned32.isPresent) { + val optvalueUnsigned32 = valueUnsigned32.get() + put(ContextSpecificTag(TAG_VALUE_UNSIGNED32), optvalueUnsigned32) + } + if (valueSigned32.isPresent) { + val optvalueSigned32 = valueSigned32.get() + put(ContextSpecificTag(TAG_VALUE_SIGNED32), optvalueSigned32) + } + if (valueUnsigned64.isPresent) { + val optvalueUnsigned64 = valueUnsigned64.get() + put(ContextSpecificTag(TAG_VALUE_UNSIGNED64), optvalueUnsigned64) + } + if (valueSigned64.isPresent) { + val optvalueSigned64 = valueSigned64.get() + put(ContextSpecificTag(TAG_VALUE_SIGNED64), optvalueSigned64) + } endStructure() } } companion object { private const val TAG_ATTRIBUTE_I_D = 0 - private const val TAG_ATTRIBUTE_VALUE = 1 + private const val TAG_VALUE_UNSIGNED8 = 1 + private const val TAG_VALUE_SIGNED8 = 2 + private const val TAG_VALUE_UNSIGNED16 = 3 + private const val TAG_VALUE_SIGNED16 = 4 + private const val TAG_VALUE_UNSIGNED32 = 5 + private const val TAG_VALUE_SIGNED32 = 6 + private const val TAG_VALUE_UNSIGNED64 = 7 + private const val TAG_VALUE_SIGNED64 = 8 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ScenesManagementClusterAttributeValuePair { tlvReader.enterStructure(tlvTag) val attributeID = tlvReader.getULong(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) - val attributeValue = tlvReader.getULong(ContextSpecificTag(TAG_ATTRIBUTE_VALUE)) + val valueUnsigned8 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_UNSIGNED8))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_VALUE_UNSIGNED8))) + } else { + Optional.empty() + } + val valueSigned8 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_SIGNED8))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_VALUE_SIGNED8))) + } else { + Optional.empty() + } + val valueUnsigned16 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_UNSIGNED16))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_VALUE_UNSIGNED16))) + } else { + Optional.empty() + } + val valueSigned16 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_SIGNED16))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_VALUE_SIGNED16))) + } else { + Optional.empty() + } + val valueUnsigned32 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_UNSIGNED32))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_VALUE_UNSIGNED32))) + } else { + Optional.empty() + } + val valueSigned32 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_SIGNED32))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_VALUE_SIGNED32))) + } else { + Optional.empty() + } + val valueUnsigned64 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_UNSIGNED64))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_VALUE_UNSIGNED64))) + } else { + Optional.empty() + } + val valueSigned64 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_SIGNED64))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_VALUE_SIGNED64))) + } else { + Optional.empty() + } tlvReader.exitContainer() - return ScenesManagementClusterAttributeValuePair(attributeID, attributeValue) + return ScenesManagementClusterAttributeValuePair( + attributeID, + valueUnsigned8, + valueSigned8, + valueUnsigned16, + valueSigned16, + valueUnsigned32, + valueSigned32, + valueUnsigned64, + valueSigned64 + ) } } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt index 1a14970ba2bd58..5e841e5a08c86e 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt @@ -16,17 +16,35 @@ */ package matter.controller.cluster.structs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class ScenesManagementClusterAttributeValuePair(val attributeID: UInt, val attributeValue: UInt) { +class ScenesManagementClusterAttributeValuePair( + val attributeID: UInt, + val valueUnsigned8: Optional, + val valueSigned8: Optional, + val valueUnsigned16: Optional, + val valueSigned16: Optional, + val valueUnsigned32: Optional, + val valueSigned32: Optional, + val valueUnsigned64: Optional, + val valueSigned64: Optional +) { override fun toString(): String = buildString { append("ScenesManagementClusterAttributeValuePair {\n") append("\tattributeID : $attributeID\n") - append("\tattributeValue : $attributeValue\n") + append("\tvalueUnsigned8 : $valueUnsigned8\n") + append("\tvalueSigned8 : $valueSigned8\n") + append("\tvalueUnsigned16 : $valueUnsigned16\n") + append("\tvalueSigned16 : $valueSigned16\n") + append("\tvalueUnsigned32 : $valueUnsigned32\n") + append("\tvalueSigned32 : $valueSigned32\n") + append("\tvalueUnsigned64 : $valueUnsigned64\n") + append("\tvalueSigned64 : $valueSigned64\n") append("}\n") } @@ -34,23 +52,118 @@ class ScenesManagementClusterAttributeValuePair(val attributeID: UInt, val attri tlvWriter.apply { startStructure(tlvTag) put(ContextSpecificTag(TAG_ATTRIBUTE_I_D), attributeID) - put(ContextSpecificTag(TAG_ATTRIBUTE_VALUE), attributeValue) + if (valueUnsigned8.isPresent) { + val optvalueUnsigned8 = valueUnsigned8.get() + put(ContextSpecificTag(TAG_VALUE_UNSIGNED8), optvalueUnsigned8) + } + if (valueSigned8.isPresent) { + val optvalueSigned8 = valueSigned8.get() + put(ContextSpecificTag(TAG_VALUE_SIGNED8), optvalueSigned8) + } + if (valueUnsigned16.isPresent) { + val optvalueUnsigned16 = valueUnsigned16.get() + put(ContextSpecificTag(TAG_VALUE_UNSIGNED16), optvalueUnsigned16) + } + if (valueSigned16.isPresent) { + val optvalueSigned16 = valueSigned16.get() + put(ContextSpecificTag(TAG_VALUE_SIGNED16), optvalueSigned16) + } + if (valueUnsigned32.isPresent) { + val optvalueUnsigned32 = valueUnsigned32.get() + put(ContextSpecificTag(TAG_VALUE_UNSIGNED32), optvalueUnsigned32) + } + if (valueSigned32.isPresent) { + val optvalueSigned32 = valueSigned32.get() + put(ContextSpecificTag(TAG_VALUE_SIGNED32), optvalueSigned32) + } + if (valueUnsigned64.isPresent) { + val optvalueUnsigned64 = valueUnsigned64.get() + put(ContextSpecificTag(TAG_VALUE_UNSIGNED64), optvalueUnsigned64) + } + if (valueSigned64.isPresent) { + val optvalueSigned64 = valueSigned64.get() + put(ContextSpecificTag(TAG_VALUE_SIGNED64), optvalueSigned64) + } endStructure() } } companion object { private const val TAG_ATTRIBUTE_I_D = 0 - private const val TAG_ATTRIBUTE_VALUE = 1 + private const val TAG_VALUE_UNSIGNED8 = 1 + private const val TAG_VALUE_SIGNED8 = 2 + private const val TAG_VALUE_UNSIGNED16 = 3 + private const val TAG_VALUE_SIGNED16 = 4 + private const val TAG_VALUE_UNSIGNED32 = 5 + private const val TAG_VALUE_SIGNED32 = 6 + private const val TAG_VALUE_UNSIGNED64 = 7 + private const val TAG_VALUE_SIGNED64 = 8 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ScenesManagementClusterAttributeValuePair { tlvReader.enterStructure(tlvTag) val attributeID = tlvReader.getUInt(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) - val attributeValue = tlvReader.getUInt(ContextSpecificTag(TAG_ATTRIBUTE_VALUE)) + val valueUnsigned8 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_UNSIGNED8))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_VALUE_UNSIGNED8))) + } else { + Optional.empty() + } + val valueSigned8 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_SIGNED8))) { + Optional.of(tlvReader.getByte(ContextSpecificTag(TAG_VALUE_SIGNED8))) + } else { + Optional.empty() + } + val valueUnsigned16 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_UNSIGNED16))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_VALUE_UNSIGNED16))) + } else { + Optional.empty() + } + val valueSigned16 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_SIGNED16))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_VALUE_SIGNED16))) + } else { + Optional.empty() + } + val valueUnsigned32 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_UNSIGNED32))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_VALUE_UNSIGNED32))) + } else { + Optional.empty() + } + val valueSigned32 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_SIGNED32))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_VALUE_SIGNED32))) + } else { + Optional.empty() + } + val valueUnsigned64 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_UNSIGNED64))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_VALUE_UNSIGNED64))) + } else { + Optional.empty() + } + val valueSigned64 = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VALUE_SIGNED64))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_VALUE_SIGNED64))) + } else { + Optional.empty() + } tlvReader.exitContainer() - return ScenesManagementClusterAttributeValuePair(attributeID, attributeValue) + return ScenesManagementClusterAttributeValuePair( + attributeID, + valueUnsigned8, + valueSigned8, + valueUnsigned16, + valueSigned16, + valueUnsigned32, + valueSigned32, + valueUnsigned64, + valueSigned64 + ) } } } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index de7708f8bcb318..31c425a17bfa7c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -20340,11 +20340,25 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="attributeID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="attributeValue", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="valueUnsigned8", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="valueSigned8", Tag=2, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="valueUnsigned16", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="valueSigned16", Tag=4, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="valueUnsigned32", Tag=5, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="valueSigned32", Tag=6, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="valueUnsigned64", Tag=7, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="valueSigned64", Tag=8, Type=typing.Optional[int]), ]) attributeID: 'uint' = 0 - attributeValue: 'uint' = 0 + valueUnsigned8: 'typing.Optional[uint]' = None + valueSigned8: 'typing.Optional[int]' = None + valueUnsigned16: 'typing.Optional[uint]' = None + valueSigned16: 'typing.Optional[int]' = None + valueUnsigned32: 'typing.Optional[uint]' = None + valueSigned32: 'typing.Optional[int]' = None + valueUnsigned64: 'typing.Optional[uint]' = None + valueSigned64: 'typing.Optional[int]' = None @dataclass class ExtensionFieldSet(ClusterObject): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 01a7844ada5f32..f4d3af4e05bf0e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -13074,7 +13074,38 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } auto element_2 = (MTRScenesManagementClusterAttributeValuePair *) element_0.attributeValueList[i_2]; listHolder_2->mList[i_2].attributeID = element_2.attributeID.unsignedIntValue; - listHolder_2->mList[i_2].attributeValue = element_2.attributeValue.unsignedIntValue; + if (element_2.valueUnsigned8 != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].valueUnsigned8.Emplace(); + definedValue_4 = element_2.valueUnsigned8.unsignedCharValue; + } + if (element_2.valueSigned8 != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].valueSigned8.Emplace(); + definedValue_4 = element_2.valueSigned8.charValue; + } + if (element_2.valueUnsigned16 != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].valueUnsigned16.Emplace(); + definedValue_4 = element_2.valueUnsigned16.unsignedShortValue; + } + if (element_2.valueSigned16 != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].valueSigned16.Emplace(); + definedValue_4 = element_2.valueSigned16.shortValue; + } + if (element_2.valueUnsigned32 != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].valueUnsigned32.Emplace(); + definedValue_4 = element_2.valueUnsigned32.unsignedIntValue; + } + if (element_2.valueSigned32 != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].valueSigned32.Emplace(); + definedValue_4 = element_2.valueSigned32.intValue; + } + if (element_2.valueUnsigned64 != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].valueUnsigned64.Emplace(); + definedValue_4 = element_2.valueUnsigned64.unsignedLongLongValue; + } + if (element_2.valueSigned64 != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].valueSigned64.Emplace(); + definedValue_4 = element_2.valueSigned64.longLongValue; + } } listHolder_0->mList[i_0].attributeValueList = ListType_2(listHolder_2->mList, element_0.attributeValueList.count); } else { @@ -13434,7 +13465,46 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ScenesMa MTRScenesManagementClusterAttributeValuePair * newElement_3; newElement_3 = [MTRScenesManagementClusterAttributeValuePair new]; newElement_3.attributeID = [NSNumber numberWithUnsignedInt:entry_3.attributeID]; - newElement_3.attributeValue = [NSNumber numberWithUnsignedInt:entry_3.attributeValue]; + if (entry_3.valueUnsigned8.HasValue()) { + newElement_3.valueUnsigned8 = [NSNumber numberWithUnsignedChar:entry_3.valueUnsigned8.Value()]; + } else { + newElement_3.valueUnsigned8 = nil; + } + if (entry_3.valueSigned8.HasValue()) { + newElement_3.valueSigned8 = [NSNumber numberWithChar:entry_3.valueSigned8.Value()]; + } else { + newElement_3.valueSigned8 = nil; + } + if (entry_3.valueUnsigned16.HasValue()) { + newElement_3.valueUnsigned16 = [NSNumber numberWithUnsignedShort:entry_3.valueUnsigned16.Value()]; + } else { + newElement_3.valueUnsigned16 = nil; + } + if (entry_3.valueSigned16.HasValue()) { + newElement_3.valueSigned16 = [NSNumber numberWithShort:entry_3.valueSigned16.Value()]; + } else { + newElement_3.valueSigned16 = nil; + } + if (entry_3.valueUnsigned32.HasValue()) { + newElement_3.valueUnsigned32 = [NSNumber numberWithUnsignedInt:entry_3.valueUnsigned32.Value()]; + } else { + newElement_3.valueUnsigned32 = nil; + } + if (entry_3.valueSigned32.HasValue()) { + newElement_3.valueSigned32 = [NSNumber numberWithInt:entry_3.valueSigned32.Value()]; + } else { + newElement_3.valueSigned32 = nil; + } + if (entry_3.valueUnsigned64.HasValue()) { + newElement_3.valueUnsigned64 = [NSNumber numberWithUnsignedLongLong:entry_3.valueUnsigned64.Value()]; + } else { + newElement_3.valueUnsigned64 = nil; + } + if (entry_3.valueSigned64.HasValue()) { + newElement_3.valueSigned64 = [NSNumber numberWithLongLong:entry_3.valueSigned64.Value()]; + } else { + newElement_3.valueSigned64 = nil; + } [array_3 addObject:newElement_3]; } CHIP_ERROR err = iter_3.GetStatus(); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 74a621dd01df9c..4f35a07fe452d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1019,7 +1019,14 @@ MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)) MTR_PROVISIONALLY_AVAILABLE @interface MTRScenesManagementClusterAttributeValuePair : NSObject @property (nonatomic, copy) NSNumber * _Nonnull attributeID MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull attributeValue MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable valueUnsigned8 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable valueSigned8 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable valueUnsigned16 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable valueSigned16 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable valueUnsigned32 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable valueSigned32 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable valueUnsigned64 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable valueSigned64 MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 5dca49be4900cf..af90cbc2c4787f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -4031,7 +4031,21 @@ - (instancetype)init _attributeID = @(0); - _attributeValue = @(0); + _valueUnsigned8 = nil; + + _valueSigned8 = nil; + + _valueUnsigned16 = nil; + + _valueSigned16 = nil; + + _valueUnsigned32 = nil; + + _valueSigned32 = nil; + + _valueUnsigned64 = nil; + + _valueSigned64 = nil; } return self; } @@ -4041,14 +4055,21 @@ - (id)copyWithZone:(NSZone * _Nullable)zone auto other = [[MTRScenesManagementClusterAttributeValuePair alloc] init]; other.attributeID = self.attributeID; - other.attributeValue = self.attributeValue; + other.valueUnsigned8 = self.valueUnsigned8; + other.valueSigned8 = self.valueSigned8; + other.valueUnsigned16 = self.valueUnsigned16; + other.valueSigned16 = self.valueSigned16; + other.valueUnsigned32 = self.valueUnsigned32; + other.valueSigned32 = self.valueSigned32; + other.valueUnsigned64 = self.valueUnsigned64; + other.valueSigned64 = self.valueSigned64; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: attributeID:%@; attributeValue:%@; >", NSStringFromClass([self class]), _attributeID, _attributeValue]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: attributeID:%@; valueUnsigned8:%@; valueSigned8:%@; valueUnsigned16:%@; valueSigned16:%@; valueUnsigned32:%@; valueSigned32:%@; valueUnsigned64:%@; valueSigned64:%@; >", NSStringFromClass([self class]), _attributeID, _valueUnsigned8, _valueSigned8, _valueUnsigned16, _valueSigned16, _valueUnsigned32, _valueSigned32, _valueUnsigned64, _valueSigned64]; return descriptionString; } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 42a36d6da15918..6d48cd603e1f6e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -12599,7 +12599,14 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; encoder.Encode(to_underlying(Fields::kAttributeID), attributeID); - encoder.Encode(to_underlying(Fields::kAttributeValue), attributeValue); + encoder.Encode(to_underlying(Fields::kValueUnsigned8), valueUnsigned8); + encoder.Encode(to_underlying(Fields::kValueSigned8), valueSigned8); + encoder.Encode(to_underlying(Fields::kValueUnsigned16), valueUnsigned16); + encoder.Encode(to_underlying(Fields::kValueSigned16), valueSigned16); + encoder.Encode(to_underlying(Fields::kValueUnsigned32), valueUnsigned32); + encoder.Encode(to_underlying(Fields::kValueSigned32), valueSigned32); + encoder.Encode(to_underlying(Fields::kValueUnsigned64), valueUnsigned64); + encoder.Encode(to_underlying(Fields::kValueSigned64), valueSigned64); return encoder.Finalize(); } @@ -12621,9 +12628,37 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, attributeID); } - else if (__context_tag == to_underlying(Fields::kAttributeValue)) + else if (__context_tag == to_underlying(Fields::kValueUnsigned8)) { - err = DataModel::Decode(reader, attributeValue); + err = DataModel::Decode(reader, valueUnsigned8); + } + else if (__context_tag == to_underlying(Fields::kValueSigned8)) + { + err = DataModel::Decode(reader, valueSigned8); + } + else if (__context_tag == to_underlying(Fields::kValueUnsigned16)) + { + err = DataModel::Decode(reader, valueUnsigned16); + } + else if (__context_tag == to_underlying(Fields::kValueSigned16)) + { + err = DataModel::Decode(reader, valueSigned16); + } + else if (__context_tag == to_underlying(Fields::kValueUnsigned32)) + { + err = DataModel::Decode(reader, valueUnsigned32); + } + else if (__context_tag == to_underlying(Fields::kValueSigned32)) + { + err = DataModel::Decode(reader, valueSigned32); + } + else if (__context_tag == to_underlying(Fields::kValueUnsigned64)) + { + err = DataModel::Decode(reader, valueUnsigned64); + } + else if (__context_tag == to_underlying(Fields::kValueSigned64)) + { + err = DataModel::Decode(reader, valueSigned64); } else { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index a1fb80c760815c..c963c1d21f7871 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -18177,15 +18177,29 @@ namespace Structs { namespace AttributeValuePair { enum class Fields : uint8_t { - kAttributeID = 0, - kAttributeValue = 1, + kAttributeID = 0, + kValueUnsigned8 = 1, + kValueSigned8 = 2, + kValueUnsigned16 = 3, + kValueSigned16 = 4, + kValueUnsigned32 = 5, + kValueSigned32 = 6, + kValueUnsigned64 = 7, + kValueSigned64 = 8, }; struct Type { public: chip::AttributeId attributeID = static_cast(0); - uint32_t attributeValue = static_cast(0); + Optional valueUnsigned8; + Optional valueSigned8; + Optional valueUnsigned16; + Optional valueSigned16; + Optional valueUnsigned32; + Optional valueSigned32; + Optional valueUnsigned64; + Optional valueSigned64; CHIP_ERROR Decode(TLV::TLVReader & reader); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index c094853ab71712..4b5a5a2c285822 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -2179,17 +2179,67 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure( ComplexArgumentParser::EnsureMemberExist("AttributeValuePair.attributeID", "attributeID", value.isMember("attributeID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AttributeValuePair.attributeValue", "attributeValue", - value.isMember("attributeValue"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "attributeID"); ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.attributeID, value["attributeID"])); valueCopy.removeMember("attributeID"); - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "attributeValue"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.attributeValue, value["attributeValue"])); - valueCopy.removeMember("attributeValue"); + if (value.isMember("valueUnsigned8")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "valueUnsigned8"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.valueUnsigned8, value["valueUnsigned8"])); + } + valueCopy.removeMember("valueUnsigned8"); + + if (value.isMember("valueSigned8")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "valueSigned8"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.valueSigned8, value["valueSigned8"])); + } + valueCopy.removeMember("valueSigned8"); + + if (value.isMember("valueUnsigned16")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "valueUnsigned16"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.valueUnsigned16, value["valueUnsigned16"])); + } + valueCopy.removeMember("valueUnsigned16"); + + if (value.isMember("valueSigned16")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "valueSigned16"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.valueSigned16, value["valueSigned16"])); + } + valueCopy.removeMember("valueSigned16"); + + if (value.isMember("valueUnsigned32")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "valueUnsigned32"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.valueUnsigned32, value["valueUnsigned32"])); + } + valueCopy.removeMember("valueUnsigned32"); + + if (value.isMember("valueSigned32")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "valueSigned32"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.valueSigned32, value["valueSigned32"])); + } + valueCopy.removeMember("valueSigned32"); + + if (value.isMember("valueUnsigned64")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "valueUnsigned64"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.valueUnsigned64, value["valueUnsigned64"])); + } + valueCopy.removeMember("valueUnsigned64"); + + if (value.isMember("valueSigned64")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "valueSigned64"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.valueSigned64, value["valueSigned64"])); + } + valueCopy.removeMember("valueSigned64"); return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -2197,7 +2247,14 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, void ComplexArgumentParser::Finalize(chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type & request) { ComplexArgumentParser::Finalize(request.attributeID); - ComplexArgumentParser::Finalize(request.attributeValue); + ComplexArgumentParser::Finalize(request.valueUnsigned8); + ComplexArgumentParser::Finalize(request.valueSigned8); + ComplexArgumentParser::Finalize(request.valueUnsigned16); + ComplexArgumentParser::Finalize(request.valueSigned16); + ComplexArgumentParser::Finalize(request.valueUnsigned32); + ComplexArgumentParser::Finalize(request.valueSigned32); + ComplexArgumentParser::Finalize(request.valueUnsigned64); + ComplexArgumentParser::Finalize(request.valueSigned64); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index d61ba121300baa..55c040df6a5874 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -1971,10 +1971,66 @@ DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = LogValue("AttributeValue", indent + 1, value.attributeValue); + CHIP_ERROR err = LogValue("ValueUnsigned8", indent + 1, value.valueUnsigned8); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AttributeValue'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ValueUnsigned8'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ValueSigned8", indent + 1, value.valueSigned8); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ValueSigned8'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ValueUnsigned16", indent + 1, value.valueUnsigned16); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ValueUnsigned16'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ValueSigned16", indent + 1, value.valueSigned16); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ValueSigned16'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ValueUnsigned32", indent + 1, value.valueUnsigned32); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ValueUnsigned32'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ValueSigned32", indent + 1, value.valueSigned32); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ValueSigned32'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ValueUnsigned64", indent + 1, value.valueUnsigned64); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ValueUnsigned64'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ValueSigned64", indent + 1, value.valueSigned64); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ValueSigned64'"); return err; } } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index b91d8584fa83be..b7c3eb3d2d017e 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -69440,7 +69440,46 @@ class ScenesManagementAddScene : public ClusterCommand { MTRScenesManagementClusterAttributeValuePair * newElement_2; newElement_2 = [MTRScenesManagementClusterAttributeValuePair new]; newElement_2.attributeID = [NSNumber numberWithUnsignedInt:entry_2.attributeID]; - newElement_2.attributeValue = [NSNumber numberWithUnsignedInt:entry_2.attributeValue]; + if (entry_2.valueUnsigned8.HasValue()) { + newElement_2.valueUnsigned8 = [NSNumber numberWithUnsignedChar:entry_2.valueUnsigned8.Value()]; + } else { + newElement_2.valueUnsigned8 = nil; + } + if (entry_2.valueSigned8.HasValue()) { + newElement_2.valueSigned8 = [NSNumber numberWithChar:entry_2.valueSigned8.Value()]; + } else { + newElement_2.valueSigned8 = nil; + } + if (entry_2.valueUnsigned16.HasValue()) { + newElement_2.valueUnsigned16 = [NSNumber numberWithUnsignedShort:entry_2.valueUnsigned16.Value()]; + } else { + newElement_2.valueUnsigned16 = nil; + } + if (entry_2.valueSigned16.HasValue()) { + newElement_2.valueSigned16 = [NSNumber numberWithShort:entry_2.valueSigned16.Value()]; + } else { + newElement_2.valueSigned16 = nil; + } + if (entry_2.valueUnsigned32.HasValue()) { + newElement_2.valueUnsigned32 = [NSNumber numberWithUnsignedInt:entry_2.valueUnsigned32.Value()]; + } else { + newElement_2.valueUnsigned32 = nil; + } + if (entry_2.valueSigned32.HasValue()) { + newElement_2.valueSigned32 = [NSNumber numberWithInt:entry_2.valueSigned32.Value()]; + } else { + newElement_2.valueSigned32 = nil; + } + if (entry_2.valueUnsigned64.HasValue()) { + newElement_2.valueUnsigned64 = [NSNumber numberWithUnsignedLongLong:entry_2.valueUnsigned64.Value()]; + } else { + newElement_2.valueUnsigned64 = nil; + } + if (entry_2.valueSigned64.HasValue()) { + newElement_2.valueSigned64 = [NSNumber numberWithLongLong:entry_2.valueSigned64.Value()]; + } else { + newElement_2.valueSigned64 = nil; + } [array_2 addObject:newElement_2]; } newElement_0.attributeValueList = array_2; From 1dd67d1763d4668dbc33ad5f868826962b3d4b25 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Thu, 2 May 2024 16:10:00 -0400 Subject: [PATCH 2/9] Updated attribute value in test --- .../clusters/level-control/level-control.cpp | 2 +- src/app/tests/TestSceneTable.cpp | 51 +++++++++---------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 93e2aa7bce57bd..5554188ace5cdd 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -179,7 +179,7 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl { uint8_t nullValue = 0; chip::app::NumericAttributeTraits::SetNull(nullValue); - pairs[0].valueUnsigned8.SetValue(nullValue); +pairs[0].valueUnsigned8.SetValue(NumericAttributeTraits::kNullValue); } size_t attributeCount = 1; if (LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency)) diff --git a/src/app/tests/TestSceneTable.cpp b/src/app/tests/TestSceneTable.cpp index 1563c286ac3e16..d4e2436af9aee0 100644 --- a/src/app/tests/TestSceneTable.cpp +++ b/src/app/tests/TestSceneTable.cpp @@ -535,30 +535,30 @@ TEST_F(TestSceneTable, TestHandlerFunctions) static const uint16_t LC_av_payload[2] = { 0x64, 0x01F0 }; static const uint16_t CC_av_payload[8] = { 0 }; - OOPairs[0].attributeID = kOnOffAttId; - OOPairs[0].attributeValue = OO_av_payload; - - LCPairs[0].attributeID = kCurrentLevelId; - LCPairs[0].attributeValue = LC_av_payload[0]; - LCPairs[1].attributeID = kCurrentFrequencyId; - LCPairs[1].attributeValue = LC_av_payload[1]; - - CCPairs[0].attributeID = kCurrentSaturationId; - CCPairs[0].attributeValue = CC_av_payload[0]; - CCPairs[1].attributeID = kCurrentXId; - CCPairs[1].attributeValue = CC_av_payload[1]; - CCPairs[2].attributeID = kCurrentYId; - CCPairs[2].attributeValue = CC_av_payload[2]; - CCPairs[3].attributeID = kColorTemperatureMiredsId; - CCPairs[3].attributeValue = CC_av_payload[3]; - CCPairs[4].attributeID = kEnhancedCurrentHueId; - CCPairs[4].attributeValue = CC_av_payload[4]; - CCPairs[5].attributeID = kColorLoopActiveId; - CCPairs[5].attributeValue = CC_av_payload[5]; - CCPairs[6].attributeID = kColorLoopDirectionId; - CCPairs[6].attributeValue = CC_av_payload[6]; - CCPairs[7].attributeID = kColorLoopTimeId; - CCPairs[7].attributeValue = CC_av_payload[7]; + OOPairs[0].attributeID = kOnOffAttId; + OOPairs[0].valueUnsigned8.SetValue(OO_av_payload); + + LCPairs[0].attributeID = kCurrentLevelId; + LCPairs[0].valueUnsigned8.SetValue(static_cast(LC_av_payload[0])); + LCPairs[1].attributeID = kCurrentFrequencyId; + LCPairs[1].valueUnsigned16.SetValue(LC_av_payload[1]); + + CCPairs[0].attributeID = kCurrentSaturationId; + CCPairs[0].valueUnsigned8.SetValue(static_cast(CC_av_payload[0])); + CCPairs[1].attributeID = kCurrentXId; + CCPairs[1].valueUnsigned16.SetValue(CC_av_payload[1]); + CCPairs[2].attributeID = kCurrentYId; + CCPairs[2].valueUnsigned16.SetValue(CC_av_payload[2]); + CCPairs[3].attributeID = kColorTemperatureMiredsId; + CCPairs[3].valueUnsigned16.SetValue(CC_av_payload[3]); + CCPairs[4].attributeID = kEnhancedCurrentHueId; + CCPairs[4].valueUnsigned16.SetValue(CC_av_payload[4]); + CCPairs[5].attributeID = kColorLoopActiveId; + CCPairs[5].valueUnsigned8.SetValue(static_cast(CC_av_payload[5])); + CCPairs[6].attributeID = kColorLoopDirectionId; + CCPairs[6].valueUnsigned8.SetValue(static_cast(CC_av_payload[6])); + CCPairs[7].attributeID = kColorLoopTimeId; + CCPairs[7].valueUnsigned8.SetValue(static_cast(CC_av_payload[7])); // Initialize Extension Field sets as if they were received by add commands OOextensionFieldSet.clusterID = kOnOffClusterId; @@ -669,10 +669,9 @@ TEST_F(TestSceneTable, TestHandlerFunctions) app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::DecodableType extensionFieldFailTestIn; app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type TooManyPairs[16]; - uint8_t payloadOk = 0; for (uint8_t i = 0; i < 16; i++) { - TooManyPairs[i].attributeValue = payloadOk; + TooManyPairs[i].valueUnsigned8.SetValue(0); } extensionFieldFailTestOut.clusterID = kColorControlClusterId; From ce8e0b76346360e3ecc2983b4a2d35d8ebe077e9 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Mon, 6 May 2024 12:44:53 -0400 Subject: [PATCH 3/9] Applied comments about typing and commented code, as well as example of colorcontrol in scenes --- data_model/1.3/clusters/Scenes.xml | 116 +++++++++--------- .../all-clusters-app.matter | 6 +- .../all-clusters-minimal-app.matter | 6 +- .../light-switch-app.matter | 6 +- .../light-switch-app/qpg/zap/switch.matter | 6 +- .../lighting-common/lighting-app.matter | 6 +- .../data_model/lighting-thread-app.matter | 6 +- .../data_model/lighting-wifi-app.matter | 6 +- .../placeholder/linux/apps/app1/config.matter | 6 +- .../placeholder/linux/apps/app2/config.matter | 6 +- .../nxp/zap/thermostat_matter_thread.matter | 6 +- .../nxp/zap/thermostat_matter_wifi.matter | 6 +- .../virtual-device-app.matter | 6 +- .../color-control-server.cpp | 18 +-- .../clusters/level-control/level-control.cpp | 12 +- .../clusters/on-off-server/on-off-server.cpp | 4 +- .../clusters/scenes-server/SceneHandlerImpl.h | 4 +- src/app/tests/TestSceneTable.cpp | 8 +- .../suites/TestScenesFabricSceneInfo.yaml | 92 ++++++++++++-- .../tests/suites/TestScenesMultiFabric.yaml | 8 +- .../suites/certification/Test_TC_S_2_2.yaml | 2 +- .../suites/certification/Test_TC_S_2_3.yaml | 4 +- .../zcl/data-model/chip/scene.xml | 6 +- .../data_model/controller-clusters.matter | 6 +- .../chip/devicecontroller/ChipStructs.java | 18 +-- .../chip/devicecontroller/cluster/files.gni | 2 +- ...agementClusterAttributeValuePairStruct.kt} | 11 +- ...cenesManagementClusterExtensionFieldSet.kt | 6 +- .../java/matter/controller/cluster/files.gni | 2 +- ...agementClusterAttributeValuePairStruct.kt} | 11 +- ...cenesManagementClusterExtensionFieldSet.kt | 6 +- .../python/chip/clusters/Objects.py | 6 +- .../CHIP/zap-generated/MTRBaseClusters.h | 2 +- .../zap-generated/MTRCommandPayloadsObjc.mm | 8 +- .../CHIP/zap-generated/MTRStructsObjc.h | 2 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 4 +- .../zap-generated/cluster-objects.cpp | 4 +- .../zap-generated/cluster-objects.h | 8 +- .../cluster/ComplexArgumentParser.cpp | 8 +- .../cluster/ComplexArgumentParser.h | 5 +- .../cluster/logging/DataModelLogger.cpp | 2 +- .../cluster/logging/DataModelLogger.h | 2 +- .../zap-generated/cluster/Commands.h | 4 +- 43 files changed, 273 insertions(+), 190 deletions(-) rename src/controller/java/generated/java/chip/devicecontroller/cluster/structs/{ScenesManagementClusterAttributeValuePair.kt => ScenesManagementClusterAttributeValuePairStruct.kt} (95%) rename src/controller/java/generated/java/matter/controller/cluster/structs/{ScenesManagementClusterAttributeValuePair.kt => ScenesManagementClusterAttributeValuePairStruct.kt} (95%) diff --git a/data_model/1.3/clusters/Scenes.xml b/data_model/1.3/clusters/Scenes.xml index bf68f8528fa159..9150a754d3041a 100644 --- a/data_model/1.3/clusters/Scenes.xml +++ b/data_model/1.3/clusters/Scenes.xml @@ -1,61 +1,61 @@ - @@ -398,4 +398,4 @@ Davis, CA 95616, USA - \ No newline at end of file + diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 10d07dd126f683..3d38d414542f17 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3513,7 +3513,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -3527,7 +3527,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -3639,7 +3639,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index cb0af97c5694eb..84aaa5195d509d 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -2425,7 +2425,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -2439,7 +2439,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -2551,7 +2551,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 9796791c744f09..443d01fd1b66f3 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -2043,7 +2043,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -2057,7 +2057,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -2169,7 +2169,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 580786895c6ca6..7c9e08b42cda3c 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -1840,7 +1840,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -1854,7 +1854,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -1966,7 +1966,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 24cb4de083e7be..01cf28695f1809 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1853,7 +1853,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -1867,7 +1867,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -1979,7 +1979,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index e3b8b4a20a6dd0..fca979d9a0f0cc 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1557,7 +1557,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -1571,7 +1571,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -1683,7 +1683,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 5b517a570516c4..cef810e98ed6ae 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1848,7 +1848,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -1862,7 +1862,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -1974,7 +1974,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 8838fcccff9a3f..dda7e817015843 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -3020,7 +3020,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -3034,7 +3034,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -3146,7 +3146,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 465c590da7c107..1f43cc8abde15c 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -2977,7 +2977,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -2991,7 +2991,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -3103,7 +3103,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 735d8ea195fd1e..6a531809f70319 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1753,7 +1753,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -1767,7 +1767,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -1879,7 +1879,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 33e99d403d016f..9a7c38a8b1a999 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1664,7 +1664,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -1678,7 +1678,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -1790,7 +1790,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 40aee55b8befe1..1867b560a789d0 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -1900,7 +1900,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -1914,7 +1914,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -2026,7 +2026,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index c7179d5a26ad94..400902b887b462 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -99,7 +99,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl /// @return CHIP_NO_ERROR if successfully serialized the data, CHIP_ERROR_INVALID_ARGUMENT otherwise CHIP_ERROR SerializeSave(EndpointId endpoint, ClusterId cluster, MutableByteSpan & serializedBytes) override { - using AttributeValuePair = ScenesManagement::Structs::AttributeValuePair::Type; + using AttributeValuePair = ScenesManagement::Structs::AttributeValuePairStruct::Type; AttributeValuePair pairs[kColorControlScenableAttributesCount]; @@ -194,7 +194,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl CHIP_ERROR ApplyScene(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, scenes::TransitionTimeMs timeMs) override { - app::DataModel::DecodableList attributeValueList; + app::DataModel::DecodableList attributeValueList; ReturnErrorOnFailure(DecodeAttributeValueList(serializedBytes, attributeValueList)); @@ -264,10 +264,10 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl case Attributes::CurrentSaturation::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation)) { - if (decodePair.valueUnsigned16.HasValue()) + if (decodePair.valueUnsigned8.HasValue()) { - colorSaturationTransitionState->finalValue = - std::min(decodePair.valueUnsigned16.Value(), colorSaturationTransitionState->highLimit); + colorSaturationTransitionState->finalValue = std::min( + static_cast(decodePair.valueUnsigned8.Value()), colorSaturationTransitionState->highLimit); } } break; @@ -403,15 +403,17 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl /// @param attributeCount number of attributes in the list, incremented by this function, used to keep track of how many /// attributes from the array are being used for the list to encode template - void AddAttributeValuePair(ScenesManagement::Structs::AttributeValuePair::Type * pairs, AttributeId id, Type value, + void AddAttributeValuePair(ScenesManagement::Structs::AttributeValuePairStruct::Type * pairs, AttributeId id, Type value, size_t & attributeCount) { + static_assert(sizeof(Type) == sizeof(uint8_t) || sizeof(Type) == sizeof(uint16_t), "Type must be uint8_t or uint16_t"); + pairs[attributeCount].attributeID = id; - if constexpr (sizeof(Type) == sizeof(uint8_t)) + if constexpr ((std::is_same_v) ) { pairs[attributeCount].valueUnsigned8.SetValue(value); } - else if constexpr (sizeof(Type) == sizeof(uint16_t)) + else if constexpr ((std::is_same_v) ) { pairs[attributeCount].valueUnsigned16.SetValue(value); } diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 5554188ace5cdd..91021adcab9f39 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -160,7 +160,7 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl /// @return CHIP_NO_ERROR if successfully serialized the data, CHIP_ERROR_INVALID_ARGUMENT otherwise CHIP_ERROR SerializeSave(EndpointId endpoint, ClusterId cluster, MutableByteSpan & serializedBytes) override { - using AttributeValuePair = ScenesManagement::Structs::AttributeValuePair::Type; + using AttributeValuePair = ScenesManagement::Structs::AttributeValuePairStruct::Type; app::DataModel::Nullable level; VerifyOrReturnError(Status::Success == Attributes::CurrentLevel::Get(endpoint, level), CHIP_ERROR_READ_FAILED); @@ -177,9 +177,7 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl } else { - uint8_t nullValue = 0; - chip::app::NumericAttributeTraits::SetNull(nullValue); -pairs[0].valueUnsigned8.SetValue(NumericAttributeTraits::kNullValue); + pairs[0].valueUnsigned8.SetValue(app::NumericAttributeTraits::kNullValue); } size_t attributeCount = 1; if (LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency)) @@ -205,7 +203,7 @@ pairs[0].valueUnsigned8.SetValue(NumericAttributeTraits::kNullValue); CHIP_ERROR ApplyScene(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, scenes::TransitionTimeMs timeMs) override { - app::DataModel::DecodableList attributeValueList; + app::DataModel::DecodableList attributeValueList; ReturnErrorOnFailure(DecodeAttributeValueList(serializedBytes, attributeValueList)); @@ -231,7 +229,7 @@ pairs[0].valueUnsigned8.SetValue(NumericAttributeTraits::kNullValue); break; case Attributes::CurrentFrequency::Id: // TODO : Uncomment when frequency is supported by the level control cluster - // frequency = static_cast(decodePair.attributeValue); + // frequency = decodePair.valueUnsigned16.Value(); break; default: return CHIP_ERROR_INVALID_ARGUMENT; @@ -242,7 +240,7 @@ pairs[0].valueUnsigned8.SetValue(NumericAttributeTraits::kNullValue); // TODO : Implement action on frequency when frequency not provisional anymore // if(LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency)){} - if (!chip::app::NumericAttributeTraits::IsNullValue(level)) + if (!app::NumericAttributeTraits::IsNullValue(level)) { CommandId command = LevelControlHasFeature(endpoint, LevelControl::Feature::kOnOff) ? Commands::MoveToLevelWithOnOff::Id : Commands::MoveToLevel::Id; diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 2da76eba63c8ee..c7c7bc69106f99 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -150,7 +150,7 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl /// @return CHIP_NO_ERROR if successfully serialized the data, CHIP_ERROR_INVALID_ARGUMENT otherwise CHIP_ERROR SerializeSave(EndpointId endpoint, ClusterId cluster, MutableByteSpan & serializedBytes) override { - using AttributeValuePair = ScenesManagement::Structs::AttributeValuePair::Type; + using AttributeValuePair = ScenesManagement::Structs::AttributeValuePairStruct::Type; bool currentValue; // read current on/off value @@ -180,7 +180,7 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl CHIP_ERROR ApplyScene(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, scenes::TransitionTimeMs timeMs) override { - app::DataModel::DecodableList attributeValueList; + app::DataModel::DecodableList attributeValueList; VerifyOrReturnError(cluster == OnOff::Id, CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/app/clusters/scenes-server/SceneHandlerImpl.h b/src/app/clusters/scenes-server/SceneHandlerImpl.h index 554ba2d7ad4893..88aa1350dfef43 100644 --- a/src/app/clusters/scenes-server/SceneHandlerImpl.h +++ b/src/app/clusters/scenes-server/SceneHandlerImpl.h @@ -36,8 +36,8 @@ class DefaultSceneHandlerImpl : public scenes::SceneHandler template using DecodableList = app::DataModel::DecodableList; - using AttributeValuePairType = app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type; - using AttributeValuePairDecodableType = app::Clusters::ScenesManagement::Structs::AttributeValuePair::DecodableType; + using AttributeValuePairType = app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type; + using AttributeValuePairDecodableType = app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::DecodableType; using ExtensionFieldSetDecodableType = app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::DecodableType; using ExtensionFieldSetType = app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::Type; diff --git a/src/app/tests/TestSceneTable.cpp b/src/app/tests/TestSceneTable.cpp index d4e2436af9aee0..ffb0a1fd5650ff 100644 --- a/src/app/tests/TestSceneTable.cpp +++ b/src/app/tests/TestSceneTable.cpp @@ -140,9 +140,9 @@ static app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::Type OOexten static app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::Type LCextensionFieldSet; static app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::Type CCextensionFieldSet; -static app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type OOPairs[1]; -static app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type LCPairs[2]; -static app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type CCPairs[8]; +static app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type OOPairs[1]; +static app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type LCPairs[2]; +static app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type CCPairs[8]; static uint8_t OO_buffer[scenes::kMaxFieldBytesPerCluster] = { 0 }; static uint8_t LC_buffer[scenes::kMaxFieldBytesPerCluster] = { 0 }; @@ -667,7 +667,7 @@ TEST_F(TestSceneTable, TestHandlerFunctions) // To test failure on serialize and deserialize when too many pairs are in the field sets app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::Type extensionFieldFailTestOut; app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::DecodableType extensionFieldFailTestIn; - app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type TooManyPairs[16]; + app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type TooManyPairs[16]; for (uint8_t i = 0; i < 16; i++) { diff --git a/src/app/tests/suites/TestScenesFabricSceneInfo.yaml b/src/app/tests/suites/TestScenesFabricSceneInfo.yaml index a15f9f0ef310a1..ba83953588bd3b 100644 --- a/src/app/tests/suites/TestScenesFabricSceneInfo.yaml +++ b/src/app/tests/suites/TestScenesFabricSceneInfo.yaml @@ -208,12 +208,50 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], + }, + { + ClusterID: 0x0300, + AttributeValueList: + [ + { + AttributeID: 0x0001, + ValueUnsigned8: 0x64, + }, + { + AttributeID: 0x0003, + ValueUnsigned16: 0x64, + }, + { + AttributeID: 0x0004, + ValueUnsigned16: 0x64, + }, + { + AttributeID: 0x0007, + ValueUnsigned16: 0x64, + }, + { + AttributeID: 0x4000, + ValueUnsigned16: 0x64, + }, + { + AttributeID: 0x4001, + ValueUnsigned8: 0x64, + }, + { + AttributeID: 0x4002, + ValueUnsigned8: 0x64, + }, + { + AttributeID: 0x4003, + ValueUnsigned8: 0x64, + }, + ], }, ] response: @@ -266,12 +304,50 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], + }, + { + ClusterID: 0x0300, + AttributeValueList: + [ + { + AttributeID: 0x0001, + ValueUnsigned8: 0x64, + }, + { + AttributeID: 0x0003, + ValueUnsigned16: 0x64, + }, + { + AttributeID: 0x0004, + ValueUnsigned16: 0x64, + }, + { + AttributeID: 0x0007, + ValueUnsigned16: 0x64, + }, + { + AttributeID: 0x4000, + ValueUnsigned16: 0x64, + }, + { + AttributeID: 0x4001, + ValueUnsigned8: 0x64, + }, + { + AttributeID: 0x4002, + ValueUnsigned8: 0x64, + }, + { + AttributeID: 0x4003, + ValueUnsigned8: 0x64, + }, + ], }, ] @@ -334,12 +410,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x00 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x00 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0xFA }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0xFA }], }, ] @@ -367,12 +443,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x00 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x00 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0xFA }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0xFA }], }, ] diff --git a/src/app/tests/suites/TestScenesMultiFabric.yaml b/src/app/tests/suites/TestScenesMultiFabric.yaml index f969270426bf19..d0e79798acb904 100644 --- a/src/app/tests/suites/TestScenesMultiFabric.yaml +++ b/src/app/tests/suites/TestScenesMultiFabric.yaml @@ -345,12 +345,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], }, ] response: @@ -451,12 +451,12 @@ tests: { ClusterID: 0x0006, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }], }, { ClusterID: 0x0008, AttributeValueList: - [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + [{ AttributeID: 0x0000, ValueUnsigned8: 0x64 }], }, ] response: diff --git a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml index 438a0b770e1b00..ead80fedb78436 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml @@ -643,7 +643,7 @@ tests: to 60 000 000 (60 000s) and a set of extension fields appropriate to AC1." verification: | - ./chip-tool scenesmanagement add-scene 0x0001 0x01 60000000 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4001", "attributeValue": "0x01"}]}]' 1 1 + ./chip-tool scenesmanagement add-scene 0x0001 0x01 60000000 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4001", "ValueUnsigned8": "0x01"}]}]' 1 1 Verify DUT sends a AddSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to G1 and the SceneID field set to 0x01 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: diff --git a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml index 6995dc5ebcaff8..5a76916edb39b7 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml @@ -309,7 +309,7 @@ tests: to G1, the SceneID field set to 0x01, the TransitionTime field set to 1000 (1s) and a set of extension fields appropriate to AC1." verification: | - ./chip-tool scenesmanagement add-scene 0x0101 0x01 1000 "scene name" '[{"clusterID": "0x0006", "attributeValueList":[{"attributeID": "0x0001", "attributeValue": "0x01"}, ]}, {"clusterID": "0x0008", "attributeValueList":[{"attributeID": "0x0000", "attributeValue": "0x64"}, ]}]' 1 1 + ./chip-tool scenesmanagement add-scene 0x0101 0x01 1000 "scene name" '[{"clusterID": "0x0006", "attributeValueList":[{"attributeID": "0x0000", "ValueUnsigned8": "0x01"}, ]}, {"clusterID": "0x0008", "attributeValueList":[{"attributeID": "0x0000", "ValueUnsigned8": "0x64"}, ]}]' 1 1 Verify DUT sends a AddSceneResponse command to TH with the Status field set to 0x00 (SUCCESS), the GroupID field set to 257 and the SceneID field set to 0x01 on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: @@ -557,7 +557,7 @@ tests: field set to G1, the SceneID field set to 0x03, the TransitionTime field set to G1 and a set of extension fields appropriate to AC1." verification: | - ./chip-tool scenesmanagement add-scene 0x0101 0x03 1 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4002", "attributeValue": "0x01"}]}]' 0xffffffffffff0101 1 + ./chip-tool scenesmanagement add-scene 0x0101 0x03 1 "scene name" '[{"clusterID": "0x0300", "attributeValueList":[{"attributeID": "0x4002", "ValueUnsigned8": "0x01"}]}]' 0xffffffffffff0101 1 Note: As this is a multicast command, no log is expected. cluster: "LogCommands" command: "UserPrompt" diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index fae71390eee724..a95f0270e0f8c5 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -29,7 +29,7 @@ limitations under the License. - + @@ -61,7 +61,7 @@ limitations under the License. - + @@ -86,7 +86,7 @@ limitations under the License. FabricSceneInfo - Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' + Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 8878336fded5b4..3c2b820d1ac49a 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3756,7 +3756,7 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; optional int8u valueUnsigned8 = 1; optional int8s valueSigned8 = 2; @@ -3770,7 +3770,7 @@ provisional cluster ScenesManagement = 98 { struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -3882,7 +3882,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 61f9c1b60661cd..6cc21fd1f911c7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -5078,7 +5078,7 @@ public String toString() { return output.toString(); } } -public static class ScenesManagementClusterAttributeValuePair { +public static class ScenesManagementClusterAttributeValuePairStruct { public Long attributeID; public Optional valueUnsigned8; public Optional valueSigned8; @@ -5098,7 +5098,7 @@ public static class ScenesManagementClusterAttributeValuePair { private static final long VALUE_UNSIGNED64_ID = 7L; private static final long VALUE_SIGNED64_ID = 8L; - public ScenesManagementClusterAttributeValuePair( + public ScenesManagementClusterAttributeValuePairStruct( Long attributeID, Optional valueUnsigned8, Optional valueSigned8, @@ -5135,7 +5135,7 @@ public StructType encodeTlv() { return new StructType(values); } - public static ScenesManagementClusterAttributeValuePair decodeTlv(BaseTLVType tlvValue) { + public static ScenesManagementClusterAttributeValuePairStruct decodeTlv(BaseTLVType tlvValue) { if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } @@ -5196,7 +5196,7 @@ public static ScenesManagementClusterAttributeValuePair decodeTlv(BaseTLVType tl } } } - return new ScenesManagementClusterAttributeValuePair( + return new ScenesManagementClusterAttributeValuePairStruct( attributeID, valueUnsigned8, valueSigned8, @@ -5212,7 +5212,7 @@ public static ScenesManagementClusterAttributeValuePair decodeTlv(BaseTLVType tl @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("ScenesManagementClusterAttributeValuePair {\n"); + output.append("ScenesManagementClusterAttributeValuePairStruct {\n"); output.append("\tattributeID: "); output.append(attributeID); output.append("\n"); @@ -5246,13 +5246,13 @@ public String toString() { } public static class ScenesManagementClusterExtensionFieldSet { public Long clusterID; - public ArrayList attributeValueList; + public ArrayList attributeValueList; private static final long CLUSTER_I_D_ID = 0L; private static final long ATTRIBUTE_VALUE_LIST_ID = 1L; public ScenesManagementClusterExtensionFieldSet( Long clusterID, - ArrayList attributeValueList + ArrayList attributeValueList ) { this.clusterID = clusterID; this.attributeValueList = attributeValueList; @@ -5271,7 +5271,7 @@ public static ScenesManagementClusterExtensionFieldSet decodeTlv(BaseTLVType tlv return null; } Long clusterID = null; - ArrayList attributeValueList = null; + ArrayList attributeValueList = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == CLUSTER_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -5281,7 +5281,7 @@ public static ScenesManagementClusterExtensionFieldSet decodeTlv(BaseTLVType tlv } else if (element.contextTagNum() == ATTRIBUTE_VALUE_LIST_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Array) { ArrayType castingValue = element.value(ArrayType.class); - attributeValueList = castingValue.map((elementcastingValue) -> ChipStructs.ScenesManagementClusterAttributeValuePair.decodeTlv(elementcastingValue)); + attributeValueList = castingValue.map((elementcastingValue) -> ChipStructs.ScenesManagementClusterAttributeValuePairStruct.decodeTlv(elementcastingValue)); } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 4bcff980b6cbe6..a62e5ec79a241e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -113,7 +113,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt", - "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterSceneInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ServiceAreaClusterHomeLocationStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt similarity index 95% rename from src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt rename to src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt index df06fcafa68ecd..b3f5953a4b780a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt @@ -23,7 +23,7 @@ import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class ScenesManagementClusterAttributeValuePair( +class ScenesManagementClusterAttributeValuePairStruct( val attributeID: ULong, val valueUnsigned8: Optional, val valueSigned8: Optional, @@ -35,7 +35,7 @@ class ScenesManagementClusterAttributeValuePair( val valueSigned64: Optional ) { override fun toString(): String = buildString { - append("ScenesManagementClusterAttributeValuePair {\n") + append("ScenesManagementClusterAttributeValuePairStruct {\n") append("\tattributeID : $attributeID\n") append("\tvalueUnsigned8 : $valueUnsigned8\n") append("\tvalueSigned8 : $valueSigned8\n") @@ -99,7 +99,10 @@ class ScenesManagementClusterAttributeValuePair( private const val TAG_VALUE_UNSIGNED64 = 7 private const val TAG_VALUE_SIGNED64 = 8 - fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ScenesManagementClusterAttributeValuePair { + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader + ): ScenesManagementClusterAttributeValuePairStruct { tlvReader.enterStructure(tlvTag) val attributeID = tlvReader.getULong(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) val valueUnsigned8 = @@ -153,7 +156,7 @@ class ScenesManagementClusterAttributeValuePair( tlvReader.exitContainer() - return ScenesManagementClusterAttributeValuePair( + return ScenesManagementClusterAttributeValuePairStruct( attributeID, valueUnsigned8, valueSigned8, diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt index 64bc8aff47ea55..758c40606baf2b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt @@ -25,7 +25,7 @@ import matter.tlv.TlvWriter class ScenesManagementClusterExtensionFieldSet( val clusterID: ULong, - val attributeValueList: List, + val attributeValueList: List ) { override fun toString(): String = buildString { append("ScenesManagementClusterExtensionFieldSet {\n") @@ -55,10 +55,10 @@ class ScenesManagementClusterExtensionFieldSet( tlvReader.enterStructure(tlvTag) val clusterID = tlvReader.getULong(ContextSpecificTag(TAG_CLUSTER_I_D)) val attributeValueList = - buildList { + buildList { tlvReader.enterArray(ContextSpecificTag(TAG_ATTRIBUTE_VALUE_LIST)) while (!tlvReader.isEndOfContainer()) { - add(ScenesManagementClusterAttributeValuePair.fromTlv(AnonymousTag, tlvReader)) + add(ScenesManagementClusterAttributeValuePairStruct.fromTlv(AnonymousTag, tlvReader)) } tlvReader.exitContainer() } diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index 7c11cb00b0aceb..27e731d29bf4d9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -113,7 +113,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/RvcRunModeClusterModeTagStruct.kt", - "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterSceneInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ServiceAreaClusterHomeLocationStruct.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt similarity index 95% rename from src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt rename to src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt index 5e841e5a08c86e..01c52ed43aa3bf 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePair.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt @@ -23,7 +23,7 @@ import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class ScenesManagementClusterAttributeValuePair( +class ScenesManagementClusterAttributeValuePairStruct( val attributeID: UInt, val valueUnsigned8: Optional, val valueSigned8: Optional, @@ -35,7 +35,7 @@ class ScenesManagementClusterAttributeValuePair( val valueSigned64: Optional ) { override fun toString(): String = buildString { - append("ScenesManagementClusterAttributeValuePair {\n") + append("ScenesManagementClusterAttributeValuePairStruct {\n") append("\tattributeID : $attributeID\n") append("\tvalueUnsigned8 : $valueUnsigned8\n") append("\tvalueSigned8 : $valueSigned8\n") @@ -99,7 +99,10 @@ class ScenesManagementClusterAttributeValuePair( private const val TAG_VALUE_UNSIGNED64 = 7 private const val TAG_VALUE_SIGNED64 = 8 - fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ScenesManagementClusterAttributeValuePair { + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader + ): ScenesManagementClusterAttributeValuePairStruct { tlvReader.enterStructure(tlvTag) val attributeID = tlvReader.getUInt(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) val valueUnsigned8 = @@ -153,7 +156,7 @@ class ScenesManagementClusterAttributeValuePair( tlvReader.exitContainer() - return ScenesManagementClusterAttributeValuePair( + return ScenesManagementClusterAttributeValuePairStruct( attributeID, valueUnsigned8, valueSigned8, diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt index bf90959b2604ed..0c44bdfbed5080 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt @@ -25,7 +25,7 @@ import matter.tlv.TlvWriter class ScenesManagementClusterExtensionFieldSet( val clusterID: UInt, - val attributeValueList: List, + val attributeValueList: List ) { override fun toString(): String = buildString { append("ScenesManagementClusterExtensionFieldSet {\n") @@ -55,10 +55,10 @@ class ScenesManagementClusterExtensionFieldSet( tlvReader.enterStructure(tlvTag) val clusterID = tlvReader.getUInt(ContextSpecificTag(TAG_CLUSTER_I_D)) val attributeValueList = - buildList { + buildList { tlvReader.enterArray(ContextSpecificTag(TAG_ATTRIBUTE_VALUE_LIST)) while (!tlvReader.isEndOfContainer()) { - add(ScenesManagementClusterAttributeValuePair.fromTlv(AnonymousTag, tlvReader)) + add(ScenesManagementClusterAttributeValuePairStruct.fromTlv(AnonymousTag, tlvReader)) } tlvReader.exitContainer() } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 31c425a17bfa7c..516e2f5a2e7800 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -20334,7 +20334,7 @@ class Feature(IntFlag): class Structs: @dataclass - class AttributeValuePair(ClusterObject): + class AttributeValuePairStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -20367,11 +20367,11 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="clusterID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="attributeValueList", Tag=1, Type=typing.List[ScenesManagement.Structs.AttributeValuePair]), + ClusterObjectFieldDescriptor(Label="attributeValueList", Tag=1, Type=typing.List[ScenesManagement.Structs.AttributeValuePairStruct]), ]) clusterID: 'uint' = 0 - attributeValueList: 'typing.List[ScenesManagement.Structs.AttributeValuePair]' = field(default_factory=lambda: []) + attributeValueList: 'typing.List[ScenesManagement.Structs.AttributeValuePairStruct]' = field(default_factory=lambda: []) @dataclass class SceneInfoStruct(ClusterObject): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 979c1b92605c15..d302465bd07b9a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -6625,7 +6625,7 @@ MTR_PROVISIONALLY_AVAILABLE /** * Command AddScene * - * Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' + * Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ - (void)addSceneWithParams:(MTRScenesManagementClusterAddSceneParams *)params completion:(void (^)(MTRScenesManagementClusterAddSceneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index f4d3af4e05bf0e..bacd761f42ffac 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -13068,11 +13068,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } listFreer.add(listHolder_2); for (size_t i_2 = 0; i_2 < element_0.attributeValueList.count; ++i_2) { - if (![element_0.attributeValueList[i_2] isKindOfClass:[MTRScenesManagementClusterAttributeValuePair class]]) { + if (![element_0.attributeValueList[i_2] isKindOfClass:[MTRScenesManagementClusterAttributeValuePairStruct class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_2 = (MTRScenesManagementClusterAttributeValuePair *) element_0.attributeValueList[i_2]; + auto element_2 = (MTRScenesManagementClusterAttributeValuePairStruct *) element_0.attributeValueList[i_2]; listHolder_2->mList[i_2].attributeID = element_2.attributeID.unsignedIntValue; if (element_2.valueUnsigned8 != nil) { auto & definedValue_4 = listHolder_2->mList[i_2].valueUnsigned8.Emplace(); @@ -13462,8 +13462,8 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ScenesMa auto iter_3 = entry_1.attributeValueList.begin(); while (iter_3.Next()) { auto & entry_3 = iter_3.GetValue(); - MTRScenesManagementClusterAttributeValuePair * newElement_3; - newElement_3 = [MTRScenesManagementClusterAttributeValuePair new]; + MTRScenesManagementClusterAttributeValuePairStruct * newElement_3; + newElement_3 = [MTRScenesManagementClusterAttributeValuePairStruct new]; newElement_3.attributeID = [NSNumber numberWithUnsignedInt:entry_3.attributeID]; if (entry_3.valueUnsigned8.HasValue()) { newElement_3.valueUnsigned8 = [NSNumber numberWithUnsignedChar:entry_3.valueUnsigned8.Value()]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 4f35a07fe452d8..2301e63c1e5c38 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1017,7 +1017,7 @@ MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)) @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRScenesManagementClusterAttributeValuePair : NSObject +@interface MTRScenesManagementClusterAttributeValuePairStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull attributeID MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable valueUnsigned8 MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable valueSigned8 MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index af90cbc2c4787f..97031c54c37287 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -4024,7 +4024,7 @@ - (NSString *)description @end -@implementation MTRScenesManagementClusterAttributeValuePair +@implementation MTRScenesManagementClusterAttributeValuePairStruct - (instancetype)init { if (self = [super init]) { @@ -4052,7 +4052,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRScenesManagementClusterAttributeValuePair alloc] init]; + auto other = [[MTRScenesManagementClusterAttributeValuePairStruct alloc] init]; other.attributeID = self.attributeID; other.valueUnsigned8 = self.valueUnsigned8; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 6d48cd603e1f6e..09383b5a02c3ec 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -12594,7 +12594,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) namespace ScenesManagement { namespace Structs { -namespace AttributeValuePair { +namespace AttributeValuePairStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; @@ -12668,7 +12668,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace AttributeValuePair +} // namespace AttributeValuePairStruct namespace ExtensionFieldSet { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index c963c1d21f7871..5b562f5b58a020 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -18174,7 +18174,7 @@ struct DecodableType } // namespace RvcOperationalState namespace ScenesManagement { namespace Structs { -namespace AttributeValuePair { +namespace AttributeValuePairStruct { enum class Fields : uint8_t { kAttributeID = 0, @@ -18210,7 +18210,7 @@ struct Type using DecodableType = Type; -} // namespace AttributeValuePair +} // namespace AttributeValuePairStruct namespace ExtensionFieldSet { enum class Fields : uint8_t { @@ -18222,7 +18222,7 @@ struct Type { public: chip::ClusterId clusterID = static_cast(0); - DataModel::List attributeValueList; + DataModel::List attributeValueList; static constexpr bool kIsFabricScoped = false; @@ -18233,7 +18233,7 @@ struct DecodableType { public: chip::ClusterId clusterID = static_cast(0); - DataModel::DecodableList attributeValueList; + DataModel::DecodableList attributeValueList; CHIP_ERROR Decode(TLV::TLVReader & reader); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 4b5a5a2c285822..035f26c348a135 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -2169,7 +2169,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ModeSelect::Structs::M } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type & request, + chip::app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); @@ -2177,8 +2177,8 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, // Copy to track which members we already processed. Json::Value valueCopy(value); - ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("AttributeValuePair.attributeID", "attributeID", value.isMember("attributeID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AttributeValuePairStruct.attributeID", "attributeID", + value.isMember("attributeID"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "attributeID"); @@ -2244,7 +2244,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } -void ComplexArgumentParser::Finalize(chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type & request) { ComplexArgumentParser::Finalize(request.attributeID); ComplexArgumentParser::Finalize(request.valueUnsigned8); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index f2893064ebafe0..b32e8eedcefb9f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -259,10 +259,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ModeSelect::Str static void Finalize(chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type & request, +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::Type & request); +static void Finalize(chip::app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 55c040df6a5874..ec9b3c4b962c17 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -1959,7 +1959,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::DecodableType & value) + const chip::app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index f0474e39422622..922ae495192512 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -163,7 +163,7 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Structs::AttributeValuePairStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::DecodableType & value); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index b7c3eb3d2d017e..166c18b63911e4 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -69437,8 +69437,8 @@ class ScenesManagementAddScene : public ClusterCommand { { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; for (auto & entry_2 : entry_0.attributeValueList) { - MTRScenesManagementClusterAttributeValuePair * newElement_2; - newElement_2 = [MTRScenesManagementClusterAttributeValuePair new]; + MTRScenesManagementClusterAttributeValuePairStruct * newElement_2; + newElement_2 = [MTRScenesManagementClusterAttributeValuePairStruct new]; newElement_2.attributeID = [NSNumber numberWithUnsignedInt:entry_2.attributeID]; if (entry_2.valueUnsigned8.HasValue()) { newElement_2.valueUnsigned8 = [NSNumber numberWithUnsignedChar:entry_2.valueUnsigned8.Value()]; From 85125fd6783c74c84de23b75b35b78dabc63a7b3 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Fri, 17 May 2024 14:37:28 -0400 Subject: [PATCH 4/9] Made static check on same type instead of size --- src/app/clusters/color-control-server/color-control-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 400902b887b462..22b8a3c0d250b3 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -406,7 +406,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl void AddAttributeValuePair(ScenesManagement::Structs::AttributeValuePairStruct::Type * pairs, AttributeId id, Type value, size_t & attributeCount) { - static_assert(sizeof(Type) == sizeof(uint8_t) || sizeof(Type) == sizeof(uint16_t), "Type must be uint8_t or uint16_t"); + static_assert((std::is_same_v) || (std::is_same_v), "Type must be uint8_t or uint16_t"); pairs[attributeCount].attributeID = id; if constexpr ((std::is_same_v) ) From 7cf2b7242b43a1a90aa0ff9ffa7656f0dc35255b Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:59:15 -0400 Subject: [PATCH 5/9] Update src/app/zap-templates/zcl/data-model/chip/scene.xml Co-authored-by: Boris Zbarsky --- src/app/zap-templates/zcl/data-model/chip/scene.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index a95f0270e0f8c5..b6315bdc1287c1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -86,7 +86,7 @@ limitations under the License. FabricSceneInfo - Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' + Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' From e9a88d8c361cc5734da6622d19c6dd692b37aa8f Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Thu, 4 Jul 2024 17:05:34 -0400 Subject: [PATCH 6/9] Added checks for missing values in level control and on off --- src/app/clusters/level-control/level-control.cpp | 2 ++ src/app/clusters/on-off-server/on-off-server.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 91021adcab9f39..9e9f5974f50bb2 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -225,10 +225,12 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl switch (decodePair.attributeID) { case Attributes::CurrentLevel::Id: + VerifyOrReturnError(decodePair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); level = decodePair.valueUnsigned8.Value(); break; case Attributes::CurrentFrequency::Id: // TODO : Uncomment when frequency is supported by the level control cluster + // VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); // frequency = decodePair.valueUnsigned16.Value(); break; default: diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index c7c7bc69106f99..8332403d68ebd4 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -195,6 +195,7 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl { auto & decodePair = pair_iterator.GetValue(); VerifyOrReturnError(decodePair.attributeID == Attributes::OnOff::Id, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(decodePair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); ReturnErrorOnFailure(mSceneEndpointStatePairs.InsertPair( OnOffEndPointPair(endpoint, static_cast(decodePair.valueUnsigned8.Value())))); } From a489741ddb0f45142552f811d2e755d81199bf92 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Thu, 4 Jul 2024 17:15:25 -0400 Subject: [PATCH 7/9] Added checks for HasValue in color control apply scene handler --- .../color-control-server.cpp | 64 +++++++------------ 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 22b8a3c0d250b3..6c2dcb2353331c 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -237,76 +237,60 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl case Attributes::CurrentX::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY)) { - if (decodePair.valueUnsigned16.HasValue()) - colorXTransitionState->finalValue = - std::min(decodePair.valueUnsigned16.Value(), colorXTransitionState->highLimit); + VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + colorXTransitionState->finalValue = + std::min(decodePair.valueUnsigned16.Value(), colorXTransitionState->highLimit); } break; case Attributes::CurrentY::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY)) { - if (decodePair.valueUnsigned16.HasValue()) - { - colorYTransitionState->finalValue = - std::min(decodePair.valueUnsigned16.Value(), colorYTransitionState->highLimit); - } + VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + colorYTransitionState->finalValue = + std::min(decodePair.valueUnsigned16.Value(), colorYTransitionState->highLimit); } break; case Attributes::EnhancedCurrentHue::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) { - if (decodePair.valueUnsigned16.HasValue()) - { - colorHueTransitionState->finalEnhancedHue = decodePair.valueUnsigned16.Value(); - } + VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + colorHueTransitionState->finalEnhancedHue = decodePair.valueUnsigned16.Value(); } break; case Attributes::CurrentSaturation::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation)) { - if (decodePair.valueUnsigned8.HasValue()) - { - colorSaturationTransitionState->finalValue = std::min( - static_cast(decodePair.valueUnsigned8.Value()), colorSaturationTransitionState->highLimit); - } + VerifyOrReturnError(decodePair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + colorSaturationTransitionState->finalValue = std::min(static_cast(decodePair.valueUnsigned8.Value()), + colorSaturationTransitionState->highLimit); } break; case Attributes::ColorLoopActive::Id: - if (decodePair.valueUnsigned8.HasValue()) - { - loopActiveValue = decodePair.valueUnsigned8.Value(); - } + VerifyOrReturnError(decodePair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + loopActiveValue = decodePair.valueUnsigned8.Value(); break; case Attributes::ColorLoopDirection::Id: - if (decodePair.valueUnsigned8.HasValue()) - { - loopDirectionValue = decodePair.valueUnsigned8.Value(); - } + VerifyOrReturnError(decodePair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + loopDirectionValue = decodePair.valueUnsigned8.Value(); break; case Attributes::ColorLoopTime::Id: - if (decodePair.valueUnsigned16.HasValue()) - { - loopTimeValue = decodePair.valueUnsigned16.Value(); - } + VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + loopTimeValue = decodePair.valueUnsigned16.Value(); break; case Attributes::ColorTemperatureMireds::Id: if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kColorTemperature)) { - if (decodePair.valueUnsigned16.HasValue()) - { - colorTempTransitionState->finalValue = - std::min(decodePair.valueUnsigned16.Value(), colorTempTransitionState->highLimit); - } + VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + colorTempTransitionState->finalValue = + std::min(decodePair.valueUnsigned16.Value(), colorTempTransitionState->highLimit); } break; case Attributes::EnhancedColorMode::Id: - if (decodePair.valueUnsigned8.HasValue()) + VerifyOrReturnError(decodePair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + if (decodePair.valueUnsigned8.Value() <= + static_cast(ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) { - if (decodePair.valueUnsigned8.Value() <= - static_cast(ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) - { - targetColorMode = decodePair.valueUnsigned8.Value(); - } + targetColorMode = decodePair.valueUnsigned8.Value(); } break; default: From 0e1f0b4777c039c10b166cafab8de0aaa31df220 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Fri, 5 Jul 2024 15:35:32 -0400 Subject: [PATCH 8/9] Added check on out of range values in the level control handler --- src/app/clusters/level-control/level-control.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 9e9f5974f50bb2..6ae7d141a4edfe 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -242,6 +242,12 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl // TODO : Implement action on frequency when frequency not provisional anymore // if(LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency)){} + EmberAfLevelControlState * state = getState(endpoint); + if (level < state->minLevel || level > state->maxLevel) + { + chip::app::NumericAttributeTraits::SetNull(level); + } + if (!app::NumericAttributeTraits::IsNullValue(level)) { CommandId command = LevelControlHasFeature(endpoint, LevelControl::Feature::kOnOff) ? Commands::MoveToLevelWithOnOff::Id From 69a5fc1f6836dd3adf2b0bf126570acb00e19da4 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Fri, 5 Jul 2024 16:49:01 -0400 Subject: [PATCH 9/9] Updated Zap generated files --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-minimal-app.matter | 2 +- .../rootnode_dimmablepluginunit_f8a9a0b9d4.matter | 15 +++++++++++---- .../light-switch-common/light-switch-app.matter | 2 +- examples/light-switch-app/qpg/zap/switch.matter | 2 +- .../lighting-common/lighting-app.matter | 2 +- .../silabs/data_model/lighting-thread-app.matter | 2 +- .../silabs/data_model/lighting-wifi-app.matter | 2 +- .../placeholder/linux/apps/app1/config.matter | 2 +- .../placeholder/linux/apps/app2/config.matter | 2 +- .../nxp/zap/thermostat_matter_thread.matter | 2 +- .../nxp/zap/thermostat_matter_wifi.matter | 2 +- .../virtual-device-app.matter | 2 +- .../data_model/controller-clusters.matter | 2 +- ...esManagementClusterAttributeValuePairStruct.kt | 6 +++--- .../ScenesManagementClusterExtensionFieldSet.kt | 2 +- ...esManagementClusterAttributeValuePairStruct.kt | 6 +++--- .../ScenesManagementClusterExtensionFieldSet.kt | 2 +- .../CHIP/zap-generated/MTRBaseClusters.h | 2 +- 19 files changed, 33 insertions(+), 26 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 3d38d414542f17..b512a6b1399d58 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3639,7 +3639,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 84aaa5195d509d..f7b4645e04f3a8 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -2551,7 +2551,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index 9d51e5c047e8cf..013752d2fdbf8a 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -1515,14 +1515,21 @@ provisional cluster ScenesManagement = 98 { kSceneNames = 0x1; } - struct AttributeValuePair { + struct AttributeValuePairStruct { attrib_id attributeID = 0; - int32u attributeValue = 1; + optional int8u valueUnsigned8 = 1; + optional int8s valueSigned8 = 2; + optional int16u valueUnsigned16 = 3; + optional int16s valueSigned16 = 4; + optional int32u valueUnsigned32 = 5; + optional int32s valueSigned32 = 6; + optional int64u valueUnsigned64 = 7; + optional int64s valueSigned64 = 8; } struct ExtensionFieldSet { cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; + AttributeValuePairStruct attributeValueList[] = 1; } fabric_scoped struct SceneInfoStruct { @@ -1634,7 +1641,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 443d01fd1b66f3..a0d6dfe2d3a781 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -2169,7 +2169,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 7c9e08b42cda3c..677a40b0f5485a 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -1966,7 +1966,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 01cf28695f1809..f0bfd80d7ddaed 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1979,7 +1979,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index fca979d9a0f0cc..6754f806b1a6b2 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1683,7 +1683,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index cef810e98ed6ae..37415d0d79f5cc 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1974,7 +1974,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index dda7e817015843..aa2f299a5c6093 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -3146,7 +3146,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 1f43cc8abde15c..82c062fbef2dd3 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -3103,7 +3103,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 6a531809f70319..55439d700c7c06 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1879,7 +1879,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 9a7c38a8b1a999..e6aa1f27611e44 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1790,7 +1790,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 1867b560a789d0..5fe6dd615c6d46 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -2026,7 +2026,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 3c2b820d1ac49a..0add2f8c6c5095 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3882,7 +3882,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierFrom = 2; } - /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' */ + /** Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; /** Retrieves the requested scene entry from its Scene table. */ fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt index b3f5953a4b780a..f8526c71f933a5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt @@ -32,7 +32,7 @@ class ScenesManagementClusterAttributeValuePairStruct( val valueUnsigned32: Optional, val valueSigned32: Optional, val valueUnsigned64: Optional, - val valueSigned64: Optional + val valueSigned64: Optional, ) { override fun toString(): String = buildString { append("ScenesManagementClusterAttributeValuePairStruct {\n") @@ -101,7 +101,7 @@ class ScenesManagementClusterAttributeValuePairStruct( fun fromTlv( tlvTag: Tag, - tlvReader: TlvReader + tlvReader: TlvReader, ): ScenesManagementClusterAttributeValuePairStruct { tlvReader.enterStructure(tlvTag) val attributeID = tlvReader.getULong(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) @@ -165,7 +165,7 @@ class ScenesManagementClusterAttributeValuePairStruct( valueUnsigned32, valueSigned32, valueUnsigned64, - valueSigned64 + valueSigned64, ) } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt index 758c40606baf2b..a2add794802904 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt @@ -25,7 +25,7 @@ import matter.tlv.TlvWriter class ScenesManagementClusterExtensionFieldSet( val clusterID: ULong, - val attributeValueList: List + val attributeValueList: List, ) { override fun toString(): String = buildString { append("ScenesManagementClusterExtensionFieldSet {\n") diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt index 01c52ed43aa3bf..9f142d41b3da4f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterAttributeValuePairStruct.kt @@ -32,7 +32,7 @@ class ScenesManagementClusterAttributeValuePairStruct( val valueUnsigned32: Optional, val valueSigned32: Optional, val valueUnsigned64: Optional, - val valueSigned64: Optional + val valueSigned64: Optional, ) { override fun toString(): String = buildString { append("ScenesManagementClusterAttributeValuePairStruct {\n") @@ -101,7 +101,7 @@ class ScenesManagementClusterAttributeValuePairStruct( fun fromTlv( tlvTag: Tag, - tlvReader: TlvReader + tlvReader: TlvReader, ): ScenesManagementClusterAttributeValuePairStruct { tlvReader.enterStructure(tlvTag) val attributeID = tlvReader.getUInt(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) @@ -165,7 +165,7 @@ class ScenesManagementClusterAttributeValuePairStruct( valueUnsigned32, valueSigned32, valueUnsigned64, - valueSigned64 + valueSigned64, ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt index 0c44bdfbed5080..bd219e98d152fd 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesManagementClusterExtensionFieldSet.kt @@ -25,7 +25,7 @@ import matter.tlv.TlvWriter class ScenesManagementClusterExtensionFieldSet( val clusterID: UInt, - val attributeValueList: List + val attributeValueList: List, ) { override fun toString(): String = buildString { append("ScenesManagementClusterExtensionFieldSet {\n") diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index d302465bd07b9a..fbf61defa7fe56 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -6625,7 +6625,7 @@ MTR_PROVISIONALLY_AVAILABLE /** * Command AddScene * - * Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "ValueX": VALUE}]}' + * Add a scene to the scene table. Extension field sets are supported, and are inputed as '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeID": VALUE, "Value*": VALUE}]}' */ - (void)addSceneWithParams:(MTRScenesManagementClusterAddSceneParams *)params completion:(void (^)(MTRScenesManagementClusterAddSceneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; /**