Skip to content

Commit

Permalink
Fix test errors
Browse files Browse the repository at this point in the history
- Need tag list on descriptors for ep3 and ep4 because they're now
  sibling endpoints
- Fix desc test to expect the other endpoint
  • Loading branch information
cecille committed Jul 29, 2024
1 parent b4a4b3d commit 07938bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -238,6 +249,8 @@ void ApplicationInit()
SetTagList(/* endpoint= */ 0, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp0TagList));
SetTagList(/* endpoint= */ 1, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp1TagList));
SetTagList(/* endpoint= */ 2, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp2TagList));
SetTagList(/* endpoint= */ 3, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp3TagList));
SetTagList(/* endpoint= */ 4, Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(gEp4TagList));
}

void ApplicationShutdown()
Expand Down
2 changes: 1 addition & 1 deletion src/app/tests/suites/TestDescriptorCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 07938bb

Please sign in to comment.