Skip to content

Commit 07938bb

Browse files
committed
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
1 parent b4a4b3d commit 07938bb

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

examples/all-clusters-app/linux/main-common.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,19 @@ Clusters::ValveConfigurationAndControl::ValveControlDelegate sValveDelegate;
8080
Clusters::TimeSynchronization::ExtendedTimeSyncDelegate sTimeSyncDelegate;
8181

8282
// Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces
83-
constexpr const uint8_t kNamespaceCommon = 7;
83+
constexpr const uint8_t kNamespaceCommon = 7;
84+
constexpr const uint8_t kNamespaceSwitches = 0x43;
85+
8486
// Common Number Namespace: 7, tag 0 (Zero)
8587
constexpr const uint8_t kTagCommonZero = 0;
8688
// Common Number Namespace: 7, tag 1 (One)
8789
constexpr const uint8_t kTagCommonOne = 1;
8890
// Common Number Namespace: 7, tag 2 (Two)
8991
constexpr const uint8_t kTagCommonTwo = 2;
92+
// Switches namespace: 0x43, tag = 0x03 (Up)
93+
constexpr const uint8_t kTagSwitchesUp = 0x03;
94+
// Switches namespace: 0x43, tag = 0x04 (Down)
95+
constexpr const uint8_t kTagSwitchesDown = 0x04;
9096

9197
constexpr const uint8_t kNamespacePosition = 8;
9298
// Common Position Namespace: 8, tag: 0 (Left)
@@ -104,6 +110,11 @@ const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp1TagList[] = {
104110
const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp2TagList[] = {
105111
{ .namespaceID = kNamespaceCommon, .tag = kTagCommonTwo }, { .namespaceID = kNamespacePosition, .tag = kTagPositionRight }
106112
};
113+
// 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.
114+
const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp3TagList[] = { { .namespaceID = kNamespaceSwitches,
115+
.tag = kTagSwitchesUp } };
116+
const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp4TagList[] = { { .namespaceID = kNamespaceSwitches,
117+
.tag = kTagSwitchesDown } };
107118
} // namespace
108119

109120
#ifdef MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER
@@ -238,6 +249,8 @@ void ApplicationInit()
238249
SetTagList(/* endpoint= */ 0, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp0TagList));
239250
SetTagList(/* endpoint= */ 1, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp1TagList));
240251
SetTagList(/* endpoint= */ 2, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp2TagList));
252+
SetTagList(/* endpoint= */ 3, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp3TagList));
253+
SetTagList(/* endpoint= */ 4, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp4TagList));
241254
}
242255

243256
void ApplicationShutdown()

src/app/tests/suites/TestDescriptorCluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ tests:
8282
command: "readAttribute"
8383
attribute: "PartsList"
8484
response:
85-
value: [1, 2, 3]
85+
value: [1, 2, 3, 4]
8686

8787
- label: "Read attribute ClusterRevision"
8888
command: "readAttribute"

0 commit comments

Comments
 (0)