Skip to content

Commit

Permalink
Align On/Off cluster XML with the spec. (#29404)
Browse files Browse the repository at this point in the history
* Align On/Off cluster XML with the spec.

Updates to the changes from
https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/6511 and fixes
some other bugs (e.g. incorrect "DeadFrontBehavior" feature name).

Fixes #27092

* Auto-update .zap files.

* Regenerate generated code.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 18, 2024
1 parent a094e1a commit 2368540
Show file tree
Hide file tree
Showing 119 changed files with 1,040 additions and 960 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,41 +273,41 @@ server cluster Scenes = 5 {

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
client cluster OnOff = 6 {
enum OnOffDelayedAllOffEffectVariant : ENUM8 {
kFadeToOffIn0p8Seconds = 0;
enum DelayedAllOffEffectVariantEnum : ENUM8 {
kDelayedOffFastFade = 0;
kNoFade = 1;
k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2;
kDelayedOffSlowFade = 2;
}

enum OnOffDyingLightEffectVariant : ENUM8 {
k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0;
enum DyingLightEffectVariantEnum : ENUM8 {
kDyingLightFadeOff = 0;
}

enum OnOffEffectIdentifier : ENUM8 {
enum EffectIdentifierEnum : ENUM8 {
kDelayedAllOff = 0;
kDyingLight = 1;
}

enum OnOffStartUpOnOff : ENUM8 {
enum StartUpOnOffEnum : ENUM8 {
kOff = 0;
kOn = 1;
kTogglePreviousOnOff = 2;
kToggle = 2;
}

bitmap Feature : BITMAP32 {
kLighting = 0x1;
kDeadFront = 0x2;
kDeadFrontBehavior = 0x2;
}

bitmap OnOffControl : BITMAP8 {
bitmap OnOffControlBitmap : BITMAP8 {
kAcceptOnlyWhenOn = 0x1;
}

readonly attribute boolean onOff = 0;
readonly attribute optional boolean globalSceneControl = 16384;
attribute optional int16u onTime = 16385;
attribute optional int16u offWaitTime = 16386;
attribute access(write: manage) optional nullable OnOffStartUpOnOff startUpOnOff = 16387;
attribute access(write: manage) optional nullable StartUpOnOffEnum startUpOnOff = 16387;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand All @@ -316,12 +316,12 @@ client cluster OnOff = 6 {
readonly attribute int16u clusterRevision = 65533;

request struct OffWithEffectRequest {
OnOffEffectIdentifier effectIdentifier = 0;
EffectIdentifierEnum effectIdentifier = 0;
int8u effectVariant = 1;
}

request struct OnWithTimedOffRequest {
OnOffControl onOffControl = 0;
OnOffControlBitmap onOffControl = 0;
int16u onTime = 1;
int16u offWaitTime = 2;
}
Expand All @@ -342,41 +342,41 @@ client cluster OnOff = 6 {

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
server cluster OnOff = 6 {
enum OnOffDelayedAllOffEffectVariant : ENUM8 {
kFadeToOffIn0p8Seconds = 0;
enum DelayedAllOffEffectVariantEnum : ENUM8 {
kDelayedOffFastFade = 0;
kNoFade = 1;
k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2;
kDelayedOffSlowFade = 2;
}

enum OnOffDyingLightEffectVariant : ENUM8 {
k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0;
enum DyingLightEffectVariantEnum : ENUM8 {
kDyingLightFadeOff = 0;
}

enum OnOffEffectIdentifier : ENUM8 {
enum EffectIdentifierEnum : ENUM8 {
kDelayedAllOff = 0;
kDyingLight = 1;
}

enum OnOffStartUpOnOff : ENUM8 {
enum StartUpOnOffEnum : ENUM8 {
kOff = 0;
kOn = 1;
kTogglePreviousOnOff = 2;
kToggle = 2;
}

bitmap Feature : BITMAP32 {
kLighting = 0x1;
kDeadFront = 0x2;
kDeadFrontBehavior = 0x2;
}

bitmap OnOffControl : BITMAP8 {
bitmap OnOffControlBitmap : BITMAP8 {
kAcceptOnlyWhenOn = 0x1;
}

readonly attribute boolean onOff = 0;
readonly attribute boolean globalSceneControl = 16384;
attribute int16u onTime = 16385;
attribute int16u offWaitTime = 16386;
attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387;
attribute access(write: manage) nullable StartUpOnOffEnum startUpOnOff = 16387;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand All @@ -385,12 +385,12 @@ server cluster OnOff = 6 {
readonly attribute int16u clusterRevision = 65533;

request struct OffWithEffectRequest {
OnOffEffectIdentifier effectIdentifier = 0;
EffectIdentifierEnum effectIdentifier = 0;
int8u effectVariant = 1;
}

request struct OnWithTimedOffRequest {
OnOffControl onOffControl = 0;
OnOffControlBitmap onOffControl = 0;
int16u onTime = 1;
int16u offWaitTime = 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11528,7 +11528,7 @@
"code": 16387,
"mfgCode": null,
"side": "server",
"type": "OnOffStartUpOnOff",
"type": "StartUpOnOffEnum",
"included": 1,
"storageOption": "NVM",
"singleton": 0,
Expand Down Expand Up @@ -31622,7 +31622,7 @@
"code": 16387,
"mfgCode": null,
"side": "server",
"type": "OnOffStartUpOnOff",
"type": "StartUpOnOffEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -35392,6 +35392,5 @@
"endpointId": 65534,
"networkId": 0
}
],
"log": []
]
}
8 changes: 4 additions & 4 deletions examples/all-clusters-app/ameba/main/include/OnOffCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void ProcessOnOffUnicastBindingCommand(BindingCommandData * data, const EmberBin
break;

case Clusters::OnOff::Commands::OffWithEffect::Id:
offwitheffectCommand.effectIdentifier = static_cast<Clusters::OnOff::OnOffEffectIdentifier>(data->args[0]);
offwitheffectCommand.effectIdentifier = static_cast<Clusters::OnOff::EffectIdentifierEnum>(data->args[0]);
offwitheffectCommand.effectVariant = static_cast<uint8_t>(data->args[1]);
Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote,
offwitheffectCommand, onSuccess, onFailure);
Expand All @@ -136,7 +136,7 @@ void ProcessOnOffUnicastBindingCommand(BindingCommandData * data, const EmberBin
break;

case Clusters::OnOff::Commands::OnWithTimedOff::Id:
onwithtimedoffCommand.onOffControl = static_cast<chip::BitMask<Clusters::OnOff::OnOffControl>>(data->args[0]);
onwithtimedoffCommand.onOffControl = static_cast<chip::BitMask<Clusters::OnOff::OnOffControlBitmap>>(data->args[0]);
onwithtimedoffCommand.onTime = static_cast<uint16_t>(data->args[1]);
onwithtimedoffCommand.offWaitTime = static_cast<uint16_t>(data->args[2]);
Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote,
Expand Down Expand Up @@ -171,7 +171,7 @@ void ProcessOnOffGroupBindingCommand(BindingCommandData * data, const EmberBindi
break;

case Clusters::OnOff::Commands::OffWithEffect::Id:
offwitheffectCommand.effectIdentifier = static_cast<Clusters::OnOff::OnOffEffectIdentifier>(data->args[0]);
offwitheffectCommand.effectIdentifier = static_cast<Clusters::OnOff::EffectIdentifierEnum>(data->args[0]);
offwitheffectCommand.effectVariant = static_cast<uint8_t>(data->args[1]);
Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, offwitheffectCommand);
break;
Expand All @@ -181,7 +181,7 @@ void ProcessOnOffGroupBindingCommand(BindingCommandData * data, const EmberBindi
break;

case Clusters::OnOff::Commands::OnWithTimedOff::Id:
onwithtimedoffCommand.onOffControl = static_cast<chip::BitMask<Clusters::OnOff::OnOffControl>>(data->args[0]);
onwithtimedoffCommand.onOffControl = static_cast<chip::BitMask<Clusters::OnOff::OnOffControlBitmap>>(data->args[0]);
onwithtimedoffCommand.onTime = static_cast<uint16_t>(data->args[1]);
onwithtimedoffCommand.offWaitTime = static_cast<uint16_t>(data->args[2]);
Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, onwithtimedoffCommand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,41 +273,41 @@ server cluster Scenes = 5 {

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
server cluster OnOff = 6 {
enum OnOffDelayedAllOffEffectVariant : ENUM8 {
kFadeToOffIn0p8Seconds = 0;
enum DelayedAllOffEffectVariantEnum : ENUM8 {
kDelayedOffFastFade = 0;
kNoFade = 1;
k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2;
kDelayedOffSlowFade = 2;
}

enum OnOffDyingLightEffectVariant : ENUM8 {
k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0;
enum DyingLightEffectVariantEnum : ENUM8 {
kDyingLightFadeOff = 0;
}

enum OnOffEffectIdentifier : ENUM8 {
enum EffectIdentifierEnum : ENUM8 {
kDelayedAllOff = 0;
kDyingLight = 1;
}

enum OnOffStartUpOnOff : ENUM8 {
enum StartUpOnOffEnum : ENUM8 {
kOff = 0;
kOn = 1;
kTogglePreviousOnOff = 2;
kToggle = 2;
}

bitmap Feature : BITMAP32 {
kLighting = 0x1;
kDeadFront = 0x2;
kDeadFrontBehavior = 0x2;
}

bitmap OnOffControl : BITMAP8 {
bitmap OnOffControlBitmap : BITMAP8 {
kAcceptOnlyWhenOn = 0x1;
}

readonly attribute boolean onOff = 0;
readonly attribute boolean globalSceneControl = 16384;
attribute int16u onTime = 16385;
attribute int16u offWaitTime = 16386;
attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387;
attribute access(write: manage) nullable StartUpOnOffEnum startUpOnOff = 16387;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand All @@ -316,12 +316,12 @@ server cluster OnOff = 6 {
readonly attribute int16u clusterRevision = 65533;

request struct OffWithEffectRequest {
OnOffEffectIdentifier effectIdentifier = 0;
EffectIdentifierEnum effectIdentifier = 0;
int8u effectVariant = 1;
}

request struct OnWithTimedOffRequest {
OnOffControl onOffControl = 0;
OnOffControlBitmap onOffControl = 0;
int16u onTime = 1;
int16u offWaitTime = 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10580,7 +10580,7 @@
"code": 16387,
"mfgCode": null,
"side": "server",
"type": "OnOffStartUpOnOff",
"type": "StartUpOnOffEnum",
"included": 1,
"storageOption": "NVM",
"singleton": 0,
Expand Down Expand Up @@ -23818,7 +23818,7 @@
"code": 16387,
"mfgCode": null,
"side": "server",
"type": "OnOffStartUpOnOff",
"type": "StartUpOnOffEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down
20 changes: 10 additions & 10 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,33 @@ server cluster Identify = 3 {

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
server cluster OnOff = 6 {
enum OnOffDelayedAllOffEffectVariant : ENUM8 {
kFadeToOffIn0p8Seconds = 0;
enum DelayedAllOffEffectVariantEnum : ENUM8 {
kDelayedOffFastFade = 0;
kNoFade = 1;
k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2;
kDelayedOffSlowFade = 2;
}

enum OnOffDyingLightEffectVariant : ENUM8 {
k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0;
enum DyingLightEffectVariantEnum : ENUM8 {
kDyingLightFadeOff = 0;
}

enum OnOffEffectIdentifier : ENUM8 {
enum EffectIdentifierEnum : ENUM8 {
kDelayedAllOff = 0;
kDyingLight = 1;
}

enum OnOffStartUpOnOff : ENUM8 {
enum StartUpOnOffEnum : ENUM8 {
kOff = 0;
kOn = 1;
kTogglePreviousOnOff = 2;
kToggle = 2;
}

bitmap Feature : BITMAP32 {
kLighting = 0x1;
kDeadFront = 0x2;
kDeadFrontBehavior = 0x2;
}

bitmap OnOffControl : BITMAP8 {
bitmap OnOffControlBitmap : BITMAP8 {
kAcceptOnlyWhenOn = 0x1;
}

Expand Down
22 changes: 11 additions & 11 deletions examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter
Original file line number Diff line number Diff line change
Expand Up @@ -144,41 +144,41 @@ server cluster Groups = 4 {

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
server cluster OnOff = 6 {
enum OnOffDelayedAllOffEffectVariant : ENUM8 {
kFadeToOffIn0p8Seconds = 0;
enum DelayedAllOffEffectVariantEnum : ENUM8 {
kDelayedOffFastFade = 0;
kNoFade = 1;
k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2;
kDelayedOffSlowFade = 2;
}

enum OnOffDyingLightEffectVariant : ENUM8 {
k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0;
enum DyingLightEffectVariantEnum : ENUM8 {
kDyingLightFadeOff = 0;
}

enum OnOffEffectIdentifier : ENUM8 {
enum EffectIdentifierEnum : ENUM8 {
kDelayedAllOff = 0;
kDyingLight = 1;
}

enum OnOffStartUpOnOff : ENUM8 {
enum StartUpOnOffEnum : ENUM8 {
kOff = 0;
kOn = 1;
kTogglePreviousOnOff = 2;
kToggle = 2;
}

bitmap Feature : BITMAP32 {
kLighting = 0x1;
kDeadFront = 0x2;
kDeadFrontBehavior = 0x2;
}

bitmap OnOffControl : BITMAP8 {
bitmap OnOffControlBitmap : BITMAP8 {
kAcceptOnlyWhenOn = 0x1;
}

readonly attribute boolean onOff = 0;
readonly attribute boolean globalSceneControl = 16384;
attribute int16u onTime = 16385;
attribute int16u offWaitTime = 16386;
attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387;
attribute access(write: manage) nullable StartUpOnOffEnum startUpOnOff = 16387;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6351,7 +6351,7 @@
"code": 16387,
"mfgCode": null,
"side": "server",
"type": "OnOffStartUpOnOff",
"type": "StartUpOnOffEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6416,7 +6416,7 @@
"code": 16387,
"mfgCode": null,
"side": "server",
"type": "OnOffStartUpOnOff",
"type": "StartUpOnOffEnum",
"included": 0,
"storageOption": "RAM",
"singleton": 0,
Expand Down
Loading

0 comments on commit 2368540

Please sign in to comment.