forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemoCluster.h
32 lines (24 loc) · 1002 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() :
mSingleFailSafe(chip::CharSpan("singleFailSafe"), 5, ATTRIBUTE_MASK_WRITABLE, ZCL_STRUCT_ATTRIBUTE_TYPE, sizeof(ArmFailSafeRequest)),
mArmFailsafes(chip::CharSpan("armFailsafes"), 100, ATTRIBUTE_MASK_WRITABLE, ZCL_ARRAY_ATTRIBUTE_TYPE, sizeof(ArmFailSafeRequest))
{
}
static constexpr uint32_t kClusterId =10;
chip::ClusterId GetClusterId() override { return kClusterId; }
std::vector<AttributeInterface*> GetAttributes() override
{
return std::vector<AttributeInterface*>({
static_cast<AttributeInterface*>(&mSingleFailSafe),
static_cast<AttributeInterface*>(&mArmFailsafes),
});
}
Attribute<ArmFailSafeRequest> mSingleFailSafe;
ListAttribute<std::vector<ArmFailSafeRequest>> mArmFailsafes;
};
}