Skip to content

Commit

Permalink
Update mode select xml to reflect fall 23 spec (#26508)
Browse files Browse the repository at this point in the history
* Updated the mode select xml to match the current spec.

* Added the version bump to the mode select cluster as per PR comment.

* Fixed new command xml definitions missing the response and disableDefaultResponse specifiers.

* Renamed the mode select feature map fields to match the general behavior.

* Added data-model XML definitions for all Mode Select aliased clusters.

* Added the Mode Select alias clusters' XMLs to the relevant lists.

* Updated the controller zap file to include the new clusters.

* Fixed errors in the Mode Select alias' XML feature maps.

* Added generated code

* Restyled by prettier-json

* Simplified the Mode Select cluster XMLs.

* Matched the ModeSelect alias clusters' version to the ModeSelect cluster.

* Update src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Removed white spaces in ChangeToModeResponseStatus items

* removed the STANDARD_NAMESPACE attribute from ModeSelect XMLs

* Update src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Rnamed the Laundry Washer cluster to match the spec. Removed reading of depricated StandardNamespace in the TestModeSelectCluster.yaml.

* Added generated code after merge.

* Readded the STANDARD_NAMESPACE attribute to the ModeSelect XML as optional to avoid braking client APIs.

* Renamed the laundyr washer XML to match the cluster name as defined in the spec.

* Renamed the mode select alias clusters to match the latest spec changes. Fixes issue #26551.

* Updated the RVC Run ChangeToModeResponseStatus enums to match the latest spec.

* Changed the enum names based on the spec PR 6986.

* Added generated code after merge. Updated the mode select example following the renaming of the semantic tags.

* Added TagName to the ModeOptionStruct following the spce change in PR 6969.

* Depricated the MfgCode in ModeOptionStruct following the spec change in PR 6989.

* regenerated zap code.

* Generated the zap code. Updated the ModeSelect all-clustres-app example.

* Restyled by clang-format

* Updated the use of semantic tags. in the esp32 examples.

* Regenerated code after merge.

* Restyled by clang-format

* Regenerated code after merge.

* Fixed linux build.

* Fixed fake linux build...

* Updated the TestModeSelectCluster.yaml to match the new name change.

* Added expeted generated files to src/controller/data_model/BUILD.gn and sorted the list.

* Restyled by clang-format

* Restyled by prettier-yaml

* Added generated code

* Regenerated code after merge.

---------

Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
  • Loading branch information
3 people authored and pull[bot] committed Nov 23, 2023
1 parent 0a07be1 commit 4005041
Show file tree
Hide file tree
Showing 123 changed files with 52,641 additions and 12,600 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \
Expand All @@ -154,6 +155,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml \
Expand All @@ -173,8 +175,11 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml \
src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/scene.xml \
src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down Expand Up @@ -2296,22 +2308,43 @@ server cluster IcdManagement = 70 {

/** Attributes and commands for selecting a mode from a list of supported options. */
server cluster ModeSelect = 80 {
enum ModeTag : ENUM16 {
kAuto = 0;
kQuick = 1;
kQuiet = 2;
kLowNoise = 3;
kLowEnergy = 4;
kVacation = 5;
kMin = 6;
kMax = 7;
kNight = 8;
kDay = 9;
}

enum StatusCode : ENUM8 {
kSuccess = 0;
kUnsupportedMode = 1;
kGenericFailure = 2;
}

bitmap Feature : BITMAP32 {
kDeponoff = 0x1;
kOnOff = 0x1;
kExtendedStatus = 0x2;
}

struct SemanticTagStruct {
vendor_id mfgCode = 0;
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
SemanticTagStruct semanticTags[] = 2;
ModeTagStruct modeTags[] = 2;
}

readonly attribute char_string<32> description = 0;
readonly attribute char_string<64> description = 0;
readonly attribute nullable enum16 standardNamespace = 1;
readonly attribute ModeOptionStruct supportedModes[] = 2;
readonly attribute int8u currentMode = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,30 @@ using namespace chip::app::Clusters::ModeSelect;
using chip::Protocols::InteractionModel::Status;

using ModeOptionStructType = Structs::ModeOptionStruct::Type;
using SemanticTag = Structs::SemanticTagStruct::Type;
using ModeTagType = Structs::ModeTagStruct::Type;
template <typename T>
using List = app::DataModel::List<T>;
using storage_value_type = const ModeOptionStructType;
namespace {
Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode,
const List<const SemanticTag> & semanticTags)
Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, const List<const ModeTagType> & modeTags)
{
Structs::ModeOptionStruct::Type option;
option.label = CharSpan::fromCharString(label);
option.mode = mode;
option.semanticTags = semanticTags;
option.label = CharSpan::fromCharString(label);
option.mode = mode;
option.modeTags = modeTags;
return option;
}
} // namespace

constexpr SemanticTag semanticTagsBlack[] = { { .value = 0 } };
constexpr SemanticTag semanticTagsCappucino[] = { { .value = 0 } };
constexpr SemanticTag semanticTagsEspresso[] = { { .value = 0 } };
ModeTagType modeTagsBlack[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } };
ModeTagType modeTagsCappucino[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } };
ModeTagType modeTagsEspresso[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } };

