Skip to content

Commit

Permalink
Update mode select xml following spec pr 7151 (#27249)
Browse files Browse the repository at this point in the history
* Renamed mode-select-cluster.xml to mode-base-cluster.xml and updated the contets to match the spec from PR 7151

* Renamed and updated the mode aliases to match the spec PR 7151. Updated the relevant lists.

* Added the ModeSelect cluster xml from v1.1

* Updated the mode select aliase names in the cotroller BUILD.gn

* Added the ModeSelect cluster and mode aliases to the contoller-clusters.zap

* Generated the zap code.

* Fixed typo in Mode Select

* Regenerated code.

* Reverted the mode select parts of the example source code to v1.1.

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

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

* Fixed typo.

* Removed the use of the detail namespace for structs as it is failing tests.

* Regenerated code.

* Reverted the mode select test to v1.1.

* Restyled by prettier-yaml

* Regenerated code.

* Authored by Boris Zbarsky: reverts fixes made when semantic tags where remaned to mode tags.

* Regenerated code after merge.

* Removed the description attribete from the mode base and all its aliased clusters.

* Regenerated code after removing the description attribute.

* Added a comment to explain why we have ModeBase enums commentd out.

* Regenerated code after merge.

* Removed duplicate entries in the data_modle/build.gn file caused by the merge.

---------

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
3 people authored and pull[bot] committed Oct 21, 2023
1 parent 1e11713 commit 2477281
Show file tree
Hide file tree
Showing 119 changed files with 3,267 additions and 5,802 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +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/dishwasher-mode-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 @@ -155,12 +155,13 @@ 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/laundry-washer-mode-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 \
src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml \
Expand All @@ -176,11 +177,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-and-temperature-controlled-cabinet-mode-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/rvc-clean-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-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
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down Expand Up @@ -2315,40 +2314,19 @@ 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 {
kOnOff = 0x1;
kExtendedStatus = 0x2;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
struct SemanticTagStruct {
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;
SemanticTagStruct semanticTags[] = 2;
}

readonly attribute char_string<64> description = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,31 @@ using namespace chip::app::Clusters::ModeSelect;
using chip::Protocols::InteractionModel::Status;

using ModeOptionStructType = Structs::ModeOptionStruct::Type;
using ModeTagType = Structs::ModeTagStruct::Type;
using SemanticTag = Structs::SemanticTagStruct::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 ModeTagType> & modeTags)
Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode,
const List<const SemanticTag> & semanticTags)
{
Structs::ModeOptionStruct::Type option;
option.label = CharSpan::fromCharString(label);
option.mode = mode;
option.modeTags = modeTags;
option.label = CharSpan::fromCharString(label);
option.mode = mode;
option.semanticTags = semanticTags;
return option;
}
} // namespace

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

// TODO: Configure your options for each endpoint
storage_value_type StaticSupportedModesManager::coffeeOptions[] = {
buildModeOptionStruct("Black", 0, List<const ModeTagType>(modeTagsBlack)),
buildModeOptionStruct("Cappuccino", 4, List<const ModeTagType>(modeTagsCappucino)),
buildModeOptionStruct("Espresso", 7, List<const ModeTagType>(modeTagsEspresso))
buildModeOptionStruct("Black", 0, List<const SemanticTag>(semanticTagsBlack)),
buildModeOptionStruct("Cappuccino", 4, List<const SemanticTag>(semanticTagsCappucino)),
buildModeOptionStruct("Espresso", 7, List<const SemanticTag>(semanticTagsEspresso))
};
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
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down Expand Up @@ -2048,40 +2047,19 @@ 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 {
kOnOff = 0x1;
kExtendedStatus = 0x2;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
struct SemanticTagStruct {
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;
SemanticTagStruct semanticTags[] = 2;
}

readonly attribute char_string<64> description = 0;
Expand Down
1 change: 0 additions & 1 deletion examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
1 change: 0 additions & 1 deletion examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
1 change: 0 additions & 1 deletion examples/chef/devices/rootnode_fan_7N2TobIlOX.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
1 change: 0 additions & 1 deletion examples/chef/devices/rootnode_pump_a811bb33a0.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
1 change: 0 additions & 1 deletion examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
optional char_string<64> tagName = 2;
}

struct ModeOptionStruct {
Expand Down
Loading

0 comments on commit 2477281

Please sign in to comment.