From 07938bb3d20159fea58b5c29b3ff88c179e9505b Mon Sep 17 00:00:00 2001 From: Cecille Freeman Date: Mon, 29 Jul 2024 10:40:19 -0400 Subject: [PATCH] Fix test errors - Need tag list on descriptors for ep3 and ep4 because they're now sibling endpoints - Fix desc test to expect the other endpoint --- examples/all-clusters-app/linux/main-common.cpp | 15 ++++++++++++++- src/app/tests/suites/TestDescriptorCluster.yaml | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 1d1799ece3581b..ddbcaee06b889c 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -80,13 +80,19 @@ Clusters::ValveConfigurationAndControl::ValveControlDelegate sValveDelegate; Clusters::TimeSynchronization::ExtendedTimeSyncDelegate sTimeSyncDelegate; // Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces -constexpr const uint8_t kNamespaceCommon = 7; +constexpr const uint8_t kNamespaceCommon = 7; +constexpr const uint8_t kNamespaceSwitches = 0x43; + // Common Number Namespace: 7, tag 0 (Zero) constexpr const uint8_t kTagCommonZero = 0; // Common Number Namespace: 7, tag 1 (One) constexpr const uint8_t kTagCommonOne = 1; // Common Number Namespace: 7, tag 2 (Two) constexpr const uint8_t kTagCommonTwo = 2; +// Switches namespace: 0x43, tag = 0x03 (Up) +constexpr const uint8_t kTagSwitchesUp = 0x03; +// Switches namespace: 0x43, tag = 0x04 (Down) +constexpr const uint8_t kTagSwitchesDown = 0x04; constexpr const uint8_t kNamespacePosition = 8; // Common Position Namespace: 8, tag: 0 (Left) @@ -104,6 +110,11 @@ const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp1TagList[] = { const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp2TagList[] = { { .namespaceID = kNamespaceCommon, .tag = kTagCommonTwo }, { .namespaceID = kNamespacePosition, .tag = kTagPositionRight } }; +// Endpoints 3 and 4 are an action switch and a non-action switch. On the device, they're tagged as up and down because why not. +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp3TagList[] = { { .namespaceID = kNamespaceSwitches, + .tag = kTagSwitchesUp } }; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp4TagList[] = { { .namespaceID = kNamespaceSwitches, + .tag = kTagSwitchesDown } }; } // namespace #ifdef MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER @@ -238,6 +249,8 @@ void ApplicationInit() SetTagList(/* endpoint= */ 0, Span(gEp0TagList)); SetTagList(/* endpoint= */ 1, Span(gEp1TagList)); SetTagList(/* endpoint= */ 2, Span(gEp2TagList)); + SetTagList(/* endpoint= */ 3, Span(gEp3TagList)); + SetTagList(/* endpoint= */ 4, Span(gEp4TagList)); } void ApplicationShutdown() diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index 21a43fbe3c1cd0..39179e1143bd75 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -82,7 +82,7 @@ tests: command: "readAttribute" attribute: "PartsList" response: - value: [1, 2, 3] + value: [1, 2, 3, 4] - label: "Read attribute ClusterRevision" command: "readAttribute"