// TODO: Configure your options for each endpoint
storage_value_type StaticSupportedModesManager::coffeeOptions[] = {
buildModeOptionStruct("Black", 0, List<const SemanticTag>(semanticTagsBlack)),
buildModeOptionStruct("Cappuccino", 4, List<const SemanticTag>(semanticTagsCappucino)),
buildModeOptionStruct("Espresso", 7, List<const SemanticTag>(semanticTagsEspresso))
buildModeOptionStruct("Black", 0, List<const ModeTagType>(modeTagsBlack)),
buildModeOptionStruct("Cappuccino", 4, List<const ModeTagType>(modeTagsCappucino)),
buildModeOptionStruct("Espresso", 7, List<const ModeTagType>(modeTagsEspresso))
};
const StaticSupportedModesManager::EndpointSpanPair
StaticSupportedModesManager::supportedOptionsByEndpoints[EMBER_AF_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT] = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down Expand Up @@ -2029,22 +2041,43 @@ server cluster BooleanState = 69 {

/** Attributes and commands for selecting a mode from a list of supported options. */
server cluster ModeSelect = 80 {
enum ModeTag : ENUM16 {
kAuto = 0;
kQuick = 1;
kQuiet = 2;
kLowNoise = 3;
kLowEnergy = 4;
kVacation = 5;
kMin = 6;
kMax = 7;
kNight = 8;
kDay = 9;
}

enum StatusCode : ENUM8 {
kSuccess = 0;
kUnsupportedMode = 1;
kGenericFailure = 2;
}

bitmap Feature : BITMAP32 {
kDeponoff = 0x1;
kOnOff = 0x1;
kExtendedStatus = 0x2;
}

struct SemanticTagStruct {
vendor_id mfgCode = 0;
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
SemanticTagStruct semanticTags[] = 2;
ModeTagStruct modeTags[] = 2;
}

readonly attribute char_string<32> description = 0;
readonly attribute char_string<64> description = 0;
readonly attribute nullable enum16 standardNamespace = 1;
readonly attribute ModeOptionStruct supportedModes[] = 2;
readonly attribute int8u currentMode = 3;
Expand Down
12 changes: 12 additions & 0 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
12 changes: 12 additions & 0 deletions examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
12 changes: 12 additions & 0 deletions examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
12 changes: 12 additions & 0 deletions examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
12 changes: 12 additions & 0 deletions examples/chef/devices/rootnode_fan_7N2TobIlOX.matter
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
12 changes: 12 additions & 0 deletions examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
Expand Down
Loading

0 comments on commit 4005041

Please sign in to comment.