nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
onoff_light.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#pragma once
8
10
12public:
13 OnOffLightDevice(const char *uniqueID, const char *nodeLabel);
14
15 bool GetOnOff() { return mOnOff; }
16 void Toggle() { mOnOff = !mOnOff; }
17
19 CHIP_ERROR HandleRead(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer,
20 uint16_t maxReadLength) override;
21 CHIP_ERROR HandleReadOnOff(chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength);
22 CHIP_ERROR HandleReadGroups(chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength);
23 CHIP_ERROR HandleWrite(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer,
24 size_t size) override;
25 CHIP_ERROR HandleAttributeChange(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data,
26 size_t dataSize) override;
27
28 static constexpr uint16_t GetOnOffClusterRevision() { return 6; }
29 static constexpr uint32_t GetOnOffFeatureMap() { return 1; }
30 static constexpr uint16_t GetGroupsClusterRevision() { return 4; }
31 static constexpr uint32_t GetGroupsFeatureMap() { return 1; }
32 static constexpr uint8_t GetGroupsNameSupportMap() { return 0; }
33
34private:
35 bool mOnOff{ false };
36 bool mGlobalSceneControl{ false };
37 int16_t mOnTime{ 0 };
38 int16_t mOffWaitTime{ 0 };
39 chip::app::Clusters::OnOff::StartUpOnOffEnum mStartUpOnOff{
40 chip::app::Clusters::OnOff::StartUpOnOffEnum::kUnknownEnumValue
41 };
42};
@ OnOffLight
Definition matter_bridged_device.h:89
Definition matter_bridged_device.h:85
OnOffLightDevice(const char *uniqueID, const char *nodeLabel)
static constexpr uint8_t GetGroupsNameSupportMap()
Definition onoff_light.h:32
CHIP_ERROR HandleReadGroups(chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength)
static constexpr uint32_t GetOnOffFeatureMap()
Definition onoff_light.h:29
CHIP_ERROR HandleReadOnOff(chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength)
uint16_t GetDeviceType() const override
Definition onoff_light.h:18
bool GetOnOff()
Definition onoff_light.h:15
static constexpr uint32_t GetGroupsFeatureMap()
Definition onoff_light.h:31
CHIP_ERROR HandleRead(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength) override
static constexpr uint16_t GetGroupsClusterRevision()
Definition onoff_light.h:30
void Toggle()
Definition onoff_light.h:16
static constexpr uint16_t GetOnOffClusterRevision()
Definition onoff_light.h:28
CHIP_ERROR HandleWrite(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer, size_t size) override
CHIP_ERROR HandleAttributeChange(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) override
Definition onoff_light.h:11