From 0a4b0fb0b6eecbef52f8e7b5e0484cf7d57e7cf0 Mon Sep 17 00:00:00 2001 From: Jakob Olesen Date: Wed, 16 Nov 2022 14:16:29 +0100 Subject: [PATCH] Fixed wrong datamodel in Level Cluster Added: Cluster code to LevelControlOptions Bitmap Fixed: LevelControlOptions was defined wrong as Enum, Changed it to a Bitmap Changed/Fixed: Level Cluster Attribute 15 (OPTIONS) datatype from BITMAP8 to LevelControlOptions (Bitmap8) type Changed/Fixed: Level Command datatype for 'OptionsMask' and 'OptionsOverride' from BITMAP8 to LevelControlOptions --- .../all-clusters-app.matter | 39 ++--- .../all-clusters-minimal-app.matter | 39 ++--- .../bridge-common/bridge-app.matter | 39 ++--- ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 39 ++--- ...de_colortemperaturelight_hbUnzYVeyn.matter | 39 ++--- .../rootnode_dimmablelight_bCwGYSDpoe.matter | 39 ++--- ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 39 ++--- ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 37 ++--- .../rootnode_onofflight_bbs1b7IaOV.matter | 39 ++--- .../rootnode_speaker_RpzeXdimqA.matter | 39 ++--- .../bridge-common/bridge-app.matter | 39 ++--- .../lighting-common/lighting-app.matter | 39 ++--- .../nxp/zap/lighting-on-off.matter | 39 ++--- .../placeholder/linux/apps/app1/config.matter | 37 ++--- .../placeholder/linux/apps/app2/config.matter | 37 ++--- examples/pump-app/pump-common/pump-app.matter | 39 ++--- examples/tv-app/tv-common/tv-app.matter | 39 ++--- .../tv-casting-common/tv-casting-app.matter | 78 +++++----- .../clusters/level-control/level-control.cpp | 134 ++++++++++-------- .../zcl/data-model/silabs/general.xml | 60 ++++---- .../zcl/data-model/silabs/types.xml | 9 +- .../data_model/controller-clusters.matter | 39 ++--- .../CHIPAttributeTLVValueDecoder.cpp | 2 +- .../MTRAttributeTLVValueDecoder.mm | 2 +- .../CHIP/zap-generated/MTRBaseClusters.h | 5 + .../CHIP/zap-generated/MTRBaseClusters.mm | 58 +++++--- .../CHIP/zap-generated/MTRCallbackBridge.mm | 23 +++ .../MTRCallbackBridge_internal.h | 31 ++++ .../CHIP/zap-generated/MTRClusters.mm | 48 ++++--- .../zap-generated/attributes/Accessors.cpp | 8 +- .../zap-generated/attributes/Accessors.h | 5 +- .../app-common/zap-generated/cluster-enums.h | 7 + .../zap-generated/cluster-objects.h | 85 +++++------ .../app-common/zap-generated/enums.h | 11 +- .../zap-generated/cluster/Commands.h | 3 +- .../cluster/logging/DataModelLogger.cpp | 2 +- .../chip-tool/zap-generated/test/Commands.h | 126 ++++++++-------- .../zap-generated/cluster/Commands.h | 32 ++--- 38 files changed, 823 insertions(+), 602 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 62cf85754d8560..4f87fd2c122da9 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 @@ -300,6 +300,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; @@ -307,7 +312,7 @@ server cluster LevelControl = 8 { readonly attribute int16u currentFrequency = 4; readonly attribute int16u minFrequency = 5; readonly attribute int16u maxFrequency = 6; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute nullable int16u onTransitionTime = 18; @@ -320,55 +325,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; 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 9c29b7ed23e284..65d9b42461d81b 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 @@ -269,8 +269,13 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -278,55 +283,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index df5f85e168e8ee..935c1c8077c50b 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -105,6 +105,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; @@ -112,7 +117,7 @@ server cluster LevelControl = 8 { readonly attribute int16u currentFrequency = 4; readonly attribute int16u minFrequency = 5; readonly attribute int16u maxFrequency = 6; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute nullable int16u onTransitionTime = 18; @@ -125,55 +130,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 46a52abf83f151..e7583f96de6237 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -169,11 +169,16 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute command_id generatedCommandList[] = 65528; @@ -185,55 +190,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index f5684bbe513d5b..691f043df048b1 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -189,9 +189,14 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute command_id generatedCommandList[] = 65528; @@ -203,55 +208,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 49f75cecaea917..4ef2b98da6868e 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -169,11 +169,16 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute command_id generatedCommandList[] = 65528; @@ -185,55 +190,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index e576750f674b17..6266fa4f203f19 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -169,11 +169,16 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute command_id generatedCommandList[] = 65528; @@ -185,55 +190,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index d0ee4e4e62b511..e8b10818ad1ac0 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -165,6 +165,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; @@ -178,55 +183,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index c87555bc92d992..de8ed09da7a047 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -169,11 +169,16 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute command_id generatedCommandList[] = 65528; @@ -185,55 +190,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 7144dd9627d050..acc8ff44a996c7 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -162,10 +162,15 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -176,55 +181,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/dynamic-bridge-app/bridge-common/bridge-app.matter b/examples/dynamic-bridge-app/bridge-common/bridge-app.matter index df5f85e168e8ee..935c1c8077c50b 100644 --- a/examples/dynamic-bridge-app/bridge-common/bridge-app.matter +++ b/examples/dynamic-bridge-app/bridge-common/bridge-app.matter @@ -105,6 +105,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; @@ -112,7 +117,7 @@ server cluster LevelControl = 8 { readonly attribute int16u currentFrequency = 4; readonly attribute int16u minFrequency = 5; readonly attribute int16u maxFrequency = 6; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute nullable int16u onTransitionTime = 18; @@ -125,55 +130,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index d685bdd9abf0e8..68d7564439425b 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -185,6 +185,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; @@ -192,7 +197,7 @@ server cluster LevelControl = 8 { readonly attribute int16u currentFrequency = 4; readonly attribute int16u minFrequency = 5; readonly attribute int16u maxFrequency = 6; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute nullable int16u onTransitionTime = 18; @@ -205,55 +210,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 273c23cfa47a78..5a4d2825990eaf 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -189,11 +189,16 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; readonly attribute command_id generatedCommandList[] = 65528; @@ -205,55 +210,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index c8c0dbced38e45..f6d04ad8886a5a 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -343,6 +343,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -350,55 +355,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index c8c0dbced38e45..f6d04ad8886a5a 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -343,6 +343,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -350,55 +355,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 7531278b479891..b1b48d30664b9f 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -102,10 +102,15 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -116,55 +121,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index f143582ea66435..0a8fa960cd62d3 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -66,6 +66,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; @@ -73,7 +78,7 @@ server cluster LevelControl = 8 { readonly attribute int16u currentFrequency = 4; readonly attribute int16u minFrequency = 5; readonly attribute int16u maxFrequency = 6; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute nullable int16u onTransitionTime = 18; @@ -86,55 +91,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 976496d384ae7b..0c992d36f94001 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -320,6 +320,11 @@ client cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; @@ -327,7 +332,7 @@ client cluster LevelControl = 8 { readonly attribute int16u currentFrequency = 4; readonly attribute int16u minFrequency = 5; readonly attribute int16u maxFrequency = 6; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute nullable int16u onTransitionTime = 18; @@ -340,55 +345,55 @@ client cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; @@ -418,6 +423,11 @@ server cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; @@ -425,7 +435,7 @@ server cluster LevelControl = 8 { readonly attribute int16u currentFrequency = 4; readonly attribute int16u minFrequency = 5; readonly attribute int16u maxFrequency = 6; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute nullable int16u onTransitionTime = 18; @@ -438,55 +448,55 @@ server cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 5bca058f9aa7ba..87f6044619a62e 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -99,17 +100,24 @@ static EmberAfLevelControlState stateTable[kLevelControlStateTableSize]; static EmberAfLevelControlState * getState(EndpointId endpoint); static EmberAfStatus moveToLevelHandler(EndpointId endpoint, CommandId commandId, uint8_t level, - app::DataModel::Nullable transitionTimeDs, uint8_t optionsMask, - uint8_t optionsOverride, uint16_t storedLevel); + app::DataModel::Nullable transitionTimeDs, + chip::Optional> optionsMask, + chip::Optional> optionsOverride, uint16_t storedLevel); static void moveHandler(EndpointId endpoint, CommandId commandId, uint8_t moveMode, app::DataModel::Nullable rate, - uint8_t optionsMask, uint8_t optionsOverride); + chip::Optional> optionsMask, + chip::Optional> optionsOverride); static void stepHandler(EndpointId endpoint, CommandId commandId, uint8_t stepMode, uint8_t stepSize, - app::DataModel::Nullable transitionTimeDs, uint8_t optionsMask, uint8_t optionsOverride); -static void stopHandler(EndpointId endpoint, CommandId commandId, uint8_t optionsMask, uint8_t optionsOverride); + app::DataModel::Nullable transitionTimeDs, + chip::Optional> optionsMask, + chip::Optional> optionsOverride); +static void stopHandler(EndpointId endpoint, CommandId commandId, chip::Optional> optionsMask, + chip::Optional> optionsOverride); static void setOnOffValue(EndpointId endpoint, bool onOff); static void writeRemainingTime(EndpointId endpoint, uint16_t remainingTimeMs); -static bool shouldExecuteIfOff(EndpointId endpoint, CommandId commandId, uint8_t optionsMask, uint8_t optionsOverride); +static bool shouldExecuteIfOff(EndpointId endpoint, CommandId commandId, + chip::Optional> optionsMask, + chip::Optional> optionsOverride); #if !defined(IGNORE_LEVEL_CONTROL_CLUSTER_OPTIONS) && defined(EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP) static void reallyUpdateCoupledColorTemp(EndpointId endpoint); @@ -185,7 +193,7 @@ static EmberAfLevelControlState * getState(EndpointId endpoint) #if !defined(IGNORE_LEVEL_CONTROL_CLUSTER_OPTIONS) && defined(EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP) static void reallyUpdateCoupledColorTemp(EndpointId endpoint) { - uint8_t options; + LevelControl::Attributes::Options::TypeInfo::Type options; EmberAfStatus status = Attributes::Options::Get(endpoint, &options); if (status != EMBER_ZCL_STATUS_SUCCESS) { @@ -195,7 +203,7 @@ static void reallyUpdateCoupledColorTemp(EndpointId endpoint) if (emberAfContainsAttribute(endpoint, ColorControl::Id, ColorControl::Attributes::ColorTemperatureMireds::Id)) { - if (READBITS(options, EMBER_ZCL_LEVEL_CONTROL_OPTIONS_COUPLE_COLOR_TEMP_TO_LEVEL)) + if (options.Has(LevelControlOptions::kCoupleColorTempToLevel)) { emberAfPluginLevelControlCoupledColorTempChangeCallback(endpoint); } @@ -346,7 +354,9 @@ static void setOnOffValue(EndpointId endpoint, bool onOff) #endif // EMBER_AF_PLUGIN_ON_OFF } -static bool shouldExecuteIfOff(EndpointId endpoint, CommandId commandId, uint8_t optionsMask, uint8_t optionsOverride) +static bool shouldExecuteIfOff(EndpointId endpoint, CommandId commandId, + chip::Optional> optionsMask, + chip::Optional> optionsOverride) { #ifndef IGNORE_LEVEL_CONTROL_CLUSTER_OPTIONS if (emberAfContainsAttribute(endpoint, LevelControl::Id, Attributes::Options::Id)) @@ -370,14 +380,13 @@ static bool shouldExecuteIfOff(EndpointId endpoint, CommandId commandId, uint8_t return true; } - uint8_t options; + LevelControl::Attributes::Options::TypeInfo::Type options; EmberAfStatus status = Attributes::Options::Get(endpoint, &options); if (status != EMBER_ZCL_STATUS_SUCCESS) { emberAfLevelControlClusterPrintln("Unable to read Options attribute: 0x%X", status); // If we can't read the attribute, then we should just assume that it has its // default value. - options = 0x00; } bool on; @@ -408,23 +417,22 @@ static bool shouldExecuteIfOff(EndpointId endpoint, CommandId commandId, uint8_t // ---------- The following order is important in decision making ------- // -----------more readable ---------- // - if (optionsMask == 0xFF && optionsOverride == 0xFF) + if (!optionsMask.HasValue() || !optionsOverride.HasValue()) { - // 0xFF are the default values passed to the command handler when - // the payload is not present - in that case there is use of option + // in case optionMask or optionOverride is not set, use of option // attribute to decide execution of the command - return READBITS(options, EMBER_ZCL_LEVEL_CONTROL_OPTIONS_EXECUTE_IF_OFF); + return options.Has(LevelControlOptions::kExecuteIfOff); } // ---------- The above is to distinguish if the payload is present or not - if (READBITS(optionsMask, EMBER_ZCL_LEVEL_CONTROL_OPTIONS_EXECUTE_IF_OFF)) + if (optionsMask.Value().Has(LevelControlOptions::kExecuteIfOff)) { // Mask is present and set in the command payload, this indicates // use the over ride as temporary option - return READBITS(optionsOverride, EMBER_ZCL_LEVEL_CONTROL_OPTIONS_EXECUTE_IF_OFF); + return optionsOverride.Value().Has(LevelControlOptions::kExecuteIfOff); } // if we are here - use the option bits - return (READBITS(options, EMBER_ZCL_LEVEL_CONTROL_OPTIONS_EXECUTE_IF_OFF)); + return options.Has(LevelControlOptions::kExecuteIfOff); } #endif // IGNORE_LEVEL_CONTROL_CLUSTER_OPTIONS @@ -442,18 +450,19 @@ bool emberAfLevelControlClusterMoveToLevelCallback(app::CommandHandler * command if (transitionTime.IsNull()) { - emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL %x null %x %x", "RX level-control:", level, optionsMask, - optionsOverride); + emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL %x null %x %x", "RX level-control:", level, optionsMask.Raw(), + optionsOverride.Raw()); } else { emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL %x %2x %x %x", "RX level-control:", level, transitionTime.Value(), - optionsMask, optionsOverride); + optionsMask.Raw(), optionsOverride.Raw()); } - EmberAfStatus status = - moveToLevelHandler(commandPath.mEndpointId, Commands::MoveToLevel::Id, level, transitionTime, optionsMask, optionsOverride, - INVALID_STORED_LEVEL); // Don't revert to the stored level + EmberAfStatus status = moveToLevelHandler(commandPath.mEndpointId, Commands::MoveToLevel::Id, level, transitionTime, + Optional>(optionsMask), + Optional>(optionsOverride), + INVALID_STORED_LEVEL); // Don't revert to the stored level emberAfSendImmediateDefaultResponse(status); @@ -471,17 +480,18 @@ bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(app::CommandHandler if (transitionTime.IsNull()) { - emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL_WITH_ON_OFF %x null %x %x", "RX level-control:", level, optionsMask, - optionsOverride); + emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL_WITH_ON_OFF %x null %x %x", "RX level-control:", level, + optionsMask.Raw(), optionsOverride.Raw()); } else { emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL_WITH_ON_OFF %x %2x %x %x", "RX level-control:", level, - transitionTime.Value(), optionsMask, optionsOverride); + transitionTime.Value(), optionsMask.Raw(), optionsOverride.Raw()); } EmberAfStatus status = moveToLevelHandler(commandPath.mEndpointId, Commands::MoveToLevelWithOnOff::Id, level, transitionTime, - optionsMask, optionsOverride, + Optional>(optionsMask), + Optional>(optionsOverride), INVALID_STORED_LEVEL); // Don't revert to the stored level emberAfSendImmediateDefaultResponse(status); @@ -499,15 +509,17 @@ bool emberAfLevelControlClusterMoveCallback(app::CommandHandler * commandObj, co if (rate.IsNull()) { - emberAfLevelControlClusterPrintln("%pMOVE %x null %x %x", "RX level-control:", moveMode, optionsMask, optionsOverride); + emberAfLevelControlClusterPrintln("%pMOVE %x null %x %x", "RX level-control:", moveMode, optionsMask.Raw(), + optionsOverride.Raw()); } else { - emberAfLevelControlClusterPrintln("%pMOVE %x %u %x %x", "RX level-control:", moveMode, rate.Value(), optionsMask, - optionsOverride); + emberAfLevelControlClusterPrintln("%pMOVE %x %u %x %x", "RX level-control:", moveMode, rate.Value(), optionsMask.Raw(), + optionsOverride.Raw()); } - moveHandler(commandPath.mEndpointId, Commands::Move::Id, moveMode, rate, optionsMask, optionsOverride); + moveHandler(commandPath.mEndpointId, Commands::Move::Id, moveMode, rate, Optional>(optionsMask), + Optional>(optionsOverride)); return true; } @@ -521,16 +533,17 @@ bool emberAfLevelControlClusterMoveWithOnOffCallback(app::CommandHandler * comma if (rate.IsNull()) { - emberAfLevelControlClusterPrintln("%pMOVE_WITH_ON_OFF %x null %x %x", "RX level-control:", moveMode, optionsMask, - optionsOverride); + emberAfLevelControlClusterPrintln("%pMOVE_WITH_ON_OFF %x null %x %x", "RX level-control:", moveMode, optionsMask.Raw(), + optionsOverride.Raw()); } else { emberAfLevelControlClusterPrintln("%pMOVE_WITH_ON_OFF %u %2x %x %x", "RX level-control:", moveMode, rate.Value(), - optionsMask, optionsOverride); + optionsMask.Raw(), optionsOverride.Raw()); } - moveHandler(commandPath.mEndpointId, Commands::MoveWithOnOff::Id, moveMode, rate, optionsMask, optionsOverride); + moveHandler(commandPath.mEndpointId, Commands::MoveWithOnOff::Id, moveMode, rate, + Optional>(optionsMask), Optional>(optionsOverride)); return true; } @@ -545,16 +558,17 @@ bool emberAfLevelControlClusterStepCallback(app::CommandHandler * commandObj, co if (transitionTime.IsNull()) { - emberAfLevelControlClusterPrintln("%pSTEP %x %x null %x %x", "RX level-control:", stepMode, stepSize, optionsMask, - optionsOverride); + emberAfLevelControlClusterPrintln("%pSTEP %x %x null %x %x", "RX level-control:", stepMode, stepSize, optionsMask.Raw(), + optionsOverride.Raw()); } else { emberAfLevelControlClusterPrintln("%pSTEP %x %x %2x %x %x", "RX level-control:", stepMode, stepSize, transitionTime.Value(), - optionsMask, optionsOverride); + optionsMask.Raw(), optionsOverride.Raw()); } - stepHandler(commandPath.mEndpointId, Commands::Step::Id, stepMode, stepSize, transitionTime, optionsMask, optionsOverride); + stepHandler(commandPath.mEndpointId, Commands::Step::Id, stepMode, stepSize, transitionTime, + Optional>(optionsMask), Optional>(optionsOverride)); return true; } @@ -570,16 +584,16 @@ bool emberAfLevelControlClusterStepWithOnOffCallback(app::CommandHandler * comma if (transitionTime.IsNull()) { emberAfLevelControlClusterPrintln("%pSTEP_WITH_ON_OFF %x %x null %x %x", "RX level-control:", stepMode, stepSize, - optionsMask, optionsOverride); + optionsMask.Raw(), optionsOverride.Raw()); } else { emberAfLevelControlClusterPrintln("%pSTEP_WITH_ON_OFF %x %x %2x %x %x", "RX level-control:", stepMode, stepSize, - transitionTime.Value(), optionsMask, optionsOverride); + transitionTime.Value(), optionsMask.Raw(), optionsOverride.Raw()); } - stepHandler(commandPath.mEndpointId, Commands::StepWithOnOff::Id, stepMode, stepSize, transitionTime, optionsMask, - optionsOverride); + stepHandler(commandPath.mEndpointId, Commands::StepWithOnOff::Id, stepMode, stepSize, transitionTime, + Optional>(optionsMask), Optional>(optionsOverride)); return true; } @@ -590,7 +604,8 @@ bool emberAfLevelControlClusterStopCallback(app::CommandHandler * commandObj, co auto & optionsOverride = commandData.optionsOverride; emberAfLevelControlClusterPrintln("%pSTOP", "RX level-control:"); - stopHandler(commandPath.mEndpointId, Commands::Stop::Id, optionsMask, optionsOverride); + stopHandler(commandPath.mEndpointId, Commands::Stop::Id, Optional>(optionsMask), + Optional>(optionsOverride)); return true; } @@ -600,13 +615,15 @@ bool emberAfLevelControlClusterStopWithOnOffCallback(app::CommandHandler * comma auto & optionsMask = commandData.optionsMask; auto & optionsOverride = commandData.optionsOverride; emberAfLevelControlClusterPrintln("%pSTOP_WITH_ON_OFF", "RX level-control:"); - stopHandler(commandPath.mEndpointId, Commands::StopWithOnOff::Id, optionsMask, optionsOverride); + stopHandler(commandPath.mEndpointId, Commands::StopWithOnOff::Id, Optional>(optionsMask), + Optional>(optionsOverride)); return true; } static EmberAfStatus moveToLevelHandler(EndpointId endpoint, CommandId commandId, uint8_t level, - app::DataModel::Nullable transitionTimeDs, uint8_t optionsMask, - uint8_t optionsOverride, uint16_t storedLevel) + app::DataModel::Nullable transitionTimeDs, + chip::Optional> optionsMask, + chip::Optional> optionsOverride, uint16_t storedLevel) { EmberAfLevelControlState * state = getState(endpoint); EmberAfStatus status; @@ -751,7 +768,8 @@ static EmberAfStatus moveToLevelHandler(EndpointId endpoint, CommandId commandId } static void moveHandler(EndpointId endpoint, CommandId commandId, uint8_t moveMode, app::DataModel::Nullable rate, - uint8_t optionsMask, uint8_t optionsOverride) + chip::Optional> optionsMask, + chip::Optional> optionsOverride) { EmberAfLevelControlState * state = getState(endpoint); EmberAfStatus status; @@ -870,7 +888,9 @@ static void moveHandler(EndpointId endpoint, CommandId commandId, uint8_t moveMo } static void stepHandler(EndpointId endpoint, CommandId commandId, uint8_t stepMode, uint8_t stepSize, - app::DataModel::Nullable transitionTimeDs, uint8_t optionsMask, uint8_t optionsOverride) + app::DataModel::Nullable transitionTimeDs, + chip::Optional> optionsMask, + chip::Optional> optionsOverride) { EmberAfLevelControlState * state = getState(endpoint); EmberAfStatus status; @@ -997,7 +1017,8 @@ static void stepHandler(EndpointId endpoint, CommandId commandId, uint8_t stepMo emberAfSendImmediateDefaultResponse(status); } -static void stopHandler(EndpointId endpoint, CommandId commandId, uint8_t optionsMask, uint8_t optionsOverride) +static void stopHandler(EndpointId endpoint, CommandId commandId, chip::Optional> optionsMask, + chip::Optional> optionsOverride) { EmberAfLevelControlState * state = getState(endpoint); EmberAfStatus status; @@ -1119,7 +1140,8 @@ void emberAfOnOffClusterLevelControlEffectCallback(EndpointId endpoint, bool new // "Move CurrentLevel to OnLevel, or to the stored level if OnLevel is not // defined, over the time period OnOffTransitionTime." - moveToLevelHandler(endpoint, Commands::MoveToLevel::Id, resolvedLevel.Value(), transitionTime, 0xFF, 0xFF, + moveToLevelHandler(endpoint, Commands::MoveToLevel::Id, resolvedLevel.Value(), transitionTime, chip::NullOptional, + chip::NullOptional, INVALID_STORED_LEVEL); // Don't revert to stored level } else @@ -1130,14 +1152,14 @@ void emberAfOnOffClusterLevelControlEffectCallback(EndpointId endpoint, bool new if (useOnLevel) { // If OnLevel is defined, don't revert to stored level. - moveToLevelHandler(endpoint, Commands::MoveToLevelWithOnOff::Id, minimumLevelAllowedForTheDevice, transitionTime, 0xFF, - 0xFF, INVALID_STORED_LEVEL); + moveToLevelHandler(endpoint, Commands::MoveToLevelWithOnOff::Id, minimumLevelAllowedForTheDevice, transitionTime, + chip::NullOptional, chip::NullOptional, INVALID_STORED_LEVEL); } else { // If OnLevel is not defined, set the CurrentLevel to the stored level. - moveToLevelHandler(endpoint, Commands::MoveToLevelWithOnOff::Id, minimumLevelAllowedForTheDevice, transitionTime, 0xFF, - 0xFF, temporaryCurrentLevelCache.Value()); + moveToLevelHandler(endpoint, Commands::MoveToLevelWithOnOff::Id, minimumLevelAllowedForTheDevice, transitionTime, + chip::NullOptional, chip::NullOptional, temporaryCurrentLevelCache.Value()); } } } diff --git a/src/app/zap-templates/zcl/data-model/silabs/general.xml b/src/app/zap-templates/zcl/data-model/silabs/general.xml index ae60b4b869d559..426594319af0ec 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/general.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/general.xml @@ -191,21 +191,21 @@ limitations under the License. true true - CurrentLevel - RemainingTime - MinLevel - MaxLevel - CurrentFrequency - MinFrequency - MaxFrequency + CurrentLevel + RemainingTime + MinLevel + MaxLevel + CurrentFrequency + MinFrequency + MaxFrequency - OnOffTransitionTime - OnLevel - OnTransitionTime - OffTransitionTime - DefaultMoveRate - Options - + OnOffTransitionTime + OnLevel + OnTransitionTime + OffTransitionTime + DefaultMoveRate + Options + StartUpCurrentLevel @@ -216,8 +216,8 @@ limitations under the License. - - + + @@ -225,8 +225,8 @@ limitations under the License. - - + + @@ -235,15 +235,15 @@ limitations under the License. - - + + Command description for Stop - - + + @@ -251,8 +251,8 @@ limitations under the License. - - + + @@ -260,8 +260,8 @@ limitations under the License. - - + + @@ -270,15 +270,15 @@ limitations under the License. - - + + Command description for StopWithOnOff - - + + diff --git a/src/app/zap-templates/zcl/data-model/silabs/types.xml b/src/app/zap-templates/zcl/data-model/silabs/types.xml index aabddbc6742a64..c7e67ffe5d16ad 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/types.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/types.xml @@ -661,10 +661,11 @@ limitations under the License. - - - - + + + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index a2b36324ea51af..f5d80fdf265ac7 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -315,6 +315,11 @@ client cluster LevelControl = 8 { kFrequency = 0x4; } + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + readonly attribute nullable int8u currentLevel = 0; readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; @@ -322,7 +327,7 @@ client cluster LevelControl = 8 { readonly attribute int16u currentFrequency = 4; readonly attribute int16u minFrequency = 5; readonly attribute int16u maxFrequency = 6; - attribute bitmap8 options = 15; + attribute LevelControlOptions options = 15; attribute int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute nullable int16u onTransitionTime = 18; @@ -338,55 +343,55 @@ client cluster LevelControl = 8 { request struct MoveToLevelRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { INT8U level = 0; nullable INT16U transitionTime = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { MoveMode moveMode = 0; nullable INT8U rate = 1; - BITMAP8 optionsMask = 2; - BITMAP8 optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { StepMode stepMode = 0; INT8U stepSize = 1; nullable INT16U transitionTime = 2; - BITMAP8 optionsMask = 3; - BITMAP8 optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - BITMAP8 optionsMask = 0; - BITMAP8 optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 555e8280f40ba5..3e375f92f32085 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -957,7 +957,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + cppValue.Raw(), value); return value; } case Attributes::OnOffTransitionTime::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 010ca73af2f340..526c715f4d9fd5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -853,7 +853,7 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::OnOffTransitionTime::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index ad5833dc541cb3..e1cd36dfb534e6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -15927,6 +15927,11 @@ typedef NS_OPTIONS(uint32_t, MTRLevelControlFeature) { MTRLevelControlFeatureFrequency = 0x4, }; +typedef NS_OPTIONS(uint8_t, MTRLevelControlOptions) { + MTRLevelControlOptionsExecuteIfOff = 0x1, + MTRLevelControlOptionsCoupleColorTempToLevel = 0x2, +}; + typedef NS_ENUM(uint8_t, MTRAccessControlAuthMode) { MTRAccessControlAuthModePASE = 0x01, MTRAccessControlAuthModeCASE = 0x02, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 58ebfb94160ee6..fda01732811344 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -5059,8 +5059,10 @@ - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params auto & nonNullValue_0 = request.transitionTime.SetNonNull(); nonNullValue_0 = params.transitionTime.unsignedShortValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride + = static_cast>(params.optionsOverride.unsignedCharValue); return MTRStartInvokeInteraction( typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); @@ -5095,8 +5097,10 @@ - (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params completion:(MT auto & nonNullValue_0 = request.rate.SetNonNull(); nonNullValue_0 = params.rate.unsignedCharValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride + = static_cast>(params.optionsOverride.unsignedCharValue); return MTRStartInvokeInteraction( typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); @@ -5132,8 +5136,10 @@ - (void)stepWithParams:(MTRLevelControlClusterStepParams *)params completion:(MT auto & nonNullValue_0 = request.transitionTime.SetNonNull(); nonNullValue_0 = params.transitionTime.unsignedShortValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride + = static_cast>(params.optionsOverride.unsignedCharValue); return MTRStartInvokeInteraction( typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); @@ -5161,8 +5167,10 @@ - (void)stopWithParams:(MTRLevelControlClusterStopParams *)params completion:(MT timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); } } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride + = static_cast>(params.optionsOverride.unsignedCharValue); return MTRStartInvokeInteraction( typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); @@ -5198,8 +5206,10 @@ - (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnO auto & nonNullValue_0 = request.transitionTime.SetNonNull(); nonNullValue_0 = params.transitionTime.unsignedShortValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride + = static_cast>(params.optionsOverride.unsignedCharValue); return MTRStartInvokeInteraction( typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); @@ -5234,8 +5244,10 @@ - (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)par auto & nonNullValue_0 = request.rate.SetNonNull(); nonNullValue_0 = params.rate.unsignedCharValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride + = static_cast>(params.optionsOverride.unsignedCharValue); return MTRStartInvokeInteraction( typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); @@ -5271,8 +5283,10 @@ - (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)par auto & nonNullValue_0 = request.transitionTime.SetNonNull(); nonNullValue_0 = params.transitionTime.unsignedShortValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride + = static_cast>(params.optionsOverride.unsignedCharValue); return MTRStartInvokeInteraction( typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); @@ -5300,8 +5314,10 @@ - (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)par timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); } } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride + = static_cast>(params.optionsOverride.unsignedCharValue); return MTRStartInvokeInteraction( typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); @@ -5636,7 +5652,7 @@ - (void)readAttributeOptionsWithCompletion:(void (^)(NSNumber * _Nullable value, { MTRReadParams * params = [[MTRReadParams alloc] init]; using TypeInfo = LevelControl::Attributes::Options::TypeInfo; - return MTRReadAttribute( + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -5669,7 +5685,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = LevelControl::Attributes::Options::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); @@ -5682,7 +5698,7 @@ - (void)subscribeAttributeOptionsWithParams:(MTRSubscribeParams * _Nonnull)param reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = LevelControl::Attributes::Options::TypeInfo; - MTRSubscribeAttribute(params, + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -5692,8 +5708,8 @@ + (void)readAttributeOptionsWithAttributeCache:(MTRAttributeCacheContainer *)att queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + auto * bridge = new MTRLevelControlOptionsAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(^(LevelControlOptionsAttributeCallback successCb, MTRErrorCallback failureCb) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = LevelControl::Attributes::Options::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index d300ece5fd7c93..5a83eb0b4efd58 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -1273,6 +1273,29 @@ } } +void MTRLevelControlOptionsAttributeCallbackBridge::OnSuccessFn( + void * context, chip::BitMask value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void MTRLevelControlOptionsAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRLevelControlGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h index cf558413edde30..98cfb00771354e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h @@ -564,6 +564,7 @@ typedef void (*OnOffSwitchConfigurationAcceptedCommandListListAttributeCallback) void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OnOffSwitchConfigurationAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*LevelControlOptionsAttributeCallback)(void *, chip::BitMask); typedef void (*LevelControlGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*LevelControlAcceptedCommandListListAttributeCallback)( @@ -2430,6 +2431,36 @@ class MTROnOffSwitchConfigurationAttributeListListAttributeCallbackSubscriptionB MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRLevelControlOptionsAttributeCallbackBridge : public MTRCallbackBridge +{ +public: + MTRLevelControlOptionsAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRLevelControlOptionsAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::BitMask value); +}; + +class MTRLevelControlOptionsAttributeCallbackSubscriptionBridge : public MTRLevelControlOptionsAttributeCallbackBridge +{ +public: + MTRLevelControlOptionsAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRLevelControlOptionsAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRLevelControlOptionsAttributeCallbackBridge::KeepAliveOnCallback; + using MTRLevelControlOptionsAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRLevelControlGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index e709166833da73..ede5adbb6f4f71 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -2348,8 +2348,10 @@ - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params auto & nonNullValue_0 = request.transitionTime.SetNonNull(); nonNullValue_0 = params.transitionTime.unsignedShortValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride = static_cast>( + params.optionsOverride.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); @@ -2406,8 +2408,10 @@ - (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params auto & nonNullValue_0 = request.rate.SetNonNull(); nonNullValue_0 = params.rate.unsignedCharValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride = static_cast>( + params.optionsOverride.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); @@ -2465,8 +2469,10 @@ - (void)stepWithParams:(MTRLevelControlClusterStepParams *)params auto & nonNullValue_0 = request.transitionTime.SetNonNull(); nonNullValue_0 = params.transitionTime.unsignedShortValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride = static_cast>( + params.optionsOverride.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); @@ -2515,8 +2521,10 @@ - (void)stopWithParams:(MTRLevelControlClusterStopParams *)params if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride = static_cast>( + params.optionsOverride.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); @@ -2572,8 +2580,10 @@ - (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnO auto & nonNullValue_0 = request.transitionTime.SetNonNull(); nonNullValue_0 = params.transitionTime.unsignedShortValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride = static_cast>( + params.optionsOverride.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); @@ -2630,8 +2640,10 @@ - (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)par auto & nonNullValue_0 = request.rate.SetNonNull(); nonNullValue_0 = params.rate.unsignedCharValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride = static_cast>( + params.optionsOverride.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); @@ -2689,8 +2701,10 @@ - (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)par auto & nonNullValue_0 = request.transitionTime.SetNonNull(); nonNullValue_0 = params.transitionTime.unsignedShortValue; } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride = static_cast>( + params.optionsOverride.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); @@ -2739,8 +2753,10 @@ - (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)par if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } - request.optionsMask = params.optionsMask.unsignedCharValue; - request.optionsOverride = params.optionsOverride.unsignedCharValue; + request.optionsMask + = static_cast>(params.optionsMask.unsignedCharValue); + request.optionsOverride = static_cast>( + params.optionsOverride.unsignedCharValue); chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 26b721b92c7375..aba2445a5cba5d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -1160,9 +1160,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace Options { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); @@ -1174,9 +1174,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 9f533ae0ec0007..e1e6b3dd21d05d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -240,8 +240,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxFrequency namespace Options { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitMask * value); // LevelControlOptions +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace Options namespace OnOffTransitionTime { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 48eb4666e58f21..b71d81dba7eaaf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -222,6 +222,13 @@ enum class LevelControlFeature : uint32_t kLighting = 0x2, kFrequency = 0x4, }; + +// Bitmap for LevelControlOptions +enum class LevelControlOptions : uint8_t +{ + kExecuteIfOff = 0x1, + kCoupleColorTempToLevel = 0x2, +}; } // namespace LevelControl namespace BinaryInputBasic { 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 29465aede3a846..4fadf5d916bf8c 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 @@ -2275,8 +2275,8 @@ struct Type uint8_t level = static_cast(0); DataModel::Nullable transitionTime; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2293,8 +2293,8 @@ struct DecodableType uint8_t level = static_cast(0); DataModel::Nullable transitionTime; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveToLevel @@ -2316,8 +2316,8 @@ struct Type MoveMode moveMode = static_cast(0); DataModel::Nullable rate; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2334,8 +2334,8 @@ struct DecodableType MoveMode moveMode = static_cast(0); DataModel::Nullable rate; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Move @@ -2359,8 +2359,8 @@ struct Type StepMode stepMode = static_cast(0); uint8_t stepSize = static_cast(0); DataModel::Nullable transitionTime; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2378,8 +2378,8 @@ struct DecodableType StepMode stepMode = static_cast(0); uint8_t stepSize = static_cast(0); DataModel::Nullable transitionTime; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Step @@ -2397,8 +2397,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2413,8 +2413,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Stop @@ -2436,8 +2436,8 @@ struct Type uint8_t level = static_cast(0); DataModel::Nullable transitionTime; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2454,8 +2454,8 @@ struct DecodableType uint8_t level = static_cast(0); DataModel::Nullable transitionTime; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveToLevelWithOnOff @@ -2477,8 +2477,8 @@ struct Type MoveMode moveMode = static_cast(0); DataModel::Nullable rate; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2495,8 +2495,8 @@ struct DecodableType MoveMode moveMode = static_cast(0); DataModel::Nullable rate; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveWithOnOff @@ -2520,8 +2520,8 @@ struct Type StepMode stepMode = static_cast(0); uint8_t stepSize = static_cast(0); DataModel::Nullable transitionTime; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2539,8 +2539,8 @@ struct DecodableType StepMode stepMode = static_cast(0); uint8_t stepSize = static_cast(0); DataModel::Nullable transitionTime; - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StepWithOnOff @@ -2558,8 +2558,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::StopWithOnOff::Id; } static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2574,8 +2574,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::StopWithOnOff::Id; } static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StopWithOnOff @@ -2702,9 +2702,9 @@ struct TypeInfo namespace Options { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Options::Id; } @@ -2823,13 +2823,14 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); Attributes::CurrentLevel::TypeInfo::DecodableType currentLevel; - Attributes::RemainingTime::TypeInfo::DecodableType remainingTime = static_cast(0); - Attributes::MinLevel::TypeInfo::DecodableType minLevel = static_cast(0); - Attributes::MaxLevel::TypeInfo::DecodableType maxLevel = static_cast(0); - Attributes::CurrentFrequency::TypeInfo::DecodableType currentFrequency = static_cast(0); - Attributes::MinFrequency::TypeInfo::DecodableType minFrequency = static_cast(0); - Attributes::MaxFrequency::TypeInfo::DecodableType maxFrequency = static_cast(0); - Attributes::Options::TypeInfo::DecodableType options = static_cast(0); + Attributes::RemainingTime::TypeInfo::DecodableType remainingTime = static_cast(0); + Attributes::MinLevel::TypeInfo::DecodableType minLevel = static_cast(0); + Attributes::MaxLevel::TypeInfo::DecodableType maxLevel = static_cast(0); + Attributes::CurrentFrequency::TypeInfo::DecodableType currentFrequency = static_cast(0); + Attributes::MinFrequency::TypeInfo::DecodableType minFrequency = static_cast(0); + Attributes::MaxFrequency::TypeInfo::DecodableType maxFrequency = static_cast(0); + Attributes::Options::TypeInfo::DecodableType options = + static_cast>(0); Attributes::OnOffTransitionTime::TypeInfo::DecodableType onOffTransitionTime = static_cast(0); Attributes::OnLevel::TypeInfo::DecodableType onLevel; Attributes::OnTransitionTime::TypeInfo::DecodableType onTransitionTime; diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 76e565bbaeedb6..f2d3e87a8a3812 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -179,13 +179,6 @@ enum EmberAfKeypadLockout : uint8_t EMBER_ZCL_KEYPAD_LOCKOUT_LEVELFIVE_LOCKOUT = 5, }; -// Enum for LevelControlOptions -enum EmberAfLevelControlOptions : uint8_t -{ - EMBER_ZCL_LEVEL_CONTROL_OPTIONS_EXECUTE_IF_OFF = 1, - EMBER_ZCL_LEVEL_CONTROL_OPTIONS_COUPLE_COLOR_TEMP_TO_LEVEL = 2, -}; - // Enum for MoveMode enum EmberAfMoveMode : uint8_t { @@ -741,6 +734,10 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_LEVEL_CONTROL_FEATURE_LIGHTING_OFFSET (1) #define EMBER_AF_LEVEL_CONTROL_FEATURE_FREQUENCY (4) #define EMBER_AF_LEVEL_CONTROL_FEATURE_FREQUENCY_OFFSET (2) +#define EMBER_AF_LEVEL_CONTROL_OPTIONS_EXECUTE_IF_OFF (1) +#define EMBER_AF_LEVEL_CONTROL_OPTIONS_EXECUTE_IF_OFF_OFFSET (0) +#define EMBER_AF_LEVEL_CONTROL_OPTIONS_COUPLE_COLOR_TEMP_TO_LEVEL (2) +#define EMBER_AF_LEVEL_CONTROL_OPTIONS_COUPLE_COLOR_TEMP_TO_LEVEL_OFFSET (1) #define EMBER_AF_MAINS_ALARM_MASK_VOLTAGE_TOO_LOW (1) #define EMBER_AF_MAINS_ALARM_MASK_VOLTAGE_TOO_LOW_OFFSET (0) #define EMBER_AF_MAINS_ALARM_MASK_VOLTAGE_TOO_HIGH (2) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index b437a3697fca4d..852804cdd7daff 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -8521,7 +8521,8 @@ void registerClusterLevelControl(Commands & commands, CredentialIssuerCommands * make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "options", 0, UINT8_MAX, Attributes::Options::Id, credsIssuerConfig), // + make_unique>>( + Id, "options", 0, UINT8_MAX, Attributes::Options::Id, credsIssuerConfig), // make_unique>(Id, "on-off-transition-time", 0, UINT16_MAX, Attributes::OnOffTransitionTime::Id, credsIssuerConfig), // make_unique>>(Id, "on-level", 0, UINT8_MAX, Attributes::OnLevel::Id, 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 ba839e1739c4fd..c9f8748cdbe4da 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -4435,7 +4435,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("MaxFrequency", 1, value); } case LevelControl::Attributes::Options::Id: { - uint8_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Options", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 1c8402f90d6507..2446e824d04e59 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -18153,7 +18153,7 @@ class Test_TC_LVL_2_1Suite : public TestCommand case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint8_t value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "bitmap8", "bitmap8")); } @@ -18866,7 +18866,7 @@ class Test_TC_LVL_3_1Suite : public TestCommand case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint8_t value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("options", value, 0U)); } @@ -18931,7 +18931,7 @@ class Test_TC_LVL_3_1Suite : public TestCommand case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint8_t value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("options", value, 1U)); } @@ -19039,8 +19039,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand LogStep(4, "TH writes 0 to the Options attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - uint8_t value; - value = 0U; + chip::BitMask value; + value = static_cast>(0U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, chip::NullOptional, chip::NullOptional); } @@ -19061,8 +19061,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 50U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevelWithOnOff::Id, value, chip::NullOptional @@ -19096,8 +19096,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 50U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19119,8 +19119,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 200U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 300U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19193,8 +19193,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand LogStep(22, "TH writes 0 to the Options attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - uint8_t value; - value = 0U; + chip::BitMask value; + value = static_cast>(0U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, chip::NullOptional, chip::NullOptional); } @@ -19221,8 +19221,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 100U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19251,8 +19251,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 120U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19272,8 +19272,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 140U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 1U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19293,8 +19293,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 160U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 1U; - value.optionsOverride = 1U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(1U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19310,8 +19310,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand LogStep(34, "TH writes 1 to the Options attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - uint8_t value; - value = 1U; + chip::BitMask value; + value = static_cast>(1U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, chip::NullOptional, chip::NullOptional); } @@ -19338,8 +19338,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 100U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19368,8 +19368,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 120U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19389,8 +19389,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 140U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 1U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19410,8 +19410,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand value.level = 160U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 1U; - value.optionsOverride = 1U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(1U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19663,8 +19663,8 @@ class Test_TC_LVL_4_1Suite : public TestCommand LogStep(4, "TH writes 0 to the Options attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - uint8_t value; - value = 0U; + chip::BitMask value; + value = static_cast>(0U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, chip::NullOptional, chip::NullOptional); } @@ -19691,8 +19691,8 @@ class Test_TC_LVL_4_1Suite : public TestCommand value.moveMode = static_cast(0); value.rate.SetNonNull(); value.rate.Value() = 10U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveWithOnOff::Id, value, chip::NullOptional @@ -19739,8 +19739,8 @@ class Test_TC_LVL_4_1Suite : public TestCommand value.level = 50U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -19760,8 +19760,8 @@ class Test_TC_LVL_4_1Suite : public TestCommand value.moveMode = static_cast(0); value.rate.SetNonNull(); value.rate.Value() = 5U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Move::Id, value, chip::NullOptional @@ -20048,8 +20048,8 @@ class Test_TC_LVL_5_1Suite : public TestCommand LogStep(4, "TH writes 0 to the Options attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - uint8_t value; - value = 0U; + chip::BitMask value; + value = static_cast>(0U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, chip::NullOptional, chip::NullOptional); } @@ -20073,8 +20073,8 @@ class Test_TC_LVL_5_1Suite : public TestCommand value.stepSize = 50U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::StepWithOnOff::Id, value, chip::NullOptional @@ -20102,8 +20102,8 @@ class Test_TC_LVL_5_1Suite : public TestCommand value.level = 50U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -20124,8 +20124,8 @@ class Test_TC_LVL_5_1Suite : public TestCommand value.stepSize = 150U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 300U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Step::Id, value, chip::NullOptional @@ -20366,8 +20366,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand LogStep(2, "TH writes 0 to the Options attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - uint8_t value; - value = 0U; + chip::BitMask value; + value = static_cast>(0U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, chip::NullOptional, chip::NullOptional); } @@ -20388,8 +20388,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand value.level = 50U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -20411,8 +20411,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand value.moveMode = static_cast(0); value.rate.SetNonNull(); value.rate.Value() = 5U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Move::Id, value, chip::NullOptional @@ -20430,8 +20430,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("LVL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::Stop::Type value; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Stop::Id, value, chip::NullOptional @@ -20464,8 +20464,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand value.moveMode = static_cast(0); value.rate.SetNonNull(); value.rate.Value() = 5U; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Move::Id, value, chip::NullOptional @@ -20483,8 +20483,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("LVL.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type value; - value.optionsMask = 0U; - value.optionsOverride = 0U; + value.optionsMask = static_cast>(0U); + value.optionsOverride = static_cast>(0U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::StopWithOnOff::Id, value, chip::NullOptional @@ -62945,8 +62945,8 @@ class TestLevelControlWithOnOffDependencySuite : public TestCommand value.level = 1U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 1U; - value.optionsOverride = 1U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(1U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional @@ -63065,8 +63065,8 @@ class TestLevelControlWithOnOffDependencySuite : public TestCommand value.level = 127U; value.transitionTime.SetNonNull(); value.transitionTime.Value() = 0U; - value.optionsMask = 1U; - value.optionsOverride = 1U; + value.optionsMask = static_cast>(1U); + value.optionsOverride = static_cast>(1U); return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, chip::NullOptional 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 1d5d8e64b02558..8b1fb536c318d6 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -4602,8 +4602,8 @@ class LevelControlMoveToLevel : public ClusterCommand { } else { params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime.Value()]; } - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -4658,8 +4658,8 @@ class LevelControlMove : public ClusterCommand { } else { params.rate = [NSNumber numberWithUnsignedChar:mRequest.rate.Value()]; } - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -4716,8 +4716,8 @@ class LevelControlStep : public ClusterCommand { } else { params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime.Value()]; } - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -4764,8 +4764,8 @@ class LevelControlStop : public ClusterCommand { __auto_type * params = [[MTRLevelControlClusterStopParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -4820,8 +4820,8 @@ class LevelControlMoveToLevelWithOnOff : public ClusterCommand { } else { params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime.Value()]; } - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -4876,8 +4876,8 @@ class LevelControlMoveWithOnOff : public ClusterCommand { } else { params.rate = [NSNumber numberWithUnsignedChar:mRequest.rate.Value()]; } - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -4934,8 +4934,8 @@ class LevelControlStepWithOnOff : public ClusterCommand { } else { params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime.Value()]; } - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -4982,8 +4982,8 @@ class LevelControlStopWithOnOff : public ClusterCommand { __auto_type * params = [[MTRLevelControlClusterStopWithOnOffParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) {