forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemoCluster.h
32 lines (24 loc) · 954 Bytes
/
DemoCluster.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include "BridgeGlobalStructs.h"
#include "third_party/connectedhomeip/examples/dynamic-bridge-app/linux/include/GeneratedClusters.h"
namespace clusters {
struct DemoClusterCluster : public GeneratedCluster
{
DemoClusterCluster() :
mSingleLabel(chip::CharSpan("singleLabel"), 32, ATTRIBUTE_MASK_WRITABLE, ZCL_STRUCT_ATTRIBUTE_TYPE, sizeof(LabelStruct)),
mSomeLabels(chip::CharSpan("someLabels"), 33, ATTRIBUTE_MASK_WRITABLE, ZCL_ARRAY_ATTRIBUTE_TYPE, sizeof(LabelStruct))
{
}
static constexpr uint32_t kClusterId =18;
chip::ClusterId GetClusterId() override { return kClusterId; }
std::vector<AttributeInterface*> GetAttributes() override
{
return std::vector<AttributeInterface*>({
static_cast<AttributeInterface*>(&mSingleLabel),
static_cast<AttributeInterface*>(&mSomeLabels),
});
}
Attribute<LabelStruct> mSingleLabel;
ListAttribute<std::vector<LabelStruct>> mSomeLabels;
};
}